adamsaghy commented on code in PR #5029:
URL: https://github.com/apache/fineract/pull/5029#discussion_r2375610365
##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/AdvancedPaymentScheduleTransactionProcessor.java:
##########
@@ -2842,6 +2842,54 @@ private static final class Balances {
private Money aggregatedPenaltyChargesPortion;
}
+ private void mergeReAgedInstallment(final LoanRepaymentScheduleInstallment
target,
+ final LoanRepaymentScheduleInstallment reAgedInstallment,
MonetaryCurrency currency, LocalDate transactionDate) {
+ target.setAdditional(false);
+ target.setReAged(true);
+ target.setFromDate(reAgedInstallment.getFromDate());
+ target.setDueDate(reAgedInstallment.getDueDate());
+
target.setPrincipal(reAgedInstallment.getPrincipal().add(MathUtil.nullToZero(target.getPrincipalCompleted())));
+ target.setInterestCharged(reAgedInstallment.getInterestCharged());
+ target.updateObligationsMet(currency, transactionDate);
+ }
+
+ private void
insertOrReplaceRelatedInstallment(List<LoanRepaymentScheduleInstallment>
installments,
+ final LoanRepaymentScheduleInstallment reAgedInstallment, final
MonetaryCurrency currency, final LocalDate transactionDate) {
+ List<LoanRepaymentScheduleInstallment> list = installments.stream()
+ .filter(installment ->
Objects.equals(installment.getInstallmentNumber(),
reAgedInstallment.getInstallmentNumber()))
+
.sorted(Comparator.comparing(LoanRepaymentScheduleInstallment::getDueDate)).toList();
Review Comment:
why is this a list? installment number is exclusively identify only 1
installment, no?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]