MIFOSX-376: sum up advance and late payments for each repayment period for totals display.
This commit is contained in:
+1
@@ -20,6 +20,7 @@ import org.springframework.data.jpa.domain.AbstractPersistable;
|
|||||||
@Table(name = "acc_rule_tags", uniqueConstraints = { @UniqueConstraint(columnNames = { "acc_rule_id", "tag_id", "acc_type_enum" }, name = "UNIQUE_ACCOUNT_RULE_TAGS") })
|
@Table(name = "acc_rule_tags", uniqueConstraints = { @UniqueConstraint(columnNames = { "acc_rule_id", "tag_id", "acc_type_enum" }, name = "UNIQUE_ACCOUNT_RULE_TAGS") })
|
||||||
public class AccountingTagRule extends AbstractPersistable<Long> {
|
public class AccountingTagRule extends AbstractPersistable<Long> {
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "acc_rule_id", nullable = false)
|
@JoinColumn(name = "acc_rule_id", nullable = false)
|
||||||
private AccountingRule accountingRule;
|
private AccountingRule accountingRule;
|
||||||
|
|||||||
+6
-1
@@ -38,6 +38,8 @@ public class LoanScheduleData {
|
|||||||
private final BigDecimal totalWrittenOff;
|
private final BigDecimal totalWrittenOff;
|
||||||
private final BigDecimal totalRepaymentExpected;
|
private final BigDecimal totalRepaymentExpected;
|
||||||
private final BigDecimal totalRepayment;
|
private final BigDecimal totalRepayment;
|
||||||
|
private final BigDecimal totalPaidInAdvance;
|
||||||
|
private final BigDecimal totalPaidLate;
|
||||||
private final BigDecimal totalOutstanding;
|
private final BigDecimal totalOutstanding;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,7 +53,8 @@ public class LoanScheduleData {
|
|||||||
final BigDecimal totalPrincipalDisbursed, final BigDecimal totalPrincipalExpected, final BigDecimal totalPrincipalPaid,
|
final BigDecimal totalPrincipalDisbursed, final BigDecimal totalPrincipalExpected, final BigDecimal totalPrincipalPaid,
|
||||||
final BigDecimal totalInterestCharged, final BigDecimal totalFeeChargesCharged, final BigDecimal totalPenaltyChargesCharged,
|
final BigDecimal totalInterestCharged, final BigDecimal totalFeeChargesCharged, final BigDecimal totalPenaltyChargesCharged,
|
||||||
final BigDecimal totalWaived, final BigDecimal totalWrittenOff, final BigDecimal totalRepaymentExpected,
|
final BigDecimal totalWaived, final BigDecimal totalWrittenOff, final BigDecimal totalRepaymentExpected,
|
||||||
final BigDecimal totalRepayment, final BigDecimal totalOutstanding) {
|
final BigDecimal totalRepayment, final BigDecimal totalPaidInAdvance, final BigDecimal totalPaidLate,
|
||||||
|
final BigDecimal totalOutstanding) {
|
||||||
this.currency = currency;
|
this.currency = currency;
|
||||||
this.periods = periods;
|
this.periods = periods;
|
||||||
this.loanTermInDays = loanTermInDays;
|
this.loanTermInDays = loanTermInDays;
|
||||||
@@ -65,6 +68,8 @@ public class LoanScheduleData {
|
|||||||
this.totalWrittenOff = totalWrittenOff;
|
this.totalWrittenOff = totalWrittenOff;
|
||||||
this.totalRepaymentExpected = totalRepaymentExpected;
|
this.totalRepaymentExpected = totalRepaymentExpected;
|
||||||
this.totalRepayment = totalRepayment;
|
this.totalRepayment = totalRepayment;
|
||||||
|
this.totalPaidInAdvance = totalPaidInAdvance;
|
||||||
|
this.totalPaidLate = totalPaidLate;
|
||||||
this.totalOutstanding = totalOutstanding;
|
this.totalOutstanding = totalOutstanding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -72,11 +72,13 @@ public final class LoanScheduleModel {
|
|||||||
BigDecimal totalWaived = null;
|
BigDecimal totalWaived = null;
|
||||||
BigDecimal totalWrittenOff = null;
|
BigDecimal totalWrittenOff = null;
|
||||||
BigDecimal totalRepayment = null;
|
BigDecimal totalRepayment = null;
|
||||||
|
BigDecimal totalPaidInAdvance = null;
|
||||||
|
BigDecimal totalPaidLate = null;
|
||||||
|
|
||||||
return new LoanScheduleData(currency, periodsData, this.loanTermInDays, this.totalPrincipalDisbursed.getAmount(),
|
return new LoanScheduleData(currency, periodsData, this.loanTermInDays, this.totalPrincipalDisbursed.getAmount(),
|
||||||
this.totalPrincipalExpected, this.totalPrincipalPaid, this.totalInterestCharged, this.totalFeeChargesCharged,
|
this.totalPrincipalExpected, this.totalPrincipalPaid, this.totalInterestCharged, this.totalFeeChargesCharged,
|
||||||
this.totalPenaltyChargesCharged, totalWaived, totalWrittenOff, this.totalRepaymentExpected, totalRepayment,
|
this.totalPenaltyChargesCharged, totalWaived, totalWrittenOff, this.totalRepaymentExpected, totalRepayment,
|
||||||
this.totalOutstanding);
|
totalPaidInAdvance, totalPaidLate, this.totalOutstanding);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<LoanScheduleModelPeriod> getPeriods() {
|
public Collection<LoanScheduleModelPeriod> getPeriods() {
|
||||||
|
|||||||
+5
-1
@@ -702,6 +702,8 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
Money totalWrittenOff = Money.zero(monCurrency);
|
Money totalWrittenOff = Money.zero(monCurrency);
|
||||||
Money totalRepaymentExpected = Money.zero(monCurrency);
|
Money totalRepaymentExpected = Money.zero(monCurrency);
|
||||||
Money totalRepayment = Money.zero(monCurrency);
|
Money totalRepayment = Money.zero(monCurrency);
|
||||||
|
Money totalPaidInAdvance = Money.zero(monCurrency);
|
||||||
|
Money totalPaidLate = Money.zero(monCurrency);
|
||||||
Money totalOutstanding = Money.zero(monCurrency);
|
Money totalOutstanding = Money.zero(monCurrency);
|
||||||
|
|
||||||
// update totals with details of fees charged during disbursement
|
// update totals with details of fees charged during disbursement
|
||||||
@@ -783,6 +785,8 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
|
|
||||||
totalRepaymentExpected = totalRepaymentExpected.plus(totalDueForPeriod);
|
totalRepaymentExpected = totalRepaymentExpected.plus(totalDueForPeriod);
|
||||||
totalRepayment = totalRepayment.plus(totalPaidForPeriod);
|
totalRepayment = totalRepayment.plus(totalPaidForPeriod);
|
||||||
|
totalPaidInAdvance = totalPaidInAdvance.plus(totalPaidInAdvanceForPeriod);
|
||||||
|
totalPaidLate = totalPaidLate.plus(totalPaidLateForPeriod);
|
||||||
totalOutstanding = totalOutstanding.plus(totalOutstandingForPeriod);
|
totalOutstanding = totalOutstanding.plus(totalOutstandingForPeriod);
|
||||||
|
|
||||||
if (fromDate == null) {
|
if (fromDate == null) {
|
||||||
@@ -810,7 +814,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
totalPrincipalExpected.getAmount(), totalPrincipalPaid.getAmount(), totalInterestCharged.getAmount(),
|
totalPrincipalExpected.getAmount(), totalPrincipalPaid.getAmount(), totalInterestCharged.getAmount(),
|
||||||
totalFeeChargesCharged.getAmount(), totalPenaltyChargesCharged.getAmount(), totalWaived.getAmount(),
|
totalFeeChargesCharged.getAmount(), totalPenaltyChargesCharged.getAmount(), totalWaived.getAmount(),
|
||||||
totalWrittenOff.getAmount(), totalRepaymentExpected.getAmount(), totalRepayment.getAmount(),
|
totalWrittenOff.getAmount(), totalRepaymentExpected.getAmount(), totalRepayment.getAmount(),
|
||||||
totalOutstanding.getAmount());
|
totalPaidInAdvance.getAmount(), totalPaidLate.getAmount(), totalOutstanding.getAmount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user