Skip to content

FINERACT-1289: Taxes on Loan charges#5780

Open
alberto-art3ch wants to merge 1 commit intoapache:developfrom
openMF:FINERACT-1289/taxes-on-loan-charges
Open

FINERACT-1289: Taxes on Loan charges#5780
alberto-art3ch wants to merge 1 commit intoapache:developfrom
openMF:FINERACT-1289/taxes-on-loan-charges

Conversation

@alberto-art3ch
Copy link
Copy Markdown
Contributor

Description

There was an issue with the Tax attached to the loan charge is not getting affected at the loan/accounting level. Tthe tax bifurcation was not happening

FINERACT-1289

  • Loan Charges
Screenshot 2026-04-19 at 1 08 56 PM
  • Tax Component
Screenshot 2026-04-19 at 1 09 58 PM
  • Charge Definition linked with the Tax Group
Screenshot 2026-04-19 at 1 09 17 PM
  • Accrual Loan Transaction for paying the Loan Cahrge
Screenshot 2026-04-18 at 7 10 44 PM

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

Your assigned reviewer(s) will follow our guidelines for code reviews.

@alberto-art3ch alberto-art3ch force-pushed the FINERACT-1289/taxes-on-loan-charges branch 4 times, most recently from a073ab8 to ee29805 Compare April 20, 2026 03:23
@Aman-Mittal
Copy link
Copy Markdown
Contributor

@alberto-art3ch It seems GA check is giving error prone issue on fineract-tax:compileTestJava can you please check.

While i tried to look at the ticket. Can you confirm me the tax bifurcation logic. Asking based on usecase perspective while on ticket i tried to cross-check I cannot seem to understand how tax logic should be calculated not much relevant data i can find.

@adamsaghy
Copy link
Copy Markdown
Contributor

/home/runner/work/fineract/fineract/fineract-tax/src/test/java/org/apache/fineract/portfolio/tax/service/ChargeTaxApplicationServiceTest.java:66: error: [JavaTimeDefaultTimeZone] LocalDate.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
> Task :fineract-tax:compileTestJava FAILED
        Map<TaxComponent, BigDecimal> result = service.computeTax(null, new BigDecimal("100.00"), LocalDate.now(), 6);

                                                                                                               ^
> Task :fineract-loan:compileJava
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'Map<TaxComponent, BigDecimal> result = service.computeTax(null, new BigDecimal("100.00"), LocalDate.now(ZoneId.systemDefault()), 6);'?
/home/runner/work/fineract/fineract/fineract-tax/src/test/java/org/apache/fineract/portfolio/tax/service/ChargeTaxApplicationServiceTest.java:75: error: [JavaTimeDefaultTimeZone] LocalDate.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
        Map<TaxComponent, BigDecimal> result = service.computeTax(taxGroup, null, LocalDate.now(), 6);
                                                                                               ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'Map<TaxComponent, BigDecimal> result = service.computeTax(taxGroup, null, LocalDate.now(ZoneId.systemDefault()), 6);'?
/home/runner/work/fineract/fineract/fineract-tax/src/test/java/org/apache/fineract/portfolio/tax/service/ChargeTaxApplicationServiceTest.java:84: error: [JavaTimeDefaultTimeZone] LocalDate.now() is not allowed because it silently uses the system default time-zone. You must pass an explicit time-zone (e.g., ZoneId.of("America/Los_Angeles")) to this method.
        Map<TaxComponent, BigDecimal> result = service.computeTax(taxGroup, BigDecimal.ZERO, LocalDate.now(), 6);
                                                                                                          ^
    (see https://errorprone.info/bugpattern/JavaTimeDefaultTimeZone)
  Did you mean 'Map<TaxComponent, BigDecimal> result = service.computeTax(taxGroup, BigDecimal.ZERO, LocalDate.now(ZoneId.systemDefault()), 6);'?
3 errors

@alberto-art3ch alberto-art3ch force-pushed the FINERACT-1289/taxes-on-loan-charges branch from ee29805 to dbe72e1 Compare April 20, 2026 16:06
@alberto-art3ch
Copy link
Copy Markdown
Contributor Author

alberto-art3ch commented Apr 20, 2026

@alberto-art3ch It seems GA check is giving error prone issue on fineract-tax:compileTestJava can you please check.

While i tried to look at the ticket. Can you confirm me the tax bifurcation logic. Asking based on usecase perspective while on ticket i tried to cross-check I cannot seem to understand how tax logic should be calculated not much relevant data i can find.

@alberto-art3ch It seems GA check is giving error prone issue on fineract-tax:compileTestJava can you please check.

While i tried to look at the ticket. Can you confirm me the tax bifurcation logic. Asking based on usecase perspective while on ticket i tried to cross-check I cannot seem to understand how tax logic should be calculated not much relevant data i can find.

I've reviewed the compilation issue in the fineract-tax Test part and solved. Thanks.

About the bifurcation logic about the Taxes in the Loan Charges is: If you have a Loan Charge with 100.00 as amount and you have a Tax of 15% in this case, the client pays the same 100.00 but internally (in the accounting) you will have three Journal Entries:

GL ACCOUNT DEBIT CREDIT
Fees Receivables 100.00
Income For Fees 85.00
Tax Liability 15.00

The Tax liability account is taken from Tax Component definition, and obviously it is linked to the Charge using the Tax Group

We are trying to follow a similar approach that we have in the Savings, so we are creating entities to have the detail about which Taxes (if apply) are being paying on the repayment transactions

Please let me know any comment or doubt

@Aman-Mittal
Copy link
Copy Markdown
Contributor

@alberto-art3ch It seems GA check is giving error prone issue on fineract-tax:compileTestJava can you please check.

While i tried to look at the ticket. Can you confirm me the tax bifurcation logic. Asking based on usecase perspective while on ticket i tried to cross-check I cannot seem to understand how tax logic should be calculated not much relevant data i can find.

@alberto-art3ch It seems GA check is giving error prone issue on fineract-tax:compileTestJava can you please check.

While i tried to look at the ticket. Can you confirm me the tax bifurcation logic. Asking based on usecase perspective while on ticket i tried to cross-check I cannot seem to understand how tax logic should be calculated not much relevant data i can find.

I've reviewed the compilation issue in the fineract-tax Test part and solved. Thanks.

About the bifurcation logic about the Taxes in the Loan Charges is: If you have a Loan Charge with 100.00 as amount and you have a Tax of 15% in this case, the client pays the same 100.00 but internally (in the accounting) you will have three Journal Entries:

GL ACCOUNT DEBIT CREDIT
Fees Receivables 100.00
Income For Fees 85.00
Tax Liability 15.00

The Tax liability account is taken from Tax Component definition, and obviously it is linked to the Charge using the Tax Group

We are trying to follow a similar approach that we have in the Savings, so we are creating entities to have the detail about which Taxes (if apply) are being paying on the repayment transactions

Please let me know any comment or doubt

Yes, can you tell me is there any way user can check how much tax he has paid till now. It will be better for compliance. While I also want to make sure that tax bifurcation is also documented on ticket too.

@alberto-art3ch
Copy link
Copy Markdown
Contributor Author

@alberto-art3ch It seems GA check is giving error prone issue on fineract-tax:compileTestJava can you please check.
While i tried to look at the ticket. Can you confirm me the tax bifurcation logic. Asking based on usecase perspective while on ticket i tried to cross-check I cannot seem to understand how tax logic should be calculated not much relevant data i can find.

@alberto-art3ch It seems GA check is giving error prone issue on fineract-tax:compileTestJava can you please check.
While i tried to look at the ticket. Can you confirm me the tax bifurcation logic. Asking based on usecase perspective while on ticket i tried to cross-check I cannot seem to understand how tax logic should be calculated not much relevant data i can find.

I've reviewed the compilation issue in the fineract-tax Test part and solved. Thanks.
About the bifurcation logic about the Taxes in the Loan Charges is: If you have a Loan Charge with 100.00 as amount and you have a Tax of 15% in this case, the client pays the same 100.00 but internally (in the accounting) you will have three Journal Entries:

GL ACCOUNT
DEBIT
CREDIT

Fees Receivables
100.00

Income For Fees

85.00

Tax Liability

15.00

The Tax liability account is taken from Tax Component definition, and obviously it is linked to the Charge using the Tax Group
We are trying to follow a similar approach that we have in the Savings, so we are creating entities to have the detail about which Taxes (if apply) are being paying on the repayment transactions
Please let me know any comment or doubt

Yes, can you tell me is there any way user can check how much tax he has paid till now. It will be better for compliance. While I also want to make sure that tax bifurcation is also documented on ticket too.

To start, in the Loan Charge entity there is a new field that will store the Tax Amount (sum of all the different Taxes applied) of this Loan Charge.
Plus there is a new entity named LoanChargeTaxDetails that stores (in detail) the relation between Loan Charge and Tax Component and the amount of this.

In resume the data is already there, one way to know (as other ones) is with a report, or maybe we can extend the Loan Charge api details to have that data

@Aman-Mittal
Copy link
Copy Markdown
Contributor

@alberto-art3ch It seems GA check is giving error prone issue on fineract-tax:compileTestJava can you please check.
While i tried to look at the ticket. Can you confirm me the tax bifurcation logic. Asking based on usecase perspective while on ticket i tried to cross-check I cannot seem to understand how tax logic should be calculated not much relevant data i can find.

@alberto-art3ch It seems GA check is giving error prone issue on fineract-tax:compileTestJava can you please check.
While i tried to look at the ticket. Can you confirm me the tax bifurcation logic. Asking based on usecase perspective while on ticket i tried to cross-check I cannot seem to understand how tax logic should be calculated not much relevant data i can find.

I've reviewed the compilation issue in the fineract-tax Test part and solved. Thanks.
About the bifurcation logic about the Taxes in the Loan Charges is: If you have a Loan Charge with 100.00 as amount and you have a Tax of 15% in this case, the client pays the same 100.00 but internally (in the accounting) you will have three Journal Entries:

GL ACCOUNT
DEBIT
CREDIT

Fees Receivables
100.00

Income For Fees

85.00

Tax Liability

15.00

The Tax liability account is taken from Tax Component definition, and obviously it is linked to the Charge using the Tax Group
We are trying to follow a similar approach that we have in the Savings, so we are creating entities to have the detail about which Taxes (if apply) are being paying on the repayment transactions
Please let me know any comment or doubt

Yes, can you tell me is there any way user can check how much tax he has paid till now. It will be better for compliance. While I also want to make sure that tax bifurcation is also documented on ticket too.

To start, in the Loan Charge entity there is a new field that will store the Tax Amount (sum of all the different Taxes applied) of this Loan Charge.
Plus there is a new entity named LoanChargeTaxDetails that stores (in detail) the relation between Loan Charge and Tax Component and the amount of this.

In resume the data is already there, one way to know (as other ones) is with a report, or maybe we can extend the Loan Charge api details to have that data

Need to ask Bharat and other PMC member for this. Thanks for explaining.

I just want to make sure these things are documented properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants