add total_recovered_derived field to LoanSummaryData object as fix for FINERACT-1113

This commit is contained in:
tonic889
2020-09-04 12:39:01 +03:00
committed by Petri Tuomola
parent 90b81c3458
commit 9f7ffe48b1
2 changed files with 8 additions and 3 deletions
@@ -61,6 +61,7 @@ public class LoanSummaryData {
private final BigDecimal totalWrittenOff;
private final BigDecimal totalOutstanding;
private final BigDecimal totalOverdue;
private final BigDecimal totalRecovered;
private final LocalDate overdueSinceDate;
private final Long writeoffReasonId;
private final String writeoffReason;
@@ -76,7 +77,7 @@ public class LoanSummaryData {
final BigDecimal penaltyChargesOverdue, final BigDecimal totalExpectedRepayment, final BigDecimal totalRepayment,
final BigDecimal totalExpectedCostOfLoan, final BigDecimal totalCostOfLoan, final BigDecimal totalWaived,
final BigDecimal totalWrittenOff, final BigDecimal totalOutstanding, final BigDecimal totalOverdue,
final LocalDate overdueSinceDate, final Long writeoffReasonId, final String writeoffReason) {
final LocalDate overdueSinceDate, final Long writeoffReasonId, final String writeoffReason, final BigDecimal totalRecovered) {
this.currency = currency;
this.principalDisbursed = principalDisbursed;
this.principalPaid = principalPaid;
@@ -113,6 +114,7 @@ public class LoanSummaryData {
this.overdueSinceDate = overdueSinceDate;
this.writeoffReasonId = writeoffReasonId;
this.writeoffReason = writeoffReason;
this.totalRecovered = totalRecovered;
}
public BigDecimal getTotalOutstanding() {
@@ -631,7 +631,8 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
+ " l.create_standing_instruction_at_disbursement as createStandingInstructionAtDisbursement, "
+ " lpvi.minimum_gap as minimuminstallmentgap, lpvi.maximum_gap as maximuminstallmentgap, "
+ " lp.can_use_for_topup as canUseForTopup, " + " l.is_topup as isTopup, " + " topup.closure_loan_id as closureLoanId, "
+ " topuploan.account_no as closureLoanAccountNo, " + " topup.topup_amount as topupAmount " + " from m_loan l" //
+ " l.total_recovered_derived as totalRecovered" + ", topuploan.account_no as closureLoanAccountNo, "
+ " topup.topup_amount as topupAmount " + " from m_loan l" //
+ " join m_product_loan lp on lp.id = l.product_id" //
+ " left join m_loan_recalculation_details lir on lir.loan_id = l.id "
+ " join m_currency rc on rc.`code` = l.currency_code" //
@@ -853,6 +854,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
final BigDecimal totalWrittenOff = JdbcSupport.getBigDecimalDefaultToZeroIfNull(rs, "totalWrittenOff");
final BigDecimal totalOutstanding = JdbcSupport.getBigDecimalDefaultToZeroIfNull(rs, "totalOutstanding");
final BigDecimal totalOverdue = JdbcSupport.getBigDecimalDefaultToZeroIfNull(rs, "totalOverdue");
final BigDecimal totalRecovered = JdbcSupport.getBigDecimalDefaultToZeroIfNull(rs, "totalRecovered");
final LocalDate overdueSinceDate = JdbcSupport.getLocalDate(rs, "overdueSinceDate");
if (overdueSinceDate != null) {
@@ -865,7 +867,8 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
feeChargesWaived, feeChargesWrittenOff, feeChargesOutstanding, feeChargesOverdue, penaltyChargesCharged,
penaltyChargesPaid, penaltyChargesWaived, penaltyChargesWrittenOff, penaltyChargesOutstanding,
penaltyChargesOverdue, totalExpectedRepayment, totalRepayment, totalExpectedCostOfLoan, totalCostOfLoan,
totalWaived, totalWrittenOff, totalOutstanding, totalOverdue, overdueSinceDate, writeoffReasonId, writeoffReason);
totalWaived, totalWrittenOff, totalOutstanding, totalOverdue, overdueSinceDate, writeoffReasonId, writeoffReason,
totalRecovered);
}
GroupGeneralData groupData = null;