somasorosdpc commented on code in PR #4294:
URL: https://github.com/apache/fineract/pull/4294#discussion_r1950832431
##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/AdvancedPaymentScheduleTransactionProcessor.java:
##########
@@ -540,8 +644,39 @@ private Map<AllocationType, Money>
adjustOriginalAllocationWithFormerChargebacks
return allocation;
}
- private void recognizeAmountsAfterChargeback(final TransactionCtx ctx,
final LocalDate transactionDate,
- final LoanRepaymentScheduleInstallment installment, final
Map<AllocationType, Money> chargebackAllocation) {
+ private void recognizeFeePenaltiesAmountsAfterChargeback(TransactionCtx
ctx, LoanRepaymentScheduleInstallment installment,
+ Map<AllocationType, Money> chargebackAllocation) {
+ MonetaryCurrency currency = ctx.getCurrency();
+ Money fee = chargebackAllocation.get(FEE);
+ if (fee.isGreaterThanZero()) {
+ installment.addToCreditedFee(fee.getAmount());
+ installment.addToChargePortion(fee, Money.zero(currency),
Money.zero(currency), Money.zero(currency), Money.zero(currency),
+ Money.zero(currency));
+ }
+
+ Money penalty = chargebackAllocation.get(PENALTY);
+ if (penalty.isGreaterThanZero()) {
+ installment.addToCreditedPenalty(penalty.getAmount());
+ installment.addToChargePortion(Money.zero(currency),
Money.zero(currency), Money.zero(currency), penalty, Money.zero(currency),
+ Money.zero(currency));
+ }
+ }
+
+ private void
recognizeAmountsAfterChargebackWithInterestRecalculation(TransactionCtx ctx,
LoanRepaymentScheduleInstallment installment,
+ Map<AllocationType, Money> chargebackAllocation) {
+ Money principal = chargebackAllocation.get(PRINCIPAL);
+ if (principal.isGreaterThanZero()) {
+ installment.addToCreditedPrincipal(principal.getAmount());
Review Comment:
refactored. It was not needed.
--
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]