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


##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccrualBasedAccountingProcessorForSavings.java:
##########
@@ -205,35 +212,45 @@ else if 
(savingsTransactionDTO.getTransactionType().isFeeDeduction() && savingsT
                             savingsProductId, paymentTypeId, savingsId, 
transactionId, transactionDate, overdraftAmount, isReversal,
                             penaltyPayments);
                     if (isPositive) {
+                        final ChargePaymentDTO chargePaymentDTO = 
penaltyPayments.get(0);
+                        AccrualAccountsForSavings accountTypeToBeDebited = 
AccrualAccountsForSavings.SAVINGS_CONTROL;
+
                         
this.helper.createAccrualBasedJournalEntriesAndReversalsForSavingsCharges(office,
 currencyCode,
-                                AccrualAccountsForSavings.SAVINGS_CONTROL, 
AccrualAccountsForSavings.INCOME_FROM_PENALTIES,
-                                savingsProductId, paymentTypeId, savingsId, 
transactionId, transactionDate,
-                                amount.subtract(overdraftAmount), isReversal, 
penaltyPayments);
+                                accountTypeToBeDebited, 
AccrualAccountsForSavings.INCOME_FROM_PENALTIES, savingsProductId, 
paymentTypeId,
+                                savingsId, transactionId, transactionDate, 
amount.subtract(overdraftAmount), isReversal, penaltyPayments);
                     }
                 } else {
                     
this.helper.createAccrualBasedJournalEntriesAndReversalsForSavingsCharges(office,
 currencyCode,
                             
AccrualAccountsForSavings.OVERDRAFT_PORTFOLIO_CONTROL, 
AccrualAccountsForSavings.INCOME_FROM_FEES,
                             savingsProductId, paymentTypeId, savingsId, 
transactionId, transactionDate, overdraftAmount, isReversal,
                             feePayments);
                     if (isPositive) {
+                        final ChargePaymentDTO chargePaymentDTO = 
feePayments.get(0);
+                        AccrualAccountsForSavings accountTypeToBeDebited = 
AccrualAccountsForSavings.SAVINGS_CONTROL;
+
                         
this.helper.createAccrualBasedJournalEntriesAndReversalsForSavingsCharges(office,
 currencyCode,
-                                AccrualAccountsForSavings.SAVINGS_CONTROL, 
AccrualAccountsForSavings.INCOME_FROM_FEES, savingsProductId,
-                                paymentTypeId, savingsId, transactionId, 
transactionDate, amount.subtract(overdraftAmount), isReversal,
-                                feePayments);
+                                accountTypeToBeDebited, 
AccrualAccountsForSavings.INCOME_FROM_FEES, savingsProductId, paymentTypeId,
+                                savingsId, transactionId, transactionDate, 
amount.subtract(overdraftAmount), isReversal, feePayments);
                     }
                 }
             }
 
             else if 
(savingsTransactionDTO.getTransactionType().isFeeDeduction()) {
                 // Is the Charge a penalty?
                 if (penaltyPayments.size() > 0) {
+                    final ChargePaymentDTO chargePaymentDTO = 
penaltyPayments.get(0);
+                    AccrualAccountsForSavings accountTypeToBeCredited = 
AccrualAccountsForSavings.INCOME_FROM_PENALTIES;
+
                     
this.helper.createAccrualBasedJournalEntriesAndReversalsForSavingsCharges(office,
 currencyCode,
-                            AccrualAccountsForSavings.SAVINGS_CONTROL, 
AccrualAccountsForSavings.INCOME_FROM_PENALTIES, savingsProductId,
-                            paymentTypeId, savingsId, transactionId, 
transactionDate, amount, isReversal, penaltyPayments);
+                            AccrualAccountsForSavings.SAVINGS_CONTROL, 
accountTypeToBeCredited, savingsProductId, paymentTypeId, savingsId,
+                            transactionId, transactionDate, amount, 
isReversal, penaltyPayments);
                 } else {
+                    final ChargePaymentDTO chargePaymentDTO = 
feePayments.get(0);

Review Comment:
   unused variable `chargePaymentDTO`



-- 
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