FINERACT-2338: Allow backdated interest change on progressive loans
- charge-off handling - write-off handling - closed loans - external owner changes
This commit is contained in:
+1
@@ -827,6 +827,7 @@ public abstract class AbstractLoanRepaymentScheduleTransactionProcessor implemen
|
||||
}
|
||||
}
|
||||
|
||||
loanTransaction.resetDerivedComponents();
|
||||
loanTransaction.updateComponentsAndTotal(principalPortion, interestPortion, feeChargesPortion, penaltychargesPortion);
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -35,6 +35,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
|
||||
import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
|
||||
import org.apache.fineract.infrastructure.core.exception.GeneralPlatformDomainRuleException;
|
||||
import org.apache.fineract.infrastructure.core.exception.InvalidJsonException;
|
||||
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
|
||||
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
|
||||
@@ -194,6 +195,12 @@ public class LoanRescheduleRequestDataValidatorImpl implements LoanRescheduleReq
|
||||
}
|
||||
}
|
||||
|
||||
public static void validateLoanStatusIsActiveOrClosed(Loan loan, DataValidatorBuilder dataValidatorBuilder) {
|
||||
if (!loan.getStatus().isActive() && !loan.getStatus().isClosed() && !loan.getStatus().isOverpaid()) {
|
||||
dataValidatorBuilder.reset().failWithCode("loan.is.not.active.or.closed", "Loan is not active or closed");
|
||||
}
|
||||
}
|
||||
|
||||
public static void validateSupportedParameters(JsonCommand jsonCommand, Set<String> createRequestDataParameters) {
|
||||
final String jsonString = jsonCommand.json();
|
||||
|
||||
@@ -243,6 +250,11 @@ public class LoanRescheduleRequestDataValidatorImpl implements LoanRescheduleReq
|
||||
if (loan.getLoanProductRelatedDetail().getLoanScheduleType() == LoanScheduleType.PROGRESSIVE) {
|
||||
progressiveLoanRescheduleRequestDataValidatorDelegate.validateForCreateAction(jsonCommand, loan);
|
||||
} else {
|
||||
if (loan.isChargedOff()) {
|
||||
throw new GeneralPlatformDomainRuleException("error.msg.loan.is.charged.off",
|
||||
"Loan: " + loan.getId() + " reschedule installment is not allowed. Loan Account is Charged-off", loan.getId());
|
||||
}
|
||||
|
||||
validateSupportedParameters(jsonCommand, CREATE_REQUEST_DATA_PARAMETERS);
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
final DataValidatorBuilder dataValidatorBuilder = new DataValidatorBuilder(dataValidationErrors)
|
||||
|
||||
Reference in New Issue
Block a user