Dhanno98 commented on PR #5940:
URL: https://github.com/apache/fineract/pull/5940#issuecomment-4881046721

   Hi @adamsaghy 
   
   Sorry about the confusion earlier. While cleaning up the PR I accidentally 
pushed a couple of unrelated files, so I first fixed that and then noticed your 
comment about rebasing. The PR has now been rebased onto the latest `develop`, 
and the current branch contains only the intended changes.
   
   In addition to the original rounding fix, I made a few related improvements:
   
   **1. Fix for the rounded activation charge issue**
   
   The actual fix is in `ShareAccountDataSerializer.createChargeTransaction()`. 
Previously, `ShareAccountChargePaidBy` was created using the original charge 
amount:
   
   ```java
   new ShareAccountChargePaidBy(chargeTransaction, charge, 
charge.percentageOrAmount())
   ```
   
   It now uses the rounded transaction amount:
   
   ```java
   new ShareAccountChargePaidBy(chargeTransaction, charge, amount)
   ```
   
   This ensures that the persisted `ShareAccountChargePaidBy.amount` matches 
the rounded amount used by the transaction.
   
   I also added an integration test, 
`verifyActivationChargeRoundedCorrectlyWithAccountingEnabled()`, in 
`ShareAccountChargeRoundingTest` which verifies:
   
   * activation charge rounding,
   * persisted charge amount,
   * accounting journal entries generated for the rounded charge.
   
   To support this test using the generated client, I added the missing 
accounting account fields to `PostProductsTypeRequest` and added 
`createEquityAccount()` to `FeignAccountHelper`.
   
   **2. Generated client improvements**
   
   Since using the generated client for these commands is acceptable, I also 
exposed the missing request fields in:
   
   * `PostAccountsTypeAccountIdRequest`
   * `PostClientsClientIdChargesRequest`
   
   After regenerating the client, I made use of these generated client requests 
for:
   * share account activation,
   * share redemption,
   * client charge application.
   
   This makes the integration tests consistent with Fineract client usage 
instead of RestAssured.


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