MIFOSX-1550 Check for null principal amount when creating journal entry for loan write-off

This commit is contained in:
Mohammed Nafees
2014-12-05 12:59:39 +05:30
parent 2212618256
commit 42ff4c1b1c
@@ -73,10 +73,13 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
**/ **/
else if (loanTransactionDTO.getTransactionType().isWriteOff()) { else if (loanTransactionDTO.getTransactionType().isWriteOff()) {
final BigDecimal principalAmount = loanTransactionDTO.getPrincipal(); final BigDecimal principalAmount = loanTransactionDTO.getPrincipal();
this.helper.createCashBasedJournalEntriesAndReversalsForLoan(office, currencyCode, if (principalAmount != null && !(principalAmount.compareTo(BigDecimal.ZERO) == 0)) {
CASH_ACCOUNTS_FOR_LOAN.LOSSES_WRITTEN_OFF.getValue(), CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue(), this.helper.createCashBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
loanProductId, paymentTypeId, loanId, transactionId, transactionDate, principalAmount, CASH_ACCOUNTS_FOR_LOAN.LOSSES_WRITTEN_OFF.getValue(), CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue(),
loanTransactionDTO.isReversed()); loanProductId, paymentTypeId, loanId, transactionId, transactionDate, principalAmount,
loanTransactionDTO.isReversed());
}
} else if (loanTransactionDTO.getTransactionType().isInitiateTransfer() } else if (loanTransactionDTO.getTransactionType().isInitiateTransfer()
|| loanTransactionDTO.getTransactionType().isApproveTransfer() || loanTransactionDTO.getTransactionType().isApproveTransfer()
|| loanTransactionDTO.getTransactionType().isWithdrawTransfer()) { || loanTransactionDTO.getTransactionType().isWithdrawTransfer()) {