FINERACT-1968: Adding Installment percentage fee Adv Payment allocation
This commit is contained in:
committed by
Adam Saghy
parent
ae77d29be2
commit
31a7e3644d
+13
@@ -72,6 +72,7 @@ import org.apache.fineract.portfolio.account.service.AccountTransfersWritePlatfo
|
||||
import org.apache.fineract.portfolio.accountdetails.domain.AccountType;
|
||||
import org.apache.fineract.portfolio.charge.domain.Charge;
|
||||
import org.apache.fineract.portfolio.charge.domain.ChargeRepositoryWrapper;
|
||||
import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
|
||||
import org.apache.fineract.portfolio.charge.exception.ChargeCannotBeAppliedToException;
|
||||
import org.apache.fineract.portfolio.charge.exception.ChargeCannotBeUpdatedException;
|
||||
import org.apache.fineract.portfolio.charge.exception.LoanChargeCannotBeAddedException;
|
||||
@@ -183,6 +184,18 @@ public class LoanChargeWritePlatformServiceImpl implements LoanChargeWritePlatfo
|
||||
final Long chargeDefinitionId = command.longValueOfParameterNamed("chargeId");
|
||||
final Charge chargeDefinition = this.chargeRepository.findOneWithNotFoundDetection(chargeDefinitionId);
|
||||
|
||||
/*
|
||||
* TODO: remove this check once handling for Installment fee charges is implemented for Advanced Payment
|
||||
* strategy
|
||||
*/
|
||||
if (ChargeTimeType.fromInt(chargeDefinition.getChargeTimeType()).isInstalmentFee()
|
||||
&& AdvancedPaymentScheduleTransactionProcessor.ADVANCED_PAYMENT_ALLOCATION_STRATEGY
|
||||
.equals(loan.transactionProcessingStrategy())) {
|
||||
final String errorMessageInstallmentChargeNotSupported = "Charge with identifier " + chargeDefinition.getId()
|
||||
+ " cannot be applied: Installment fee charges are not supported for Advanced payment allocation strategy";
|
||||
throw new ChargeCannotBeAppliedToException("loan", errorMessageInstallmentChargeNotSupported, chargeDefinition.getId());
|
||||
}
|
||||
|
||||
if (loan.isDisbursed() && chargeDefinition.isDisbursementCharge()) {
|
||||
// validates whether any pending disbursements are available to
|
||||
// apply this charge
|
||||
|
||||
Reference in New Issue
Block a user