MIFOSX-1831 : fix for accrual accounting overpayment

This commit is contained in:
Pramod Nuthakki
2015-04-27 17:14:00 +05:30
parent 212e2127c5
commit 514e17494d
3 changed files with 74 additions and 3 deletions
@@ -174,6 +174,7 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
final BigDecimal interestAmount = loanTransactionDTO.getInterest();
final BigDecimal feesAmount = loanTransactionDTO.getFees();
final BigDecimal penaltiesAmount = loanTransactionDTO.getPenalties();
final BigDecimal overPaymentAmount = loanTransactionDTO.getOverPayment();
final Long paymentTypeId = loanTransactionDTO.getPaymentTypeId();
final boolean isReversal = loanTransactionDTO.isReversed();
@@ -219,6 +220,12 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
loanProductId, paymentTypeId, loanId, transactionId, transactionDate, penaltiesAmount, isReversal);
}
}
if (overPaymentAmount != null && !(overPaymentAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(overPaymentAmount);
this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, ACCRUAL_ACCOUNTS_FOR_LOAN.OVERPAYMENT, loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, overPaymentAmount, isReversal);
}
/**
* Single DEBIT transaction for write-offs or Repayments (and their