From e5316d35590fccd9d7e463c1af015819cdcaf03c Mon Sep 17 00:00:00 2001 From: Madhukar Date: Thu, 3 Apr 2014 12:08:44 +0530 Subject: [PATCH] MIFOSX-1008 post journalentries if earned interest is > 0 --- .../service/CashBasedAccountingProcessorForSavings.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/CashBasedAccountingProcessorForSavings.java b/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/CashBasedAccountingProcessorForSavings.java index 18879c1c2..3765b4868 100755 --- a/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/CashBasedAccountingProcessorForSavings.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/CashBasedAccountingProcessorForSavings.java @@ -86,9 +86,12 @@ public class CashBasedAccountingProcessorForSavings implements AccountingProcess * Applications **/ else if (savingsTransactionDTO.getTransactionType().isInterestPosting()) { - this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode, - CASH_ACCOUNTS_FOR_SAVINGS.INTEREST_ON_SAVINGS, CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL, savingsProductId, - paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal); + //Post journal entry if earned interest amount is greater than zero + if (savingsTransactionDTO.getAmount().compareTo(BigDecimal.ZERO) == 1) { + this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode, + CASH_ACCOUNTS_FOR_SAVINGS.INTEREST_ON_SAVINGS, CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL, savingsProductId, + paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal); + } } /** Handle Fees Deductions and reversals of Fees Deductions **/