ruchiD commented on code in PR #3427:
URL: https://github.com/apache/fineract/pull/3427#discussion_r1315710914


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/AdvancedPaymentScheduleTransactionProcessor.java:
##########
@@ -74,20 +92,285 @@ protected Money 
handleRefundTransactionPaymentOfInstallment(LoanRepaymentSchedul
     }
 
     @Override
-    public ChangedTransactionDetail reprocessLoanTranactions(LocalDate 
disbursementDate, List<LoanTransaction> transactionsPostDisbursement,
-            MonetaryCurrency currency, List<LoanRepaymentScheduleInstallment> 
installments, Set<LoanCharge> charges) {
-        throw new NotImplementedException();
+    public ChangedTransactionDetail reprocessLoanTransactions(LocalDate 
disbursementDate,
+            List<LoanTransaction> transactionsPostDisbursement, 
MonetaryCurrency currency,
+            List<LoanRepaymentScheduleInstallment> installments, 
Set<LoanCharge> charges) {
+
+        // TODO: rewrite this whole logic step by step
+        if (charges != null) {
+            for (final LoanCharge loanCharge : charges) {
+                if (!loanCharge.isDueAtDisbursement()) {
+                    loanCharge.resetPaidAmount(currency);
+                }
+            }
+        }
+
+        for (final LoanRepaymentScheduleInstallment currentInstallment : 
installments) {
+            currentInstallment.resetDerivedComponents();
+            currentInstallment.updateDerivedFields(currency, disbursementDate);
+        }
+
+        // TODO: Remove this reprocess and add the charges to the installment 
in chronological order
+        final LoanRepaymentScheduleProcessingWrapper wrapper = new 
LoanRepaymentScheduleProcessingWrapper();

Review Comment:
   Hi Adam, one question here, as charges are added to installment according to 
charge due date, what changes we are proposing here for following the 
chronological order.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to