oleksii-novikov-onix commented on PR #6399:
URL: https://github.com/apache/fineract/pull/6399#issuecomment-5667921887

   > @oleksii-novikov-onix Please review:
   > 
   > Five findings:
   > 
   > * WorkingCapitalLoanWritePlatformServiceImpl.java:758 — undoChargeWaiver 
reprocesses only when the loan is charged off; a repayment made while the 
charge was waived went to principal (the allocator saw outstanding 0) and is 
never re-allocated once the charge is restored, leaving the fee owed and the 
principal reduced early in the amortization schedule. The generic undo in the 
same file always reprocesses when charges are involved.
   > * WorkingCapitalLoanChargeWritePlatformServiceImpl.java:594 — the 
adjustment headroom subtracts prior adjustments and the waived amount, but not 
the part paid by ordinary repayments; waive the remainder of a partly repaid 
charge and an adjustment still passes, then quietly settles principal — the 
exact failure the new comment says it prevents.
   > * WorkingCapitalLoanBalanceData.java:56 — feeWaived/penaltyWaived are 
netted off getFeeOutstanding() but not exposed, so fee/feePaid/feeOutstanding 
no longer reconcile — the same gap the *WrittenOff fields were added to close, 
per the javadoc right there.
   > * WorkingCapitalLoanWritePlatformServiceImpl.java:742 — reverseTransaction 
→ markReversed generates a fresh external id, so a caller-supplied 
reversalExternalId (accepted by the validator, honored on every other undo) is 
silently discarded.
   > * WorkingCapitalLoanChargeWritePlatformServiceImpl.java:465 — the 
allocation carries only the accounting-recognized portion, but the same fields 
are exposed as the transaction's split, so an un-accrued 100 waiver reports 
feeChargesPortion = 0. The feature tables lock this in.
   
   1. Fixed. Undo now always reprocesses and rebuilds delinquency, like the 
generic undo with charges.
   2. Not fixed, the comment was wrong and is rewritten. Adjusting the part 
that was already paid is a refund, so it lands on principal or overpayment by 
design, same as an adjustment on a fully paid charge today (charge adjustment 
UC14). Term loans don't subtract the paid part either. Subtracting the waived 
part only blocks credit for a fee that was never paid.
   3. Fixed. Added feeWaived and penaltyWaived to the balance data and swagger.
   4. Fixed. reversalExternalId is now taken from the request. 
undoDiscountFeeAdjustment on develop has the same bug. Should I fix it here or 
separately?
   5. Fixed. The allocation now holds the full waived amount, like write-off, 
and the feature tables are updated. Only the part backed by an accrual (accrued 
minus paid) goes to journal entries.


-- 
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]

Reply via email to