Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0032265
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] 09. Financial managementmajoralways2016-02-17 17:352017-03-21 15:26
ReporteradrianromeroView Statuspublic 
Assigned Toaferraz 
PriorityurgentResolutionfixedFixed in Version3.0PR17Q2
StatusclosedFix in branchFixed in SCM revision86dcf5d294d9
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tovmromanos
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0032265: [SER QA 1434] Taxes at document level are not properly calculated in some cases

DescriptionIn the case of price including taxes and taxes at document level there are cases where taxes are not properly calculated:

For example:
1 x 6.50
1 x 6.50
1 x 5.90
1 x 5.90
Total 24.80

If all products have a tax of 20%, ERP calculates taxable amount 20.68 and tax amount 4.12

This is wrong, the expected values are: taxable amount 20.67 and tax amount 4.13
Steps To Reproduce* Create or modify a tax rate "Entregas 20%" with rate 20% and calculated at document level.
* Assign this tax rate to 4 products, with a price in a price list marked with taxes included.
* Create a sales order. Select the price list used in the previous 4 products and add 4 lines with 1 quantity of each of this products,
* Modify the price unit of these lines to have the following order:
1 x 6.50
1 x 6.50
1 x 5.90
1 x 5.90
* Verify the total gross is 24.80
* Go to the order taxes tab and verify for tax "Entregas 20%" taxable amount 20.68 and tax amount 4.12. This is wrong, the expected values are: taxable amount 20.67 and tax amount 4.13.

Check the attached screenshots.
TagsSER-QA
Attached Filespng file icon TaxesAtDocLevel-1.png [^] (189,819 bytes) 2016-02-17 17:38


png file icon TaxesAtDocLevel-2.png [^] (205,222 bytes) 2016-02-17 17:38


diff file icon 32265.diff [^] (27,899 bytes) 2016-08-08 14:57 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0032264 closedadrianromero Retail Modules Taxes at document level are not properly calculated in some cases 
related to feature request 0028366 closedadrianromero Openbravo ERP Add new functionality to calculate taxes per product BOM 
related to defect 00243783.0MP27 closedpramakrishnan Openbravo ERP Taxes are not correctly calculate in some cases 
related to defect 0033611 closedmigueldejuana Retail Modules wrong "net unit price" with tax include taxes and price precision 6 
related to defect 0035428 closedaferraz Openbravo ERP Do not calculate Net Price and Net Amount outside triggers when creating new Order/Invoice with Price Including Taxes 
related to defect 0035429 closedaferraz Openbravo ERP Error when creating a price including taxes invoice line with empty tax in Oracle 
related to defect 0034360 closedmarvintm Retail Modules Web POS is not calculating taxes at header level correctly if there are cascade taxes, with price including taxes 
related to defect 0035138RR17Q2 closedmarvintm Retail Modules Taxes at header level are not computed correctly when using price including taxes, and taxes are defined at line level 
related to defect 0035475 newRetail Retail Modules Do not calculate Net Price and Net Amount outside triggers when creating new Order/Invoice with Price Including Taxes 
related to defect 0035486 closedaferraz Openbravo ERP [SER-QA 2587] Taxes at document level are rounded in a different way in WebPOS and Backend 
related to defect 0035596 closedaferraz QA Eclipse warning in TaxesLineTestData.java 
related to feature request 0035773 newTriage Omni OMS Openbravo ERP Several improvements in FinancialUtils class 
related to feature request 0025506 newpsanjuan Openbravo ERP It should be possible to adjust the total gross amount of a purchase invoice 
related to design defect 00381633.0PR18Q2 closedmarkmm82 Openbravo ERP Tax calculation adjustment must be done in the highest variance tax 
causes defect 00354343.0PR17Q2 closedaferraz Openbravo ERP Manual taxes deleted when reactivating a price including taxes invoice 
causes defect 00354713.0PR17Q2 closedaferraz Openbravo ERP Order line amounts and taxes added by Add Pack not rounded when booking 
causes defect 0037789 closedmarkmm82 Modules Cannot book an Inter-company Order if the price includes taxes 
causes defect 0037989 closedmarkmm82 Openbravo ERP Tax tab info is not correctly recalculated when tax defined as "Line Net Amount + Tax Amount" is modified 

-  Notes
(0088712)
markmm82 (developer)
2016-08-01 18:31

I need more details of the expected values when the taxable and tax amounts are calculated. To a best understanding of the issue I am providing to you a test plan more detailed and tracing of the steps to reproduce.

This is a prioritary issue and I need feedback asap. Test plan is easy and fast to reproduce.

Test Plan
As Group Admin Role
1- Go to the Tax Rate window. Create a new one:
               Name: "Entregas 20%"
                Rate: 20%
                Valid from date: Today
                Tax Category: IVA Normal
                Sales/Purchase Type: Sales Tax
                Document Tax Amount Calculation: Document based amount by rate.
                Country/Destination Country: Spain
                Base amount: Line Net Amount.
2- Assign this tax rate to products with a price in a price list marked with taxes included. For instance:
                Go to Price List window and select "Tarifa de ventas" price list. Edit and check the "Price includes Tax" checkbox.
                
3- Go to Sales Order window and create a new one.
                Select the price list used (ie.: Tarifa de ventas) in the previous products and add 4 lines with 1 quantity of each of products with taxes included, ensure the tax rate "Entregas 20%" is used per each line.
                Modify the price unit (Gross Unit Price) of these lines to have the following order [Line X (Product) = qty x Gross Unit Price]:
                               Line 10 (Cerveza Ale 0,5L) = 1 x 6.50
                               Line 20 (Cerveza Lager 0,5L) = 1 x 6.50
                               Line 30 (Vino Blanco 0,75L) = 1 x 5.90
                               Line 40 (Vino Rosado 0,75L) = 1 x 5.90
               Verify the total gross is 24.80

4- Go to the order "Taxes" tab and verify for tax "Entregas 20%" taxable amount 20.68 and tax amount 4.12.

Accordingly to the issue:
This is wrong, the expected values should be: taxable amount 20.67 and tax amount 4.13.

I need to clarify how the taxable amount and tax amount are calculated to determine when the issue is happening. To do that I am providing trace of what is storing in the database, step by step:

After adding Line 10 (Cerveza Ale 0,5L) = 1 x 6.50
                C_ORDERLINE (New)
                               pricelist = 5.42, priceactual = 5.42, linenetamt = 5.42, discount = -324.84, pricestd = 5.42, taxbaseamnt = 5.42,
                               gross_unit_price = 6.5, line_gross_amount = 6.50, grosspricelist = 1.53, grosspricestd = 6.5
                C_ORDERLINETAX (New)
                               taxbaseamnt = 5.42, taxamt = 1.08
                C_ORDERTAX (New)
                               taxbaseamnt = 5.42, taxamt = 1.08
                C_ORDER (Updated)
                               totallines = 5.42, grandtotal = 6.50

After adding Line 20 (Cerveza Lager 0,5L) = 1 x 6.50
                C_ORDERLINE (New)
                               pricelist = 5.42, priceactual = 5.42, linenetamt = 5.42, discount = -324.84, pricestd = 5.42, taxbaseamnt = 5.42,
                               gross_unit_price = 6.5, line_gross_amount = 6.50, grosspricelist = 1.53, grosspricestd = 6.5
                C_ORDERLINETAX (New)
                               taxbaseamnt = 5.42, taxamt = 1.08
                C_ORDERTAX (Updated)
                               taxbaseamnt = 10.84, taxamt = 2.16
                C_ORDER (Updated)
                               totallines = 10.84, grandtotal = 13.00

After adding Line 30 (Vino Blanco 0,75L) = 1 x 5.90
                C_ORDERLINE (New)
                               pricelist = 4.92, priceactual = 4.92, linenetamt = 4.92, discount = -285.62, pricestd = 4.92, taxbaseamnt = 4.92,
                               gross_unit_price = 5.9, line_gross_amount = 5.90, grosspricelist = 1.53, grosspricestd = 5.9
                C_ORDERLINETAX (New)
                               taxbaseamnt = 4.92, taxamt = 0.98
                C_ORDERTAX (Updated)
                               taxbaseamnt = 15.76, taxamt = 3.14
                C_ORDER (Updated)
                               totallines = 15.76, grandtotal = 18.90

After adding Line 40 (Vino Rosado 0,75L) = 1 x 5.90
                C_ORDERLINE (New)
                               pricelist = 4.92, priceactual = 4.92, linenetamt = 4.92, discount = -285.62, pricestd = 4.92, taxbaseamnt = 4.92,
                               gross_unit_price = 5.9, line_gross_amount = 5.90, grosspricelist = 1.53, grosspricestd = 5.9
                C_ORDERLINETAX (New)
                               taxbaseamnt = 4.92, taxamt = 0.98
                C_ORDERTAX (Updated)
                               taxbaseamnt = 20.68, taxamt = 4.12
                C_ORDER (Updated)
                               totallines = 20.68, grandtotal = 24.80

I can't see errors in the workflow. Can you please, help me to clarify what is incorrect and what should be the expected values?
(0088849)
vmromanos (manager)
2016-08-05 13:42
edited on: 2016-08-05 13:48

Two problems found in this bug:
1. Rounding problems because the way to calculate the net amount is based on the price instead of the line amount. Thus the rounding issues are noticeable.
This can be fixed by EAR's patch, which basically calculates the net from the gross amount instead of from the price. The change is small and controlled, but it requires deep testing, including automatic tests, to avoid possible regressions.


2. Even when fixed the rounding issues explained in previous point, we still have detected another problem in rounding, which is exactly what's reported in this issue.
Right now the tax calculation at document level is different in the ERP and POS, being the POS algorithm the right one (see 0032264 for details).

The problem found in the ERP is that the net amount is NOT properly calculated for that prices including taxes. The NET amount must be updated for each of the lines taking into account the previously available lines (right now the line net is calculated exactly in the same way as the line based calculation). The adjustment must be done always in the line with bigger amount. Instead of that, the ERP is calculating the net amount for each of the lines in an independent way, and it tries to adjust the C_INVOICETAX's tax amount from the taxable amount in C_INVOICELINETAX_TRG; however, since the taxable amount is wrong, that adjustment is not perfect.

The expected flow for tax calculation at document level for prices including taxes would be:
1. We calculate the net amount from the gross amount (and not from the price). This is done by EAR's patch.
2. The calculation must take into account the previous lines to know the sum net amount. In case the calculated sum net amount is different from the actual sum net amount in the invoice lines, the system should adjust the net amount at C_InvoiceLine level (not C_InvoiceLineTax level exactly as the POS is doing). This adjustment will be done in the line with bigger amount (as the POS does).
Note that the net amount at c_invoiceline level will have a correction, which is NOT reflected in the C_INVOICELINETAX table.

This fix might create problem with mutating tables, and might require a refactor.

(0088898)
aferraz (manager)
2016-08-08 14:59

Attached patch done by EAR to fix first problem (see note above) which should be completed, reviewed and tested.
(0093523)
aferraz (manager)
2017-01-13 12:58

https://docs.google.com/spreadsheets/d/1qsDD2LOCVILuVtCGGQEHtarTkKJHgnW90m3OyVzLxU4/edit?ts=582051de#gid=729589137 [^]
(0094743)
hgbot (developer)
2017-03-03 14:55

Repository: erp/devel/pi
Changeset: b3ee13f262a4a31d17ea5f1bf194383373a887d1
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Feb 16 12:58:57 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b3ee13f262a4a31d17ea5f1bf194383373a887d1 [^]

Fixes issue 32265: Calculate linenetamount from gross amount instead from price

Calculate linenetamount from gross amount instead from price in C_OrderLine and C_InvoiceLine triggers using new C_Get_Net_Amount_From_Gross function.
Before, we were calculating Net Unit Price from Gross Unit Price and then Line Net Amount from Net Unit Price by multiplying by the quantity. Thus, we were increasing the rounding error.
Now, we calculate first Line Net Amount from Line Gross Amount and then Net Unit Price from Line Net Amount by dividing by the quantity. Thus, we are decreasing the rounding error.

---
M src-db/database/model/triggers/C_INVOICELINE_BEFORE_TRG.xml
M src-db/database/model/triggers/C_INVOICELINE_TRG2.xml
M src-db/database/model/triggers/C_ORDERLINE_TRG.xml
M src-db/database/model/triggers/C_ORDERLINE_TRG2.xml
A src-db/database/model/functions/C_GET_NET_AMOUNT_FROM_GROSS.xml
---
(0094744)
hgbot (developer)
2017-03-03 14:55

Repository: erp/devel/pi
Changeset: 86dcf5d294d9e10e95f8f9f7b69416dc787607ca
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Mar 03 14:08:55 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/86dcf5d294d9e10e95f8f9f7b69416dc787607ca [^]

Fixes issue 32265: Fix price including taxes at document level

Do not round line amounts and tax bases, and header tax bases, in case price including taxes at document level, when document is in draft status.
Round them when completing the document.
Call again line triggers to calculate again amounts and taxes without rounding when reactivating the document.
Do not calculate document net amount incrementally in case price including taxes as we need to sum rounded taxes instead of round the sum of taxes.
Adjust taxes at line level in case price including taxes to make sure line tax base amount + line tax amount is equals line gross amount.
Adjust taxes at document level, when completing the document, in case price including taxes at document level, to make sure document tax base amount + document tax amount is equals document gross amount.
Adjust line amount, when completing the document, in case price including taxes at document level, to make sure sum of line net amounts is equals document net amount.
When reactivating price including taxes invoices with manual taxes, no recalculate taxes will be automatically deleted.

---
M src-db/database/model/functions/C_GET_NET_AMOUNT_FROM_GROSS.xml
M src-db/database/model/functions/C_INVOICELINETAX_INSERT.xml
M src-db/database/model/functions/C_INVOICE_POST.xml
M src-db/database/model/functions/C_ORDERLINETAX_INSERT.xml
M src-db/database/model/functions/C_ORDER_POST1.xml
M src-db/database/model/tables/C_ORDERLINETAX.xml
M src-db/database/model/tables/C_ORDERTAX.xml
M src-db/database/model/triggers/C_INVLINE_CHK_RESTRICTIONS_TRG.xml
M src-db/database/model/triggers/C_INVOICELINETAX_TRG.xml
M src-db/database/model/triggers/C_INVOICELINE_BEFORE_TRG.xml
M src-db/database/model/triggers/C_INVOICELINE_TRG2.xml
M src-db/database/model/triggers/C_ORDERLINETAX_TRG.xml
M src-db/database/model/triggers/C_ORDERLINE_TRG.xml
M src-db/database/model/triggers/C_ORDERLINE_TRG2.xml
---
(0094745)
hgbot (developer)
2017-03-03 14:55

Repository: erp/devel/pi
Changeset: 7eea6a2a5f227d3e1281190da6fcbe79ee63f20c
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Mar 02 18:37:33 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/7eea6a2a5f227d3e1281190da6fcbe79ee63f20c [^]

Related to issue 32265: TaxesTest refactor

Fix current tests and add more tests: https://docs.google.com/spreadsheets/d/1qsDD2LOCVILuVtCGGQEHtarTkKJHgnW90m3OyVzLxU4/edit?ts=582051de#gid=729589137 [^]

---
M referencedata/sampledata/QA_Testing/C_BPARTNER.xml
M referencedata/sampledata/QA_Testing/C_TAX.xml
M referencedata/sampledata/QA_Testing/C_TAXCATEGORY.xml
M referencedata/sampledata/QA_Testing/C_TAXCATEGORY_TRL.xml
M referencedata/sampledata/QA_Testing/C_TAX_ACCT.xml
M referencedata/sampledata/QA_Testing/C_TAX_TRL.xml
M src-test/src/org/openbravo/test/taxes/TaxesTest.java
M src-test/src/org/openbravo/test/taxes/data/ProductDataConstants.java
M src-test/src/org/openbravo/test/taxes/data/TaxDataConstants.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData1.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData10.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData11.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData12.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData13.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData14.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData15.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData16.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData17.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData18.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData19.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData2.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData20.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData21.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData22.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData23.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData24.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData25.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData26.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData27.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData28.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData29.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData3.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData30.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData31.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData32.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData33.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData34.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData4.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData5.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData6.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData7.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData8.java
M src-test/src/org/openbravo/test/taxes/data/TaxesTestData9.java
A src-test/src/org/openbravo/test/taxes/data/TaxesLineTestData.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData100.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData101.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData102.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData103.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData104.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData105.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData106.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData107.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData108.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData109.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData110.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData111.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData112.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData113.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData114.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData115.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData116.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData117.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData118.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData119.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData120.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData121.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData122.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData123.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData124.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData125.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData126.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData127.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData128.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData129.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData130.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData131.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData132.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData133.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData134.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData135.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData136.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData137.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData138.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData139.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData140.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData141.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData142.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData143.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData144.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData145.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData146.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData147.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData148.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData149.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData150.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData151.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData152.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData153.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData154.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData155.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData156.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData157.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData158.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData159.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData160.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData35.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData36.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData37.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData38.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData39.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData40.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData41.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData42.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData43.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData44.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData45.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData46.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData47.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData48.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData49.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData50.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData51.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData52.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData53.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData54.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData55.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData56.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData57.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData58.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData59.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData60.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData61.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData62.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData63.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData64.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData65.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData66.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData67.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData68.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData69.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData70.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData71.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData72.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData73.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData74.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData75.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData76.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData77.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData78.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData79.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData80.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData81.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData82.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData83.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData84.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData85.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData86.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData87.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData88.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData89.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData90.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData91.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData92.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData93.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData94.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData95.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData96.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData97.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData98.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData99.java
---
(0094770)
aferraz (manager)
2017-03-06 16:36
edited on: 2017-05-08 13:17

After issue 0032265, to help reducing the impact of this rounding issue instead of using the price, the total gross amount is used to calculate the net amount which once divided by the quantity, allow us to obtain the net price.

As the net amounts are known, the standard methods to calculate the tax amounts based on net amounts are used. However, the calculated net amount has to be rounded to the standard precision of the currency. This means that we can have some rounding issues when working with taxes calculated at document level. This is solved in issue 0032265:

In some cases, the sum of the tax amounts and the net amount might not be equal to the total gross amount. The difference will be adjusted when completing the document in the tax amounts, by adding or subtracting the difference to the higher tax amount so the final sum is correct.

It is also possible that the sum of line net amounts is not equal to the total net amount. The difference will be adjusted when completing the document, by adding or subtracting the difference to the higher line net amount so the final sum is correct.

http://wiki.openbravo.com/wiki/How_Price_Including_Taxes_are_Calculated [^]

http://wiki.openbravo.com/wiki/Price_Including_Taxes_Document_Level [^]

(0095264)
hudsonbot (developer)
2017-03-15 20:21

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/54e102bef53e [^]
Maturity status: Test
(0095265)
hudsonbot (developer)
2017-03-15 20:21

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/54e102bef53e [^]
Maturity status: Test
(0095266)
hudsonbot (developer)
2017-03-15 20:21

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/54e102bef53e [^]
Maturity status: Test
(0095425)
vmromanos (manager)
2017-03-20 15:10

Code review OK
(0095446)
hgbot (developer)
2017-03-20 19:23

Repository: erp/devel/pi
Changeset: a5ee63cb510e3dc8b0d73d08d3d5a56fdee50aca
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Mar 20 19:09:50 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/a5ee63cb510e3dc8b0d73d08d3d5a56fdee50aca [^]

Related to issue 32265: Code review improvements

---
M src-db/database/model/functions/C_GET_NET_AMOUNT_FROM_GROSS.xml
M src-db/database/model/functions/C_INVOICETAX_ADJUSTMENT.xml
M src-db/database/model/functions/C_ORDERTAX_ADJUSTMENT.xml
---
(0095476)
hudsonbot (developer)
2017-03-21 15:26

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/d2c97fb54da7 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2016-02-17 17:35 adrianromero New Issue
2016-02-17 17:35 adrianromero Assigned To => Triage Finance
2016-02-17 17:35 adrianromero Modules => Core
2016-02-17 17:35 adrianromero Triggers an Emergency Pack => No
2016-02-17 17:36 adrianromero Relationship added related to 0032264
2016-02-17 17:38 adrianromero File Added: TaxesAtDocLevel-1.png
2016-02-17 17:38 adrianromero File Added: TaxesAtDocLevel-2.png
2016-07-19 18:09 VictorVillar Resolution time => 1470088800
2016-07-19 18:09 VictorVillar Summary Taxes at document level are not properly calculated in some cases => [SER QA 1434] Taxes at document level are not properly calculated in some cases
2016-07-19 18:09 VictorVillar Tag Attached: SER-QA
2016-07-20 13:09 adrianromero Description Updated View Revisions
2016-07-20 13:09 adrianromero Steps to Reproduce Updated View Revisions
2016-07-20 13:10 adrianromero Steps to Reproduce Updated View Revisions
2016-07-20 13:15 aferraz Assigned To Triage Finance => markmm82
2016-07-28 18:10 markmm82 Status new => acknowledged
2016-07-29 15:26 markmm82 Status acknowledged => scheduled
2016-08-01 18:28 markmm82 Note Added: 0088711
2016-08-01 18:31 markmm82 Note Added: 0088712
2016-08-01 18:31 markmm82 Status scheduled => feedback
2016-08-01 18:32 markmm82 Note Deleted: 0088711
2016-08-04 09:19 aferraz Resolution time 1470088800 =>
2016-08-04 09:19 aferraz Assigned To markmm82 => aferraz
2016-08-04 09:19 aferraz Status feedback => scheduled
2016-08-04 09:19 aferraz Type defect => design defect
2016-08-05 13:42 vmromanos Note Added: 0088849
2016-08-05 13:42 vmromanos Status scheduled => acknowledged
2016-08-05 13:48 vmromanos Note Edited: 0088849 View Revisions
2016-08-05 13:53 VictorVillar Issue Monitored: VictorVillar
2016-08-08 14:57 aferraz File Added: 32265.diff
2016-08-08 14:59 aferraz Note Added: 0088898
2016-08-09 00:22 eugeni Issue Monitored: eugeni
2016-08-18 12:09 aferraz Relationship added related to 0033624
2016-08-18 12:15 migueldejuana Relationship added blocks 0033611
2016-08-19 09:49 psanjuan Relationship deleted related to 0033624
2016-11-09 13:57 aferraz Relationship added related to 0028366
2017-01-13 11:09 aferraz Relationship added related to 0024378
2017-01-13 12:58 aferraz Note Added: 0093523
2017-01-16 10:42 aferraz Relationship deleted blocks 0033611
2017-01-16 10:42 aferraz Relationship added related to 0033611
2017-03-03 13:06 aferraz Relationship added related to 0035428
2017-03-03 14:02 aferraz Relationship added related to 0035429
2017-03-03 14:48 aferraz Note Added: 0094742
2017-03-03 14:55 hgbot Checkin
2017-03-03 14:55 hgbot Note Added: 0094743
2017-03-03 14:55 hgbot Status acknowledged => resolved
2017-03-03 14:55 hgbot Resolution open => fixed
2017-03-03 14:55 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b3ee13f262a4a31d17ea5f1bf194383373a887d1 [^]
2017-03-03 14:55 hgbot Checkin
2017-03-03 14:55 hgbot Note Added: 0094744
2017-03-03 14:55 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/b3ee13f262a4a31d17ea5f1bf194383373a887d1 [^] => http://code.openbravo.com/erp/devel/pi/rev/86dcf5d294d9e10e95f8f9f7b69416dc787607ca [^]
2017-03-03 14:55 hgbot Checkin
2017-03-03 14:55 hgbot Note Added: 0094745
2017-03-06 11:41 aferraz Note Deleted: 0094742
2017-03-06 12:19 aferraz Relationship added causes 0035434
2017-03-06 14:23 aferraz Relationship added related to 0034360
2017-03-06 14:24 aferraz Relationship added related to 0035138
2017-03-06 16:36 aferraz Note Added: 0094770
2017-03-06 16:36 aferraz Note Edited: 0094770 View Revisions
2017-03-09 17:17 aferraz Relationship added causes 0035471
2017-03-10 09:16 aferraz Relationship added related to 0035475
2017-03-10 15:42 adrianromero Relationship added related to 0035486
2017-03-10 15:58 aferraz Note Edited: 0094770 View Revisions
2017-03-13 10:48 aferraz Category 07. Sales management => 09. Financial management
2017-03-15 20:21 hudsonbot Checkin
2017-03-15 20:21 hudsonbot Note Added: 0095264
2017-03-15 20:21 hudsonbot Checkin
2017-03-15 20:21 hudsonbot Note Added: 0095265
2017-03-15 20:21 hudsonbot Checkin
2017-03-15 20:21 hudsonbot Note Added: 0095266
2017-03-20 15:10 vmromanos Review Assigned To => vmromanos
2017-03-20 15:10 vmromanos Note Added: 0095425
2017-03-20 15:10 vmromanos Status resolved => closed
2017-03-20 15:10 vmromanos Fixed in Version => 3.0PR17Q2
2017-03-20 19:23 hgbot Checkin
2017-03-20 19:23 hgbot Note Added: 0095446
2017-03-21 15:26 hudsonbot Checkin
2017-03-21 15:26 hudsonbot Note Added: 0095476
2017-03-22 12:58 aferraz Relationship added related to 0035596
2017-04-12 14:07 vmromanos Relationship added related to 0035773
2017-05-08 13:17 aferraz Note Edited: 0094770 View Revisions
2017-05-09 12:11 aferraz Relationship added related to 0025506
2018-01-31 11:08 ngarcia Relationship added related to 0037789
2018-02-06 11:59 dmiguelez Relationship replaced causes 0037789
2018-02-22 19:52 markmm82 Relationship added causes 0037989
2018-03-22 13:42 aferraz Relationship added related to 0038163


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker