MIFOSX-1267 and fix for view loan audit entry

This commit is contained in:
Madhukar
2014-06-04 09:24:05 +05:30
parent 75ac5c2d68
commit 4c9ccd2d53
6 changed files with 22 additions and 2 deletions
@@ -379,7 +379,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
if (entityName.equalsIgnoreCase("LOAN") || entityName.equalsIgnoreCase("LOANPRODUCT")) {
final String[] enumTypes = { "loanTermFrequencyType", "termFrequencyType", "repaymentFrequencyType", "amortizationType",
"interestType", "interestCalculationPeriodType", "interestRateFrequencyType", "loanType", "accountingRule" };
"interestType", "interestCalculationPeriodType", "interestRateFrequencyType", "accountingRule" };
for (final String typeName : enumTypes) {
if (commandAsJsonMap.containsKey(typeName)) {
@@ -83,7 +83,7 @@ public class LoanTransactionsApiResource {
} else if (is(commandParam, "waiveinterest")) {
transactionData = this.loanReadPlatformService.retrieveWaiveInterestDetails(loanId);
} else if (is(commandParam, "writeoff")) {
transactionData = this.loanReadPlatformService.retrieveNewClosureDetails();
transactionData = this.loanReadPlatformService.retrieveLoanWriteoffTemplate(loanId);
} else if (is(commandParam, "close-rescheduled")) {
transactionData = this.loanReadPlatformService.retrieveNewClosureDetails();
} else if (is(commandParam, "close")) {
@@ -1145,5 +1145,9 @@ public class LoanAccountData {
public Long loanProductId() {
return this.loanProductId;
}
public BigDecimal getTotalOutstandingAmount(){
return this.summary.getTotalOutstanding();
}
}
@@ -98,4 +98,8 @@ public class LoanSummaryData {
this.totalOverdue = totalOverdue;
this.overdueSinceDate = overdueSinceDate;
}
public BigDecimal getTotalOutstanding() {
return this.totalOutstanding;
}
}
@@ -82,4 +82,6 @@ public interface LoanReadPlatformService {
Collection<LoanScheduleAccrualData> retriveScheduleAccrualData();
LoanTransactionData retrieveRecoveryPaymentTemplate(Long loanId);
LoanTransactionData retrieveLoanWriteoffTemplate(Long loanId);
}
@@ -1389,4 +1389,14 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
}
@Override
public LoanTransactionData retrieveLoanWriteoffTemplate(final Long loanId) {
final LoanAccountData loan = this.retrieveOne(loanId);
final LoanTransactionEnumData transactionType = LoanEnumerations.transactionType(LoanTransactionType.WRITEOFF);
return new LoanTransactionData(null, null, null, transactionType, null, loan.currency(), DateUtils.getLocalDateOfTenant(),
loan.getTotalOutstandingAmount(), null, null, null, null, null, null, null, null);
}
}