FINERACT-1785: Waive loan charge with same disbursement date

This commit is contained in:
Jose Alberto Hernandez
2022-12-19 16:01:53 +01:00
committed by Arnold Gálovics
parent adcd76154e
commit 9fba52abbb
3 changed files with 77 additions and 1 deletions
@@ -109,7 +109,10 @@ public abstract class AbstractLoanRepaymentScheduleTransactionProcessor implemen
LocalDate startDate = disbursementDate;
for (final LoanRepaymentScheduleInstallment installment : installments) {
for (final LoanCharge loanCharge : transferCharges) {
if (loanCharge.isDueForCollectionFromAndUpToAndIncluding(startDate, installment.getDueDate())) {
if (loanCharge.isDueForCollectionFromAndUpToAndIncluding(startDate, installment.getDueDate())
// Special case for Loan Charges (Due Date) added the same disbursement date
|| (startDate.equals(disbursementDate) && loanCharge.getDueDate() != null
&& loanCharge.getDueDate().equals(disbursementDate))) {
Money amountForProcess = loanCharge.getAmount(currency);
if (amountForProcess.isGreaterThan(loanTransaction.getAmount(currency))) {
amountForProcess = loanTransaction.getAmount(currency);