rymghosn opened a new pull request, #6237:
URL: https://github.com/apache/fineract/pull/6237
## Problem
When a **Charge** linked to a **Tax Group** was applied to a **Savings
Account**, tax was not calculated on the charge. The charge was applied using
only its base amount, and no per-component tax breakdown was stored on the
transaction.
Even after calculating the tax-inclusive amount, the accounting layer did
not split the posting correctly. The full gross amount (charge + tax) was
credited to the charge's income GL account instead of separating the tax into
the configured **Tax/VAT Payable** GL account. As a result:
* The income GL was overstated by the tax amount.
* The tax liability was never recorded in its designated GL account.
This issue affected both **cash-based** and **accrual-based** accounting for
**fees**, **penalties**, and their **reversals**.
## Fix
* Added tax calculation during savings charge payment by introducing
`TaxUtils.calculateChargeAmountWithTax(...)`, ensuring the tax-inclusive amount
is calculated and the per-component tax breakdown is stored on the
`SavingsAccountTransaction`.
* Updated the cash-based and accrual-based accounting processors to split
journal entries correctly by posting:
* the net charge amount to the charge income GL account, and
* each tax component to its configured **Tax/VAT Payable** GL account,
including reversal entries.
* Updated the savings accounting processors to pass the transaction tax
breakdown through the fee and penalty posting flows.
## Related Fixes
While implementing the above, several related issues in the Tax
Group/Component domain were also resolved:
* Fixed the `TaxComponent` ↔ `TaxComponentHistory` JPA relationship by
replacing the incorrect unidirectional mapping with a proper bidirectional
mapping.
* Added the missing `id` and `endDate` fields to the `TaxGroupComponent`
request DTO to support updating existing tax group mappings.
* Improved validation by returning a clear error message when creating a Tax
Group with an empty `tax-components` array.
## Commits
* **FINERACT-2744:** Fix `TaxComponent`/`TaxComponentHistory` JPA
relationship mapping.
* **FINERACT-2744:** Add `id` and `endDate` fields to `TaxGroupComponent`
request.
* **FINERACT-2744:** Validate at least one tax component on Tax Group
creation.
* **FINERACT-2744:** Calculate tax-inclusive amount when paying savings
charges.
* **FINERACT-2744:** Post VAT on savings charges to the configured Tax GL.
PR:(https://issues.apache.org/jira/browse/FINERACT-2744)
--
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]