Openbravo Issue Tracking System - Retail Modules
View Issue Details
0050509Retail ModulesWeb POSpublic2022-10-13 08:492023-03-02 07:33
nicola_uva 
aferraz 
urgentmajorhave not tried
closedfixed 
5
pi 
pi 
marvintm
No
0050509: WEBPOS - taxes/round/prices with 4decimal not properly calculated on the WEBPOS
Taxes/Round/Prices not properly calculated. There is a discrepancy of 1cents beetween backoffice and POS. (see images attached)
1)Configure currency 2 decimal,price to 4 and mask in the pos in the format: #,##0.00
2)login on webpos
3) add several lines to the ticket
4) finalize the ticket
5) compare backoffice and webpos you can see 1cents of difference (see image attached)

Below items added to the ticket with prices and taxes for each of them

product A
qty:1
net unit price: 5.9700,
gross unit price: 6.3000
tax rate: 5.5%
Taxable Amount : 5.97
Tax Amount: 0.33

product B
qty:1
net unit price: 0.0200,
gross unit price: 0.0233
tax rate: 5.5%
Taxable Amount : 0.02
Tax Amount: 0

product C
qty:1
net unit price: 0,
gross unit price: 0
tax rate: 20%
Taxable Amount : 0
Tax Amount: 0

product D
qty:1
net unit price: 5.9700,
gross unit price: 6.3000
tax rate: 5.5%
Taxable Amount : 5.97
Tax Amount: 0.33

product E
qty:1
net unit price: 8.9100,
gross unit price: 9.4000
tax rate: 5.5%
Taxable Amount : 8.91
Tax Amount: 0.49

Taxes calculation:
Actual Result -> 20.88 + 1.15 = 22.03
Expected Result -> 20.87 + 1.15 = 22.02
No tags attached.
png image002.png (62,348) 2022-10-13 08:49
https://issues.openbravo.com/file_download.php?file_id=17633&type=bug
png

png image (3).png (78,595) 2022-10-13 08:50
https://issues.openbravo.com/file_download.php?file_id=17634&type=bug
png

png Ticket1.png (305,697) 2022-10-19 17:06
https://issues.openbravo.com/file_download.php?file_id=17688&type=bug
png Ticket2.png (304,292) 2022-10-19 17:06
https://issues.openbravo.com/file_download.php?file_id=17689&type=bug
png Ticket1-BO.png (182,662) 2022-10-19 17:15
https://issues.openbravo.com/file_download.php?file_id=17690&type=bug
png
Issue History
2022-10-13 08:49nicola_uvaNew Issue
2022-10-13 08:49nicola_uvaAssigned To => Retail
2022-10-13 08:49nicola_uvaFile Added: image002.png
2022-10-13 08:49nicola_uvaTriggers an Emergency Pack => No
2022-10-13 08:50nicola_uvaFile Added: image (3).png
2022-10-13 09:45nicola_uvaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=24872#r24872
2022-10-13 18:34nicola_uvaSummaryWEBPOS - taxes/round/prices with 4decimal not properly calculated => WEBPOS - taxes/round/prices with 4decimal not properly calculated on the WEBPOS
2022-10-14 08:21radhakrishnanAssigned ToRetail => radhakrishnan
2022-10-14 08:21radhakrishnanStatusnew => scheduled
2022-10-14 12:31nicola_uvaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=24888#r24888
2022-10-17 07:31marvintmAssigned Toradhakrishnan => Triage Omni OMS
2022-10-17 10:40aferrazStatusscheduled => acknowledged
2022-10-19 14:41aferrazAssigned ToTriage Omni OMS => aferraz
2022-10-19 16:43aferrazStatusacknowledged => scheduled
2022-10-19 16:44aferrazStatusscheduled => resolved
2022-10-19 16:44aferrazResolutionopen => fixed
2022-10-19 16:44aferrazStatusresolved => new
2022-10-19 16:44aferrazResolutionfixed => open
2022-10-19 16:51aferrazReview Assigned To => marvintm
2022-10-19 16:51aferrazNote Added: 0142294
2022-10-19 16:51aferrazStatusnew => closed
2022-10-19 16:51aferrazResolutionopen => no change required
2022-10-19 16:56aferrazNote Edited: 0142294bug_revision_view_page.php?bugnote_id=0142294#r24935
2022-10-19 17:05aferrazNote Edited: 0142294bug_revision_view_page.php?bugnote_id=0142294#r24936
2022-10-19 17:06aferrazFile Added: Ticket1.png
2022-10-19 17:06aferrazFile Added: Ticket2.png
2022-10-19 17:15aferrazNote Edited: 0142294bug_revision_view_page.php?bugnote_id=0142294#r24937
2022-10-19 17:15aferrazFile Added: Ticket1-BO.png
2022-12-21 05:01hgbotNote Added: 0144853
2022-12-21 05:02hgbotNote Added: 0144854
2023-01-04 17:44hgbotNote Added: 0145173
2023-01-06 21:28hgbotNote Added: 0145193
2023-01-30 05:52hgbotNote Added: 0145985
2023-02-08 16:10hgbotNote Added: 0146289
2023-03-02 07:27hgbotResolutionno change required => fixed
2023-03-02 07:27hgbotFixed in Version => RR23Q2
2023-03-02 07:27hgbotNote Added: 0147205
2023-03-02 07:27hgbotNote Added: 0147206
2023-03-02 07:29hgbotNote Added: 0147207
2023-03-02 07:29hgbotNote Added: 0147208
2023-03-02 07:31hgbotNote Added: 0147209
2023-03-02 07:31hgbotNote Added: 0147210
2023-03-02 07:32hgbotFixed in VersionRR23Q2 => 23Q2
2023-03-02 07:32hgbotNote Added: 0147211
2023-03-02 07:32hgbotNote Added: 0147212
2023-03-02 07:33hgbotNote Added: 0147213
2023-03-02 07:33hgbotNote Added: 0147214

Notes
(0142294)
aferraz   
2022-10-19 16:51   
(edited on: 2022-10-19 17:15)
Tax engine is working as expected.

If you define a POS precision of 4, the ticket gross amount, net amount and taxes will be calculated using this precision: http://wiki.openbravo.com/wiki/Retail:Configuration_Guide#Numerical_Precision_Configuration [^]

In the issue example, the ticket amounts are correctly calculated as follows (see Ticket1.png):
grandtotal: 22.0233
totallines: 20.8752
taxbaseamt: 20.8752
taxamt: 1.1481
You can see same amounts in Sales Order window defining a proper mask in Format.xml (see Ticket1-BO.png).

By defining a POS precision of 2 in the issue example, the ticket amounts are correctly calculated as follows (see Ticket2.png):
grandtotal: 22.02
totallines: 20.87
taxbaseamt: 20.87
taxamt: 1.15

(0144853)
hgbot   
2022-12-21 05:01   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/447 [^]
(0144854)
hgbot   
2022-12-21 05:02   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1018 [^]
(0145173)
hgbot   
2023-01-04 17:44   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/83 [^]
(0145193)
hgbot   
2023-01-06 21:28   
Merge Request created: https://gitlab.com/openbravo/ci/mobile-test/-/merge_requests/256 [^]
(0145985)
hgbot   
2023-01-30 05:52   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1488 [^]
(0146289)
hgbot   
2023-02-08 16:10   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.restaurant/-/merge_requests/204 [^]
(0147205)
hgbot   
2023-03-02 07:27   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: de6c20bc21871e6fd1a22724c3f4ca349d90b3fb
Author: Antonio Moreno <antonio.moreno@openbravo.com>
Date: 02-03-2023 07:27:27
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/de6c20bc21871e6fd1a22724c3f4ca349d90b3fb [^]

Fixed ISSUE-50509: Merge branch 'fix/50509'

---
M web/org.openbravo.mobile.core/source/utils/ob-arithmetic.js
---
(0147206)
hgbot   
2023-03-02 07:27   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/447 [^]
(0147207)
hgbot   
2023-03-02 07:29   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: bf4961489313b800d11143064ca75393cb596c1b
Author: Antonio Moreno <antonio.moreno@openbravo.com>
Date: 02-03-2023 07:29:21
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/bf4961489313b800d11143064ca75393cb596c1b [^]

Fixed ISSUE-50509: Merged branch.

---
M src/org/openbravo/retail/posterminal/OrderLoader.java
M src/org/openbravo/retail/posterminal/PaidReceipts.java
M src/org/openbravo/retail/posterminal/term/Payments.java
M web/org.openbravo.retail.posterminal/app/model/business-logic/taxes-engine/engine/tax-rules.js
M web/org.openbravo.retail.posterminal/app/model/business-object/ticket/LoadTicketUtils.js
M web/org.openbravo.retail.posterminal/app/model/business-object/ticket/TicketUtils.js
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
---
(0147208)
hgbot   
2023-03-02 07:29   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1018 [^]
(0147209)
hgbot   
2023-03-02 07:31   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts [^]
Changeset: b6dbd18d0afa4805c362912254c32a19e8620455
Author: Antonio Moreno <antonio.moreno@openbravo.com>
Date: 02-03-2023 07:31:22
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/commit/b6dbd18d0afa4805c362912254c32a19e8620455 [^]

Fixed ISSUE-50509: Merge branch 'fix/50509'

---
M web-test/model/business-logic/discounts-engine/engine/discount-engine.test.js
M web/org.openbravo.retail.discounts/app/model/business-logic/discounts-engine/engine/discount-engine.js
---
(0147210)
hgbot   
2023-03-02 07:31   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/83 [^]
(0147211)
hgbot   
2023-03-02 07:32   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 811ad79f229c1be3b5fba8563d54b6615bb64719
Author: Antonio Moreno <antonio.moreno@openbravo.com>
Date: 02-03-2023 07:32:26
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/811ad79f229c1be3b5fba8563d54b6615bb64719 [^]

Fixed ISSUE-50509: Merge branch 'fix/50509'

---
M web-jspack/org.openbravo.pos2/src/authentication/loginInitActions.js
M web-jspack/org.openbravo.pos2/src/components/Ticket/TicketLinePrice/TicketLinePrice.jsx
---
(0147212)
hgbot   
2023-03-02 07:32   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1488 [^]
(0147213)
hgbot   
2023-03-02 07:33   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/ci/mobile-test [^]
Changeset: 23427339b156bcda9545d66d2613761edc49c3ba
Author: Gabriel Lopez <gabriel.lopez@doceleguas.com>
Date: 02-03-2023 06:33:11
URL: https://gitlab.com/openbravo/ci/mobile-test/-/commit/23427339b156bcda9545d66d2613761edc49c3ba [^]

Fixed ISSUE-50509: Adjusted tests

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I32263_VerifyOrderAmtBasedOnPrecision.java
---
(0147214)
hgbot   
2023-03-02 07:33   
Merge request merged: https://gitlab.com/openbravo/ci/mobile-test/-/merge_requests/256 [^]