adamsaghy commented on code in PR #3952:
URL: https://github.com/apache/fineract/pull/3952#discussion_r1663723329


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/service/LoanScheduleAssembler.java:
##########
@@ -1379,6 +1382,21 @@ public void updateLoanApplicationAttributes(JsonCommand 
command, Loan loan, Map<
             changes.put(LoanProductConstants.IS_EQUAL_AMORTIZATION_PARAM, 
newValue);
             loanProductRelatedDetail.setEqualAmortization(newValue);
         }
+
+        final boolean isDownPaymentEnabled = validateDownPaymentAttribute(
+                
loan.loanProduct().getLoanProductRelatedDetail().isEnableDownPayment(), 
command.parsedJson());
+        if (isDownPaymentEnabled != 
loanProductRelatedDetail.isEnableDownPayment()) {
+            changes.put(LoanProductConstants.ENABLE_DOWN_PAYMENT, 
isDownPaymentEnabled);
+            
loanProductRelatedDetail.setEnableDownPayment(isDownPaymentEnabled);
+            
loanProductRelatedDetail.setEnableAutoRepaymentForDownPayment(isDownPaymentEnabled);
+            // Reset the other DownPayment attributes
+            if (!isDownPaymentEnabled) {
+                
loanProductRelatedDetail.setDisbursedAmountPercentageForDownPayment(null);
+            } else {

Review Comment:
   This case cannot happen due to the validation restrictions.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@fineract.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to