MIFOSX-2129:Submitting Collection sheet for zero repayments create an entry in Loan trasaction page
This commit is contained in:
+2
-1
@@ -81,11 +81,12 @@ public final class CollectionSheetBulkRepaymentCommandFromApiJsonDeserializer ex
|
||||
if (paymentDetail == null) {
|
||||
detail = this.paymentDetailAssembler.fetchPaymentDetail(loanTransactionElement);
|
||||
}
|
||||
|
||||
if(transactionAmount != null && transactionAmount.intValue() > 0){
|
||||
loanRepaymentTransactions[i] = new SingleRepaymentCommand(loanId, transactionAmount, transactionDate, detail);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new CollectionSheetBulkRepaymentCommand(note, transactionDate, loanRepaymentTransactions);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -794,6 +794,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
List<Long> transactionIds = new ArrayList<>();
|
||||
boolean isAccountTransfer = false;
|
||||
for (final SingleRepaymentCommand singleLoanRepaymentCommand : repaymentCommand) {
|
||||
if(singleLoanRepaymentCommand != null){
|
||||
final Loan loan = this.loanAssembler.assembleFrom(singleLoanRepaymentCommand.getLoanId());
|
||||
final PaymentDetail paymentDetail = singleLoanRepaymentCommand.getPaymentDetail();
|
||||
if (paymentDetail != null && paymentDetail.getId() == null) {
|
||||
@@ -804,7 +805,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
bulkRepaymentCommand.getTransactionDate(), singleLoanRepaymentCommand.getTransactionAmount(), paymentDetail,
|
||||
bulkRepaymentCommand.getNote(), null, isRecoveryRepayment, isAccountTransfer);
|
||||
transactionIds.add(loanTransaction.getId());
|
||||
|
||||
}
|
||||
}
|
||||
changes.put("loanTransactions", transactionIds);
|
||||
return changes;
|
||||
|
||||
Reference in New Issue
Block a user