Dhanno98 commented on code in PR #5940:
URL: https://github.com/apache/fineract/pull/5940#discussion_r3503781407


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccountTransaction.java:
##########
@@ -114,7 +114,7 @@ public static ShareAccountTransaction 
createChargeTransaction(final LocalDate tr
         final BigDecimal unitPrice = null;
         final Integer status = PurchasedSharesStatusType.APPROVED.getValue();
         final Integer type = 
PurchasedSharesStatusType.CHARGE_PAYMENT.getValue();
-        BigDecimal amount = charge.percentageOrAmount();
+        BigDecimal amount = charge.amoutOutstanding();

Review Comment:
   I just want to make sure I understand your comment correctly.
   
   In the activation-charge flow, `deriveChargeAmount()` has already calculated 
the rounded charge amount (`amount`, which is also reflected in 
`amountOutstanding` at this stage), but `createChargeTransaction()` currently 
uses `percentageOrAmount()`, which is the original configured value (e.g. 
`19.8`) rather than the calculated rounded value.
   
   My understanding was that the transaction should store the final calculated 
charge amount after rounding, which is why I changed it to use 
`amoutOutstanding()` instead of `percentageOrAmount()`.
   
   When you said "_percentage should not be changed... only final, calculated 
charge amount_", were you referring to the value that should be stored in the 
transaction?
   - Should `createChargeTransaction()` continue storing the original 
configured value from `percentageOrAmount()`?
   - Or should it store the final calculated (rounded) charge amount instead? 
If the latter, which field would you expect it to use, since 
`ShareAccountCharge` doesn't currently expose the calculated `amount` field?



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