Openbravo Issue Tracking System - Retail Modules
View Issue Details
0038967Retail ModulesWeb POSpublic2018-07-16 12:282018-09-10 15:24
airaceburu 
rqueralta 
normalmajoralways
closedfixed 
5
pi 
RR18Q4 
marvintm
No
0038967: Sum of linenet plus tax can be different than gross
Under certain conditions this error can appear in Web POS

885e3dd427966dd0eace05e3dca14967.js:3933 Receipt verification error: The sum of the net of each line plus taxes does not equal the gross: 'closed', gross: 188.97, difference: 0.01

This is also true in backend, the tax is not being adjusted properly
In Web POS:
Place a breakpoint in the line "accum = OB.DEC.add(accum, fieldValue);"
Menu, Layaway this receipt
Add 3 products to the receipt
Change the 3 prices to 62.99
Click Layaway
Notice that during the third stop in the breakpoint the value of fieldValue has a precision problem but luckily it ends up summing the appropriate value
Open the receipt
Pay it
Click Done
Notice that during the third stop of the breakpoint the value of fieldValue has no longer the precision problem and having 2 decimals makes the previous error appear
No tags attached.
related to defect 0038927 closed adrianromero To calculate pending to pay in a foreign amount it is not used the configured multiply by rate 
related to defect 0038731pi closed rqueralta Layaway price may vary when opened in another terminal 
related to defect 0041154 closed rqueralta "Tax" field in the order's JSON is wrong when including a compound tax rate in a layaway, it is loaded and paid 
Issue History
2018-07-16 12:28airaceburuNew Issue
2018-07-16 12:28airaceburuAssigned To => Retail
2018-07-16 12:28airaceburuResolution time => 1532901600
2018-07-16 12:28airaceburuTriggers an Emergency Pack => No
2018-07-16 14:00migueldejuanaRelationship addedrelated to 0038927
2018-07-16 14:04migueldejuanaReview Assigned To => marvintm
2018-07-16 14:04migueldejuanaNote Added: 0105752
2018-07-16 14:04migueldejuanaStatusnew => closed
2018-07-16 14:04migueldejuanaResolutionopen => no change required
2018-07-16 14:06migueldejuanaNote Edited: 0105752bug_revision_view_page.php?bugnote_id=0105752#r17424
2018-07-16 16:51migueldejuanaRelationship addedrelated to 0038731
2018-07-16 17:11migueldejuanaNote Deleted: 0105752
2018-07-16 17:11migueldejuanaStatusclosed => new
2018-07-16 17:11migueldejuanaResolutionno change required => open
2018-07-16 20:24rqueraltaAssigned ToRetail => rqueralta
2018-07-16 20:24rqueraltaStatusnew => scheduled
2018-08-21 22:08hgbotCheckin
2018-08-21 22:08hgbotNote Added: 0106434
2018-08-21 22:08hgbotStatusscheduled => resolved
2018-08-21 22:08hgbotResolutionopen => fixed
2018-08-21 22:08hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/3faebb978a4a636e37a6a3dc88f6a264755195c0 [^]
2018-08-22 14:51marvintmNote Added: 0106449
2018-08-22 14:51marvintmStatusresolved => new
2018-08-22 14:51marvintmResolutionfixed => open
2018-08-24 04:52hgbotCheckin
2018-08-24 04:52hgbotNote Added: 0106466
2018-08-24 04:53rqueraltaStatusnew => scheduled
2018-08-24 04:54rqueraltaStatusscheduled => resolved
2018-08-24 04:54rqueraltaResolutionopen => fixed
2018-08-24 08:21marvintmStatusresolved => closed
2018-08-24 08:21marvintmFixed in Version => RR18Q4
2018-09-10 15:24hgbotCheckin
2018-09-10 15:24hgbotNote Added: 0106673
2019-06-24 12:41ngarciaRelationship addedrelated to 0041154

Notes
(0106434)
hgbot   
2018-08-21 22:08   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 3faebb978a4a636e37a6a3dc88f6a264755195c0
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Tue Aug 21 12:07:15 2018 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/3faebb978a4a636e37a6a3dc88f6a264755195c0 [^]

Fixed issue 38967: Sum of linenet plus tax can be different than gross

- Added linenetamount to orderline model on PaidReceiptLinesProperties

---
M src/org/openbravo/retail/posterminal/PaidReceiptLinesProperties.java
M web/org.openbravo.retail.posterminal/js/data/dataordertaxes.js
---
(0106449)
marvintm   
2018-08-22 14:51   
The issue can still be reproduced, by following the same steps:

- Create layaway, three lines with price 62.99
- Click on "layaway"
- Open receipt, load it again
- Add partial payment, and click on "layaway"

Verify that you get the following error in the console:

Receipt verification error: The sum of the net of each line plus taxes does not equal the gross: 'closed', gross: 188.97, difference: -0.01;


The problem still comes from the fact that we are recalculating the net. It should just be loaded from the backend, and used in the line.
(0106466)
hgbot   
2018-08-24 04:52   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: d0b2f908faae1122d0c48e42251660e028c40447
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Thu Aug 23 18:08:20 2018 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/d0b2f908faae1122d0c48e42251660e028c40447 [^]

Related to issue 38967: Sum of linenet plus tax can be different than gross

- Added linenetamount to orderline model on PaidReceiptLinesProperties

---
M web/org.openbravo.retail.posterminal/js/data/dataordertaxes.js
---
(0106673)
hgbot   
2018-09-10 15:24   
Repository: tools/automation/pi-mobile
Changeset: 2abf23b1f744b7ee8cc89d8af4aa0987896070ff
Author: Alejandro <alekosmp86 <at> gmail.com>
Date: Mon Jul 30 17:50:06 2018 -0400
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/2abf23b1f744b7ee8cc89d8af4aa0987896070ff [^]

Related to issue 38967: added automated test

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/layaway/I38967_VerifyLayawaySumInLineNetAmount.java
---