Merge pull request #896 from lingalamadhukar/MIFOSX-1166
MIFOSX-281 Add template for recovery payments
This commit is contained in:
+2
@@ -92,6 +92,8 @@ public class LoanTransactionsApiResource {
|
|||||||
transactionData = this.loanReadPlatformService.retrieveDisbursalTemplate(loanId, true);
|
transactionData = this.loanReadPlatformService.retrieveDisbursalTemplate(loanId, true);
|
||||||
} else if(is(commandParam, "disburseToSavings")){
|
} else if(is(commandParam, "disburseToSavings")){
|
||||||
transactionData = this.loanReadPlatformService.retrieveDisbursalTemplate(loanId, false);
|
transactionData = this.loanReadPlatformService.retrieveDisbursalTemplate(loanId, false);
|
||||||
|
} else if(is(commandParam, "recoverypayment")){
|
||||||
|
transactionData = this.loanReadPlatformService.retrieveRecoveryPaymentTemplate(loanId);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new UnrecognizedQueryParamException("command", commandParam);
|
throw new UnrecognizedQueryParamException("command", commandParam);
|
||||||
|
|||||||
+4
@@ -767,6 +767,10 @@ public class Loan extends AbstractPersistable<Long> {
|
|||||||
}
|
}
|
||||||
return amount.getAmount();
|
return amount.getAmount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BigDecimal getTotalWrittenOff() {
|
||||||
|
return this.summary.getTotalWrittenOff();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param calculationType
|
* @param calculationType
|
||||||
|
|||||||
+4
@@ -282,4 +282,8 @@ public final class LoanSummary {
|
|||||||
public BigDecimal getTotalPrincipalRepaid() {
|
public BigDecimal getTotalPrincipalRepaid() {
|
||||||
return this.totalPrincipalRepaid;
|
return this.totalPrincipalRepaid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BigDecimal getTotalWrittenOff() {
|
||||||
|
return this.totalWrittenOff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+2
@@ -80,4 +80,6 @@ public interface LoanReadPlatformService {
|
|||||||
Collection<LoanTermVariationsData> retrieveLoanTermVariations(Long loanId, Integer termType);
|
Collection<LoanTermVariationsData> retrieveLoanTermVariations(Long loanId, Integer termType);
|
||||||
|
|
||||||
Collection<LoanScheduleAccrualData> retriveScheduleAccrualData();
|
Collection<LoanScheduleAccrualData> retriveScheduleAccrualData();
|
||||||
|
|
||||||
|
LoanTransactionData retrieveRecoveryPaymentTemplate(Long loanId);
|
||||||
}
|
}
|
||||||
+12
@@ -1377,4 +1377,16 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoanTransactionData retrieveRecoveryPaymentTemplate(Long loanId) {
|
||||||
|
final Loan loan = this.loanRepository.findOne(loanId);
|
||||||
|
if (loan == null) { throw new LoanNotFoundException(loanId); }
|
||||||
|
final LoanTransactionEnumData transactionType = LoanEnumerations.transactionType(LoanTransactionType.RECOVERY_REPAYMENT);
|
||||||
|
final Collection<CodeValueData> paymentOptions = this.codeValueReadPlatformService
|
||||||
|
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
||||||
|
return new LoanTransactionData(null, null, null, transactionType, null, null, null, loan.getTotalWrittenOff(), null, null, null,
|
||||||
|
null, null, paymentOptions, null, null, null);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user