adamsaghy commented on code in PR #2954:
URL: https://github.com/apache/fineract/pull/2954#discussion_r1097585430
##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java:
##########
@@ -565,13 +565,28 @@ private void
createJournalEntriesForCreditBalanceRefund(final LoanDTO loanDTO, f
// transaction properties
final String transactionId = loanTransactionDTO.getTransactionId();
final LocalDate transactionDate =
loanTransactionDTO.getTransactionDate();
- final BigDecimal refundAmount = loanTransactionDTO.getAmount();
final boolean isReversal = loanTransactionDTO.isReversed();
final Long paymentTypeId = loanTransactionDTO.getPaymentTypeId();
- this.helper.createJournalEntriesAndReversalsForLoan(office,
currencyCode, AccrualAccountsForLoan.OVERPAYMENT.getValue(),
- AccrualAccountsForLoan.FUND_SOURCE.getValue(), loanProductId,
paymentTypeId, loanId, transactionId, transactionDate,
- refundAmount, isReversal);
+ BigDecimal overpaymentAmount = loanTransactionDTO.getOverPayment();
+ BigDecimal principalAmount = loanTransactionDTO.getPrincipal();
+
+ BigDecimal totalAmount = BigDecimal.ZERO;
+ List<JournalAmountHolder> journalAmountHolders = new ArrayList<>();
+
+ if (principalAmount != null &&
principalAmount.compareTo(BigDecimal.ZERO) != 0) {
Review Comment:
It should never happen, but still > 0 would be better... only positive
amount it can be
--
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]