Skip to content

Commit 0fa863a

Browse files
committed
FINERACT-2520: Add disbursement charges to total repayment expected
Signed-off-by: Wiki05 <vigneshdev1022@gmail.com> Signed-off-by: Vignesh <vigneshdev1022@gmail.com>
1 parent a58361b commit 0fa863a

2 files changed

Lines changed: 211 additions & 125 deletions

File tree

fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/ProgressiveLoanScheduleGenerator.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ public LoanScheduleModel generate(final MathContext mc, final LoanApplicationTer
144144
scheduleParams.incrementPeriodNumber();
145145
}
146146

147+
if (chargesDueAtTimeOfDisbursement.compareTo(BigDecimal.ZERO) > 0) {
148+
scheduleParams.addTotalRepaymentExpected(Money.of(currency, chargesDueAtTimeOfDisbursement, mc));
149+
}
150+
147151
if (loanApplicationTerms.isMultiDisburseLoan()) {
148152
processDisbursements(loanApplicationTerms, disbursementDataList, scheduleParams, interestScheduleModel, periods,
149153
chargesDueAtTimeOfDisbursement, true, mc);
@@ -317,6 +321,8 @@ private void processDisbursements(final LoanApplicationTerms loanApplicationTerm
317321
.disbursement(disbursementData.disbursementDate(), disbursedAmount, chargesDueAtTimeOfDisbursement);
318322
periods.add(disbursementPeriod);
319323

324+
scheduleParams.addTotalRepaymentExpected(Money.of(loanApplicationTerms.getCurrency(), chargesDueAtTimeOfDisbursement, mc));
325+
320326
// validation check for amount not exceeds specified max
321327
// amount as per the configuration
322328
if (loanApplicationTerms.isMultiDisburseLoan() && loanApplicationTerms.getMaxOutstandingBalance() != null) {

0 commit comments

Comments
 (0)