Openbravo Issue Tracking System - Retail Modules
View Issue Details
0035669Retail ModulesWeb POSpublic2017-03-31 13:542018-07-24 17:41
aaroncalero 
marvintm 
normalmajorrandom
closedfixed 
5
 
RR17Q3 
guilleaer
OBPS
No
0035669: It is possible to load tickets in web pos with wrongly sorted lines
When using remote mode for products, when a ticket is loaded in web pos several requests are done to the server to load product data for each line.
These requests are executed in parallel and might or might not return results on the same order they are executed.
After each request have finished, the corresponding line is added to the orderline list of the receipt.
Depending on the return order of the server calls, order lines might be added to the orderline list at the wrong index.
In a development environment (to be able to set breakpoints)
Login in backend, go to the preference window and enable the remote mode for products.
Login in web pos and create a new layaway (Menu > Layaway this receipt).
Add 3 lines (any product):
First line with qty 1
Second line with qty 2
Third line with qty 3.
Click on the Total Amount button and then on Layaway.
In Eclipse, set a breakpoint on the Product.java file (product master data query).
In web pos, try to load the previously created layaway.
Return to eclise; there will be 3 paused threads on the Product.java file.
Identify the thread corresponding to the third line and continue its execution.
Identify the thread corresponding to the second line and continue its execution.
Identify the thread corresponding to the first line and continue its execution.
Continue the execution of anything that might be remaining.
Go back to web pos and verify the receipt lines:
The fist line will be the one with qty 1
The second line will be the one with qty 3
The third line will be the one with qty 2.
2 possible solutions
1. Refactor the loading of receipt lines and create a new recursive function to load product data and add lines to the receipt.
2. Sort the collection of lines by the lineNo after loading them.
No tags attached.
diff issue35669.diff (777) 2017-03-31 19:08
https://issues.openbravo.com/file_download.php?file_id=10631&type=bug
Issue History
2017-03-31 13:54aaroncaleroNew Issue
2017-03-31 13:54aaroncaleroAssigned To => Retail
2017-03-31 13:54aaroncaleroOBNetwork customer => Yes
2017-03-31 13:54aaroncaleroResolution time => 1492120800
2017-03-31 13:54aaroncaleroTriggers an Emergency Pack => No
2017-03-31 16:36mario_castelloAssigned ToRetail => mario_castello
2017-03-31 19:08marvintmFile Added: issue35669.diff
2017-04-03 16:59hgbotCheckin
2017-04-03 16:59hgbotNote Added: 0095816
2017-04-03 16:59hgbotStatusnew => resolved
2017-04-03 16:59hgbotResolutionopen => fixed
2017-04-03 16:59hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4d1e69ce0acda5556e331ba5d74fad7ecf88fb20 [^]
2017-04-05 17:52marvintmAssigned Tomario_castello => marvintm
2017-04-10 10:47guilleaerReview Assigned To => guilleaer
2017-04-10 10:47guilleaerStatusresolved => closed
2017-04-10 10:47guilleaerFixed in Version => RR17Q3
2018-07-24 17:41hgbotCheckin
2018-07-24 17:41hgbotNote Added: 0105931

Notes
(0095816)
hgbot   
2017-04-03 16:59   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 4d1e69ce0acda5556e331ba5d74fad7ecf88fb20
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Fri Mar 31 17:23:09 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4d1e69ce0acda5556e331ba5d74fad7ecf88fb20 [^]

Fixed issue 35669. Sort the lines collection after having added all of them, to ensure that the final order is correct.

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0105931)
hgbot   
2018-07-24 17:41   
Repository: tools/automation/pi-mobile
Changeset: ea36c68ab29ba114863b1d074bc86f2283d6df4f
Author: Alejandro <alekosmp86 <at> gmail.com>
Date: Fri Jul 20 15:16:40 2018 -0400
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/ea36c68ab29ba114863b1d074bc86f2283d6df4f [^]

Related to issue 35669: added automated test

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I35669_VerifyTicketLinesOrder.java
---