[
https://issues.apache.org/jira/browse/FINERACT-2284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18077848#comment-18077848
]
Dhananjay Bhagat commented on FINERACT-2284:
--------------------------------------------
Hi [~bgowda], thanks for your guidance!
I tested *Tranche Disbursement* *charges* further to verify rounding behavior
in edge cases and observed that:
*Case 1: All tranche charges round to 0*
Example:
Loan: 1000
Tranches: 615 and 385
Charge: 0.04%
Calculated:
0.04% of 615 -> 0.246 rounds to 0
0.04% of 385 -> 0.154 rounds to 0
Current behavior:
Two rows are created in *m_loan_charge* both with *amount = 0.*
*Case 2: Only one tranche rounds to 0*
Example:
Loan: 1000
Tranches: 615 and 385
Charge: 0.09%
Calculated Charge Amount:
0.09% of 615 -> 0.5535 rounds to 1
0.09% of 385 -> 0.3465 rounds to 0
Current behavior:
Both rows are persisted in {*}m_loan_charge{*}, including the one with
{*}amount = 0{*}.
*Observation*
For {*}single disbursement charges{*}, we discussed above that zero-amount
charges shall not be {*}persisted{*}.
However, for {*}tranche disbursement charges{*}, zero-amount entries are being
persisted.
*Question:*
Should tranche disbursement charges follow the same rule as that for single
disbursement charges and {*}skip persistence when the final rounded amount =
0{*}?
This would help avoid storing non-impactful charge entries and keep behavior
consistent across charge types.
Please confirm whether the current behavior is expected or if this is something
that should be improved.
Thank you!
> Charge should check Money inMultiplesOf settings and enforce it!
> ----------------------------------------------------------------
>
> Key: FINERACT-2284
> URL: https://issues.apache.org/jira/browse/FINERACT-2284
> Project: Apache Fineract
> Issue Type: New Feature
> Affects Versions: 1.12.1
> Reporter: Adam Saghy
> Priority: Major
>
> Charge should check Money inMultiplesOf settings and enforce it!
> Issue:
> - Currency set 1 multiples of.
> - Charge with amount that is not multiple of 1 should be rounded based on
> rounding mode!
> *Example*
> - Currency set 1 multiples of.
> - Add charge with amount of $19.8, should be rounded to $20!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)