FINERACT-1806: Advanced accounting - Charge-off reason
This commit is contained in:
+9
-7
@@ -2190,13 +2190,9 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom<Long> {
|
||||
boolean isBeforeChargeOffDate) {
|
||||
final Map<String, Object> accountingBridgeDataChargeOff = new LinkedHashMap<>(
|
||||
getAccountingBridgeDataGenericAttributes(currencyCode, isAccountTransfer));
|
||||
if (isBeforeChargeOffDate) {
|
||||
accountingBridgeDataChargeOff.put("isChargeOff", false);
|
||||
accountingBridgeDataChargeOff.put("isFraud", isFraud());
|
||||
} else {
|
||||
accountingBridgeDataChargeOff.put("isChargeOff", isChargedOff());
|
||||
accountingBridgeDataChargeOff.put("isFraud", isFraud());
|
||||
}
|
||||
accountingBridgeDataChargeOff.put("isChargeOff", !isBeforeChargeOffDate && isChargedOff());
|
||||
accountingBridgeDataChargeOff.put("isFraud", isFraud());
|
||||
accountingBridgeDataChargeOff.put("chargeOffReasonCodeValue", fetchChargeOffReasonId());
|
||||
return accountingBridgeDataChargeOff;
|
||||
}
|
||||
|
||||
@@ -2274,6 +2270,8 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom<Long> {
|
||||
accountingBridgeData.put("periodicAccrualBasedAccountingEnabled", isPeriodicAccrualAccountingEnabledOnLoanProduct());
|
||||
accountingBridgeData.put("isAccountTransfer", isAccountTransfer);
|
||||
accountingBridgeData.put("isChargeOff", isChargedOff());
|
||||
accountingBridgeData.put("chargeOffReasonCodeValue", fetchChargeOffReasonId());
|
||||
|
||||
accountingBridgeData.put("isFraud", isFraud());
|
||||
|
||||
final List<Map<String, Object>> newLoanTransactions = new ArrayList<>();
|
||||
@@ -2290,6 +2288,10 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom<Long> {
|
||||
return accountingBridgeData;
|
||||
}
|
||||
|
||||
private Long fetchChargeOffReasonId() {
|
||||
return isChargedOff() && getChargeOffReason() != null ? getChargeOffReason().getId() : null;
|
||||
}
|
||||
|
||||
public Money getReceivableInterest(final LocalDate tillDate) {
|
||||
Money receivableInterest = Money.zero(getCurrency());
|
||||
for (final LoanTransaction transaction : this.loanTransactions) {
|
||||
|
||||
Reference in New Issue
Block a user