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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034360
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSmajoralways2016-11-01 14:092016-11-30 17:54
ReportermarvintmView Statuspublic 
Assigned Tomarvintm 
PrioritynormalResolutionfixedFixed in VersionRR17Q1
StatusclosedFix in branchFixed in SCM revision19f3df300f23
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToOrekaria
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0034360: Web POS is not calculating taxes at header level correctly if there are cascade taxes, with price including taxes

DescriptionCurrently, the Web POS is not computing taxes correctly if:
- Taxes are defined at document level
- There are taxes defined to be calculated in cascade

There are two main problems right now:
- The taxes at line level are not properly calculated when defined in cascade, as they are calculated from a total which is computed from a rounded price, which is then multiplied by the quantity. This creates a precision problem.
- The taxes at header level are also not computed properly, as currently the taxes are just summed from the taxes at line level, and then are adjusted so they respect the rate defined for the tax. This adjustment just doesn't work when taxes are defined in cascade.
Steps To ReproduceThe following ticket right now is not being computed correctly:
Product Qty Price Total
P1 1200 55.8 66960
P2 600 55.8 33480
P3 840 55.8 46872
P4 37 294.99 10914.63
P5 12 254.95 3059.4
P6 36 299.36 10776.96
                            172062.99

Taxes for P1, P2 and P3 are: IEPS 26.5% + 16% VAT (depending on IEPS)
Taxes for P4, P5 and P6 are: IEPS 53% + 16% VAT (depending on IEPS)
Proposed SolutionThe problem with the taxes at line level in cascade simply needs to be fixed by computing the tax from the total net amount of the line directly, instead of recalculating the net from the net price.

The problem with the taxes at header level needs to be fixed by calculating the taxes at header level properly, directly from the totals computed by summing the lines, instead of calculating them from the taxes at line level.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
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 design defect 0032265 closedaferraz Openbravo ERP [SER QA 1434] Taxes at document level are not properly calculated in some cases 

-  Notes
(0091039)
hgbot (developer)
2016-11-01 19:22

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 19f3df300f234399cf2a42837690936fc8eb8542
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Tue Nov 01 17:22:34 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/19f3df300f234399cf2a42837690936fc8eb8542 [^]

Fixed issue 34360. Taxes calculation has been improved. Three main changes have been made:
- Some variable names have been changed for greater clarity.
- When calculating taxes in the case a tax depends on another, the net which will be used will be the total net of the line, instead of calculating the net by multiplying a rounded net price by the quantity, which causes loss of precision.
- The taxes at header level now are computed by grouping the lines which have the same taxes, summing their total gross amounts, and then using the effective rate computed when calculating taxes at line level to generate the initial base, and then computing taxes in a forward manner, instead of trying to sum the taxes at line and then adjusting them.

---
M web/org.openbravo.retail.posterminal/js/data/dataordertaxes.js
---
(0091040)
hgbot (developer)
2016-11-01 19:23

Repository: tools/automation/pi-mobile
Changeset: 861b64ac7e6b89136cc20b896df6142523cffdc3
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Tue Nov 01 19:23:26 2016 +0100
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/861b64ac7e6b89136cc20b896df6142523cffdc3 [^]

Related to issue 34360. Changed the values of some tests as they have changed due to changes in the tax calculation algorithm.

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/cashup/CashUpSplitLinesMultitax.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/multipricelists/MPLDiscountsWithPriceIncludeTaxes.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/sharedpaymentmethods/SPMDiscountsWithPriceIncludeTaxes.java
---

- Issue History
Date Modified Username Field Change
2016-11-01 14:09 marvintm New Issue
2016-11-01 14:09 marvintm Assigned To => marvintm
2016-11-01 14:09 marvintm Triggers an Emergency Pack => No
2016-11-01 14:10 marvintm Steps to Reproduce Updated View Revisions
2016-11-01 14:13 marvintm Status new => scheduled
2016-11-01 19:22 hgbot Checkin
2016-11-01 19:22 hgbot Note Added: 0091039
2016-11-01 19:22 hgbot Status scheduled => resolved
2016-11-01 19:22 hgbot Resolution open => fixed
2016-11-01 19:22 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/19f3df300f234399cf2a42837690936fc8eb8542 [^]
2016-11-01 19:23 hgbot Checkin
2016-11-01 19:23 hgbot Note Added: 0091040
2016-11-30 17:54 Orekaria Review Assigned To => Orekaria
2016-11-30 17:54 Orekaria Status resolved => closed
2016-11-30 17:54 Orekaria Fixed in Version => RR17Q1
2017-02-02 19:22 marvintm Relationship added related to 0035138
2017-03-06 14:23 aferraz Relationship added related to 0032265


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker