From f5077ef2b9c0e5a03a3e9aac26f41e07f68d5d97 Mon Sep 17 00:00:00 2001 From: Vishwas Babu A J Date: Sun, 12 Oct 2014 21:05:55 -0700 Subject: [PATCH] disable charge and interest waivers for periodic accrual accounting --- .../service/AccrualBasedAccountingProcessorForLoan.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java b/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java index d02661ed4..a1016c435 100755 --- a/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java @@ -14,6 +14,7 @@ import org.mifosplatform.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR import org.mifosplatform.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY; import org.mifosplatform.accounting.journalentry.data.LoanDTO; import org.mifosplatform.accounting.journalentry.data.LoanTransactionDTO; +import org.mifosplatform.infrastructure.core.exception.PlatformDataIntegrityException; import org.mifosplatform.organisation.office.domain.Office; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -36,6 +37,13 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess final Date transactionDate = loanTransactionDTO.getTransactionDate(); this.helper.checkForBranchClosures(latestGLClosure, transactionDate); + // FIXME Disable charge and Interest Waivers for Periodic accounting + if (loanDTO.isPeriodicAccrualBasedAccountingEnabled() + || (loanTransactionDTO.getTransactionType().isWaiveCharges() && loanTransactionDTO.getTransactionType() + .isWaiveInterest())) { throw new PlatformDataIntegrityException( + "Restricted functionality with Periodic Accrual accounting...charge and interest waivers are not allowed", + "Restricted functionality with Periodic Accrual accounting...charge and interest waivers are not allowed"); } + /** Handle Disbursements **/ if (loanTransactionDTO.getTransactionType().isDisbursement()) { createJournalEntriesForDisbursements(loanDTO, loanTransactionDTO, office);