payment for disbursal

This commit is contained in:
Vishwas Babu AJ
2013-04-13 21:12:05 +05:30
parent debce5655f
commit 8e99a2ef36
4 changed files with 16 additions and 1 deletions
@@ -91,6 +91,8 @@ public class LoanTransactionsApiResource {
transactionData = this.loanReadPlatformService.retrieveNewClosureDetails();
} else if (is(commandParam, "close")) {
transactionData = this.loanReadPlatformService.retrieveNewClosureDetails();
} else if (is(commandParam, "disburse")) {
transactionData = this.loanReadPlatformService.retrieveDisbursalTemplate(loanId);
} else {
throw new UnrecognizedQueryParamException("command", commandParam);
}
@@ -1988,7 +1988,7 @@ public class Loan extends AbstractPersistable<Long> {
return date;
}
private LocalDate getExpectedDisbursedOnLocalDate() {
public LocalDate getExpectedDisbursedOnLocalDate() {
LocalDate expectedDisbursementDate = null;
if (this.expectedDisbursementDate != null) {
expectedDisbursementDate = new LocalDate(this.expectedDisbursementDate);
@@ -31,6 +31,8 @@ public interface LoanReadPlatformService {
LoanTransactionData retrieveLoanTransaction(Long loanId, Long transactionId);
LoanTransactionData retrieveNewClosureDetails();
LoanTransactionData retrieveDisbursalTemplate(Long loanId);
LoanAccountData retrieveTemplateWithCompleteGroupAndProductDetails(Long groupId, Long productId);
}
@@ -253,6 +253,16 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
return new LoanTransactionData(null, transactionType, null, null, DateUtils.getLocalDateOfTenant(), null, null, null, null, null);
}
@Override
public LoanTransactionData retrieveDisbursalTemplate(final Long loanId) {
final Loan loan = this.loanRepository.findOne(loanId);
if (loan == null) { throw new LoanNotFoundException(loanId); }
final LoanTransactionEnumData transactionType = LoanEnumerations.transactionType(LoanTransactionType.DISBURSEMENT);
final List<EnumOptionData> paymentOptions = loanDropdownReadPlatformService.retrievePaymentTypeOptions();
return new LoanTransactionData(null, transactionType, null, null, loan.getExpectedDisbursedOnLocalDate(), null, null, null, null,
null, paymentOptions);
}
@Override
public LoanTransactionData retrieveLoanTransaction(final Long loanId, final Long transactionId) {
@@ -740,4 +750,5 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
interestPortion, feeChargesPortion, penaltyChargesPortion);
}
}
}