disable charge and interest waivers for periodic accrual accounting

This commit is contained in:
Vishwas Babu A J
2014-10-12 21:05:55 -07:00
parent 780bdfb01d
commit f5077ef2b9
@@ -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);