Current implementation of taxes in Openbravo ERP core is not flexible enough to meet other countries requirements. This project aims to fix this issue.
- Eduardo Argal <ear at openbravo dot com>
- Issue: 0012068
This project will review the whole tax definition in Openbravo ERP extending it but also preserving compatibility. New features:
- Multiple nesting.
- Tax calculation.
- Line level calculation.
- Multiple tax base amounts.
Functional Requirements Based on Business Processes
Taxes definition in Openbravo ERP allows to define parent taxes with just one level of nesting. This means a tax can be parent tax or child tax but never both. This project aims to enhance tax definition to allow multiple nesting. That way taxes can be part of sets, and those sets can be later used by other taxes as part of their tax base amount.
For this the display logic that currently exists for the flag "Summary level" has to be removed. That logic was preventing user to enter a parent tax when the tax was summary, so was preventing multiple nesting. On the other hand this project adds additional display logics to prevent user to add any information related to calculation process to summary level taxes. The calculation should be the aggregation of taxes of the children elements.
When "Summary level" is flagged, then following fields are hidden:
- Original Rate
- Base Amount
- Tax Base
- Document Tax Amount Calculation
Line level calculation
Taxes calculation are currently done just at statement level. This project will provide as well detailed information of taxes at line level (both in invoices and orders).
The taxes calculated at statement level will be a sum of the tax amount of the lines or the sum of tax base amounts multiplied by the rate. This calculation will be based on a flag in tax rate window.
Document Tax Amount Calculation: New combo box available in Tax rate window. Options:
- Document Base Amount By Rate: Document level taxes calculated as the the sum of tax base amounts of the lines by rate.
- Line Base Amount By Rate: Document level taxes calculated as the the sum of tax amounts of the lines.
Multiple tax base amounts
Tax base amount is currently taken from the line net amount and sometimes as well from the aggregation of previously calculated taxes (cascade). This project will add additional criteria to define where to take tax base amount:
Base Amount: New combo box available in Tax rate window. Options:
- Line net amount:This is a straight forward option and something similar to our existing options, Line net amount will be considered for tax calculation.
Assume that Tax rate TAX_A is defined with "10%" tax rate and base Amount field is selected as " Tax Line Net_Amount ".
Having Line net amount as "100" euros:
So Tax amount : Line net amount * Tax_A
Tax amount: 100 * 10%
Tax amount: 10 euros
- Alternate tax base amount: Editable manually. Also can be extended through modules to add logic in its calculation. Here tax will be calculated based on the amount entered in the Alternative tax base amount field and not based on the Line net amount, and this field will appear in the line item tab once we click save button, only after we select the product & appropriate tax rate fields.
Example:Assume that Tax rate TAX_B is defined with "10%" tax rate and Base Amount field is filled with "Alternative tax base Amount" option.
Having Line net amount as "100" euros and Alternative tax base Amount as "50" euros:
So Tax amount : Alternative tax base Amount * TAX_B
Tax amount: 50 * 10%
Tax amount: 5
- Tax Amount: Any tax or set of taxes (summary taxes) previously calculated can be selected as tax base amount.
Having Line net amount as "100" euros, TAX_A as 10% of Line Net Amount, and TAX_B 10% of TAX_A
So Tax amount:
- Line net amount + Tax amount: An aggregation of both amounts (Line net amount and Tax amount) will be used as tax base amount for tax calculation.
Having Line net amount as "100" euros, TAX_A as 10% of Line Net Amount and TAX_B 10% of Line net amount + TAX_A
- Alternate tax base amount + Tax Amount: An aggregation of both amounts (Alternate tax base amount and Tax Amount) will be used as tax base amount for tax calculation.
Having Line net amount as "100" euros, Alternate tax base amount as "50" euros, TAX_A as 10% of Line Net Amount and TAX_B 10% of Alternate tax base amount + TAX_A
Tax Base: New combo box available in Tax rate window. Another rate or set of rates previously calculated can be selected as part of the tax base amount. When selecting as Base Amount one of these options:
- Tax Amount
- Line net amount + Tax amount
- Alternate tax base amount + Tax Amount
Then this new combo box will appear so that user can select which tax rate will be use as Tax Amount. In previous example TAX_A will be selected in this combo box to be used as part of tax base.
Example of tax hierarchy that can be built after this project:
- A + B + C + D + E
- B + C
- A = 10% (LINE NET AMOUNT)
- B = 10% (ALTERNATE TAX BASE AMOUNT)
- C = 10% (ALTERNATE TAX BASE AMOUNT + A)
- D = 10% (B+C)
- E = 10% (LINE NET AMOUNT + A + B + C + D)
Tax rate setup:
- Tax (A + B + C + D + E): Defined as summary level with no parent tax.
- TAx (A): Defined with parent tax Tax (A + B + C + D + E), rate 10%, Base amount Line Net Amount.
- Tax (B + C): Defined as summary level with Tax (A + B + C + D + E) as parent tax.
- Tax (B): Defined with parent tax Tax (B + C), rate 10 %, Base Amount Alternate Tax Base Amount.
- Tax (C): Defined with parent tax Tax (B + C), rate 10 %, Base Amount Tax Amount and Tax Amount Tax (A).
- Tax (D): Defined with parent tax Tax (A + B + C + D + E), rate 10 %, Base Amount Tax Amount and Tax Amount Tax(B + C).
- Tax (E): Defined with parent tax Tax (A + B + C + D + E), rate 10 %, Base Amount Line Net Amount and as Cascade.
Additional information on how to set up taxes and examples can be found in the Configuration Manual.