FINERACT-1968:Advanced Payment allocation reprocessing transaction reverse replay
This commit is contained in:
committed by
Adam Saghy
parent
5a8a2b9e35
commit
5b8f15ca95
+13
@@ -113,6 +113,7 @@ import org.apache.fineract.portfolio.loanaccount.domain.LoanTransactionRelationT
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransactionRepository;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransactionType;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.LoanRepaymentScheduleTransactionProcessor;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.impl.AdvancedPaymentScheduleTransactionProcessor;
|
||||
import org.apache.fineract.portfolio.loanaccount.exception.InstallmentNotFoundException;
|
||||
import org.apache.fineract.portfolio.loanaccount.exception.InvalidLoanTransactionTypeException;
|
||||
import org.apache.fineract.portfolio.loanaccount.exception.LoanChargeAdjustmentException;
|
||||
@@ -245,6 +246,18 @@ public class LoanChargeWritePlatformServiceImpl implements LoanChargeWritePlatfo
|
||||
}
|
||||
this.loanWritePlatformService.updateOriginalSchedule(loan);
|
||||
}
|
||||
// [For Adv payment allocation strategy] check if charge due date is earlier than last transaction
|
||||
// date, if yes trigger reprocess else no reprocessing
|
||||
if (AdvancedPaymentScheduleTransactionProcessor.ADVANCED_PAYMENT_ALLOCATION_STRATEGY.equals(loan.transactionProcessingStrategy())) {
|
||||
LoanTransaction lastPaymentTransaction = loan.getLastPaymentTransaction();
|
||||
if (lastPaymentTransaction != null) {
|
||||
if (loanCharge.getEffectiveDueDate() != null
|
||||
&& DateUtils.isAfter(loanCharge.getEffectiveDueDate(), lastPaymentTransaction.getTransactionDate())) {
|
||||
reprocessRequired = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (reprocessRequired) {
|
||||
ChangedTransactionDetail changedTransactionDetail = loan.reprocessTransactions();
|
||||
if (changedTransactionDetail != null) {
|
||||
|
||||
Reference in New Issue
Block a user