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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0056612
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSmajoralways2024-10-01 15:512024-10-08 11:16
ReportersofidossantView Statuspublic 
Assigned Tokousalya_r 
PriorityhighResolutionno change requiredFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned Toaferraz
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0056612: Error in tax calculation

DescriptionI reproduced an order in livebuilds with 39 lines and an amount, when the 13% tax is applied, it is calculated wrong.
This is due to rounding.
Since if we take the 3 decimals the calculation is correct, but if we take 2, the calculation is wrong.
Steps To Reproduce1 - Configuration of the tax rate - (attached the image)
2 - Make 39 lines of different products, and then add the quantities and amounts I attach.
IMPORTANT: if any discount is applied, deactivate them, or make the amount of the line with the discount equal to the one I attach in the excel.

Then you can see that the total of the order is 24474.24
The tax shown in the pos is 21658.56
but if I calculate the 13% of the total it is 21658.6194

There is a difference of 5

VIDEO https://drive.google.com/file/d/1ACtCLdGewuDWgBgI0ZLd2XLpZT08i7yx/view?usp=sharing [^]
Proposed SolutionThe problem is in this line when we calculate the getTaxeLine

OB.DEC.toNumber(amount.multiply(amount).divide(amount.add(taxAmount), 20, BigDecimal.prototype.ROUND_HALF_UP));


TagsNo tags attached.
Attached Filespng file icon Captura de pantalla -2024-10-01 10-52-01.png [^] (145,622 bytes) 2024-10-01 15:52


? file icon example.ods [^] (22,520 bytes) 2024-10-01 16:18

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0169894)
frank_gonzalez (developer)
2024-10-02 11:01

Jira: https://openbravo.atlassian.net/browse/RM-17859 [^]
(0169900)
sofidossant (developer)
2024-10-02 13:47

Another issue

https://drive.google.com/file/d/16hS29erR7G0bhVZPishmDSV-WT6fTN8x/view?usp=sharing [^]

80 product with price 42.47
(0170090)
aferraz (manager)
2024-10-08 11:16

The current tax information is properly calculated based on your Tax Rate configuration.

See: https://wiki.openbravo.com/wiki/Tax_Rate#Tax [^]
"Document Tax Amount Calculation" which is the way how the tax amount is going to be calculated per each tax rate (or %). The options available are:
"Document based amount by rate", this option implies that the tax amount is going to be calculated as tax amount = (tax base amounts sum at the same rate * tax rate)
"Line base amount by rate", this option implies that the tax amount is going to be calculated by line as tax amount = (tax base amount line 1 * tax rate) + (tax base amount line 2 * tax rate) + ....+ (tax base amount line n + tax rate).

As the Tax Rate is configured with Document Tax Amount Calculation = Line base amount by rate, the tax is calculated per line, that is why it doesn't match with the tax calculated by document: https://docs.google.com/spreadsheets/d/1bV9AirYmu1i_5VfhhBLsy4AADDLjdJ6qN2_VVoWW0W8 [^]

In summary:
If you configure the Tax Rate as Document Tax Amount Calculation = Line base amount by rate you will get:
Total Gross Amount: 24474.24
Total Net Amount: 21658.56
Total Tax Amount: 2815.68

If you configure the Tax Rate as Document Tax Amount Calculation = Document base amount by rate you will get:
Total Gross Amount: 24474.24
Total Net Amount: 21658.62
Total Tax Amount: 2815.62

- Issue History
Date Modified Username Field Change
2024-10-01 15:51 sofidossant New Issue
2024-10-01 15:51 sofidossant Assigned To => Retail
2024-10-01 15:51 sofidossant Triggers an Emergency Pack => No
2024-10-01 15:52 sofidossant File Added: Captura de pantalla -2024-10-01 10-52-01.png
2024-10-01 15:52 sofidossant Steps to Reproduce Updated View Revisions
2024-10-01 15:53 sofidossant Steps to Reproduce Updated View Revisions
2024-10-01 15:54 Practics Issue Monitored: Practics
2024-10-01 16:18 sofidossant File Added: example.ods
2024-10-02 07:14 guillermogil Assigned To Retail => Triage Omni OMS
2024-10-02 11:01 frank_gonzalez Note Added: 0169894
2024-10-02 11:01 frank_gonzalez Assigned To Triage Omni OMS => kousalya_r
2024-10-02 13:47 sofidossant Note Added: 0169900
2024-10-08 11:16 aferraz Note Added: 0170090
2024-10-08 11:16 aferraz Review Assigned To => aferraz
2024-10-08 11:16 aferraz Status new => closed
2024-10-08 11:16 aferraz Resolution open => no change required


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker