Openbravo Issue Tracking System - Retail Modules
View Issue Details
0035741Retail ModulesWeb POSpublic2017-04-10 12:382017-12-15 14:49
asiermartirena 
asiermartirena 
highmajoralways
closedfixed 
5
 
RR18Q1 
marvintm
Production - QA Approved
2016-11-21
RR17Q1
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5f071a4d8d3e [^]
No
0035741: Deleted lines are not correctly stored in backend
When having the save removed lines property activated for web pos, the deleted lines are not correctly saved in backend.

Initially (in the reported commit) only was a problem when removing multiple lines. The lines net and gross amounts were not correctly updated (were not set to 0). Now, also is failing when deleting a single line. I haven't found the commit which causes this second regression.
Enable the 'delete line' functionality.

Delete a line and check that the data is not correctly saved.
No tags attached.
related to defect 0035544 closed adrianromero [SER-QA 2610] Divide by 0 error in taxes calculation when deleting a line in a receipt with an especial configuration 
related to defect 0035797 closed mario_castello [SER-QA 2949] Deleted ticket does not store service lines deleted 
related to defect 0038342 closed ranjith_qualiantech_com [RR18Q2] Tax labels are not removed when all lines of a receipt are deleted 
Issue History
2017-04-10 12:38asiermartirenaNew Issue
2017-04-10 12:38asiermartirenaAssigned To => Retail
2017-04-10 12:38asiermartirenaRegression level => Production - Confirmed Stable
2017-04-10 12:38asiermartirenaRegression date => 2016-11-21
2017-04-10 12:38asiermartirenaRegression introduced in release => RR16Q4
2017-04-10 12:38asiermartirenaRegression introduced by commit => https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5f071a4d8d3e [^]
2017-04-10 12:38asiermartirenaTriggers an Emergency Pack => No
2017-04-10 12:45asiermartirenaRegression levelProduction - Confirmed Stable => Production - QA Approved
2017-04-10 12:45asiermartirenaRegression introduced in releaseRR16Q4 => RR17Q1
2017-04-10 21:14mario_castelloAssigned ToRetail => mario_castello
2017-04-11 17:54mario_castelloStatusnew => acknowledged
2017-04-11 17:54mario_castelloStatusacknowledged => scheduled
2017-04-13 05:32hgbotCheckin
2017-04-13 05:32hgbotNote Added: 0096035
2017-04-13 05:32hgbotStatusscheduled => resolved
2017-04-13 05:32hgbotResolutionopen => fixed
2017-04-13 05:32hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2d8ca4ee2032917285875bee8ea931a02b8fc2aa [^]
2017-04-13 05:35hgbotCheckin
2017-04-13 05:35hgbotNote Added: 0096036
2017-04-13 05:35hgbotCheckin
2017-04-13 05:35hgbotNote Added: 0096037
2017-04-18 10:20adrianromeroRelationship addedrelated to 0035544
2017-04-18 10:23adrianromeroNote Added: 0096049
2017-04-18 10:23adrianromeroStatusresolved => new
2017-04-18 10:23adrianromeroResolutionfixed => open
2017-04-18 10:25adrianromeroNote Added: 0096050
2017-04-18 18:21adrianromeroRelationship addedrelated to 0035797
2017-04-18 18:22mario_castelloStatusnew => acknowledged
2017-04-18 18:22mario_castelloStatusacknowledged => scheduled
2017-04-18 18:23adrianromeroNote Edited: 0096049bug_revision_view_page.php?bugnote_id=0096049#r15034
2017-04-18 18:30adrianromeroNote Added: 0096056
2017-04-19 21:36hgbotCheckin
2017-04-19 21:36hgbotNote Added: 0096070
2017-04-19 21:36hgbotStatusscheduled => resolved
2017-04-19 21:36hgbotResolutionopen => fixed
2017-04-19 21:36hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2d8ca4ee2032917285875bee8ea931a02b8fc2aa [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2e1a0d0d1e2d3b670ffed5d45a800c3683c94d83 [^]
2017-04-19 21:38hgbotCheckin
2017-04-19 21:38hgbotNote Added: 0096071
2017-04-28 11:24guilleaerReview Assigned To => guilleaer
2017-04-28 11:24guilleaerStatusresolved => closed
2017-04-28 11:24guilleaerFixed in Version => RR17Q3
2017-05-25 09:35marvintmNote Added: 0096776
2017-05-25 09:35marvintmStatusclosed => new
2017-05-25 09:35marvintmResolutionfixed => open
2017-05-25 09:35marvintmFixed in VersionRR17Q3 =>
2017-05-25 09:35marvintmStatusnew => scheduled
2017-05-25 09:35marvintmAssigned Tomario_castello => Retail
2017-07-19 13:35ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2017-07-26 16:06ranjith_qualiantech_comAssigned Toranjith_qualiantech_com => Retail
2017-07-26 16:06ranjith_qualiantech_comStatusscheduled => acknowledged
2017-08-01 08:30marvintmStatusacknowledged => scheduled
2017-08-07 09:47marvintmPriorityimmediate => high
2017-11-08 12:09hgbotCheckin
2017-11-08 12:09hgbotNote Added: 0100342
2017-11-08 12:09hgbotCheckin
2017-11-08 12:09hgbotNote Added: 0100343
2017-11-08 15:37asiermartirenaStatusscheduled => resolved
2017-11-08 15:37asiermartirenaResolutionopen => fixed
2017-11-10 13:09aaroncaleroAssigned ToRetail => asiermartirena
2017-11-21 11:24asiermartirenaReview Assigned Toguilleaer => marvintm
2017-12-13 14:18hgbotCheckin
2017-12-13 14:18hgbotNote Added: 0101011
2017-12-13 14:18hgbotCheckin
2017-12-13 14:18hgbotNote Added: 0101012
2017-12-13 16:53hgbotCheckin
2017-12-13 16:53hgbotNote Added: 0101018
2017-12-13 17:38hgbotCheckin
2017-12-13 17:38hgbotNote Added: 0101020
2017-12-15 14:49marvintmStatusresolved => closed
2017-12-15 14:49marvintmFixed in Version => RR18Q1
2018-09-12 08:39ranjith_qualiantech_comRelationship addedrelated to 0038342

Notes
(0096035)
hgbot   
2017-04-13 05:32   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 2d8ca4ee2032917285875bee8ea931a02b8fc2aa
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Wed Apr 12 13:56:37 2017 -0600
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2d8ca4ee2032917285875bee8ea931a02b8fc2aa [^]

Fixed issue 0035741: Deleted lines are not correctly stored in backend

- Refactor the hook OBPOS_PreDeleteLine that call the function deleteLines in all case
- Refactor the function deleteLines that executed always to delete one line or multiple lines at a time
- Moved some code to new function removesLines that control de deleted lines and the callback
- Set the line propertys and call calculateReceipt before executed the delete lines process

---
M web/org.openbravo.retail.posterminal/js/model/order.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/pointofsale.js
---
(0096036)
hgbot   
2017-04-13 05:35   
Repository: tools/automation/pi-mobile
Changeset: d22df88ce399f9eb3b7235aefe629d40284b7259
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Tue Apr 11 11:14:25 2017 -0600
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/d22df88ce399f9eb3b7235aefe629d40284b7259 [^]

Verifies issue 35741: Added automated test 'I35741_VerifyOrderWithDeleteLine'

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I35741_VerifyOrderWithDeleteLine.java
---
(0096037)
hgbot   
2017-04-13 05:35   
Repository: tools/automation/pi-mobile
Changeset: 6eb9b19e0cba6966ac8ffd04221a4cc4f4d6ebf5
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Tue Apr 11 11:26:49 2017 -0600
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/6eb9b19e0cba6966ac8ffd04221a4cc4f4d6ebf5 [^]

Verifies issue 35741: Added automated test 'I35741_VerifyOrderWithDeleteMultiLine'

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I35741_VerifyOrderWithDeleteMultiLine.java
---
(0096049)
adrianromero   
2017-04-18 10:23   
(edited on: 2017-04-18 18:23)
After this fix, when deleting a receipt that has lines with products and services associated to products. In the backed the deleted receipt is stored with the product lines with quantity 0, but services lines are completely deleted, do not appear in the backend. It is expected to appear with quantity 0 too.

Actually this issue has not been introduced by this fix, is has been reported as issue 35741.

(0096050)
adrianromero   
2017-04-18 10:25   
Because the code involved in this fix is very close to the fix of issue 35544. It has to be verified when fixing this issue that issue 35544 continues working properly and the deleted receipt is properly stored in the backend.
(0096056)
adrianromero   
2017-04-18 18:30   
After this fix when deleting a line with services and then deleting the receipt or adding another product and completing the receipt, in the backend the deleted product line is stored with quantity 0 (OK) but the deleted service line is stored with quantity 1 (Wrong)
(0096070)
hgbot   
2017-04-19 21:36   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 2e1a0d0d1e2d3b670ffed5d45a800c3683c94d83
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Wed Apr 19 11:10:10 2017 -0600
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2e1a0d0d1e2d3b670ffed5d45a800c3683c94d83 [^]

Fixed issue 0035741: Deleted lines are not correctly stored in backend

- Create two new function OB.DATA.LineTaxesIncPrice and OB.DATA.LineTaxesExcPrice to call caculate line taxes for one line of the receipt
- Added validation that prevent delete lines when the preference save remove ticket is active

---
M web/org.openbravo.retail.posterminal/js/data/dataordertaxes.js
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0096071)
hgbot   
2017-04-19 21:38   
Repository: tools/automation/pi-mobile
Changeset: 136aea1d415ca5068d0404c70dfcb5fe8ff03463
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Wed Apr 19 11:13:24 2017 -0600
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/136aea1d415ca5068d0404c70dfcb5fe8ff03463 [^]

Verifies issue 35741: Added automated test 'I35741_VerifyRemoveLinesWithServices'

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I35741_VerifyRemoveLinesWithServices.java
---
(0096776)
marvintm   
2017-05-25 09:35   
The approach to fix this issue is not correct. The component in the Web POS which computes lines and the receipt in general is calculateReceipt (with its corresponding calculateTaxes and applyPromotions). If we start adding logic which either fixes wrong computed parts, or sets properties which are missed because calculateReceipt is missing, then we will end up with duplicated logic which is very difficult to maintain.
(0100342)
hgbot   
2017-11-08 12:09   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 02ee988eebc384991a819e59e8e5bf8c21478a60
Author: Asier Martirena <asier.martirena <at> openbravo.com>
Date: Tue Nov 07 16:14:39 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/02ee988eebc384991a819e59e8e5bf8c21478a60 [^]

Related to issue 35741: Refactored 'Delete Lines' process

Refactored the delete lines process in order to have a better performance and be able to save correctly the deleted lines.

Now, there's a new API that must always be called in order to remove a single or multiple lines. The new function is the function 'deleteLinesFromOrder' located in the order. Using this new API is possible to control the asynchronous flows and we are able to do the delete lines process executing the 'calculateReceipt' process only once, getting a notable performance improvement.

The lines are now marked to be deleted, and in the final callback are removed at once.

The old delete line process is still alive, but a warning is added in the console telling that the flow is deprecated and that when deleting a line, the related services won't also be removed (they will be updated during the final quantity rules process, but will not be stored in the deleted lines array and won't be available is pressing the undo button).

---
M web/org.openbravo.retail.posterminal/js/components/order.js
M web/org.openbravo.retail.posterminal/js/data/dataordertaxes.js
M web/org.openbravo.retail.posterminal/js/model/order.js
M web/org.openbravo.retail.posterminal/js/pointofsale/model/pointofsale-model.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/editline.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/keyboardorder.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/pointofsale.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customeraddress/components/sharedcomponents.js
---
(0100343)
hgbot   
2017-11-08 12:09   
Repository: erp/pmods/org.openbravo.retail.complementary
Changeset: 16530c26b30dc9068ea57363df96c8d118fd50fa
Author: Asier Martirena <asier.martirena <at> openbravo.com>
Date: Wed Nov 08 09:17:22 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.complementary/rev/16530c26b30dc9068ea57363df96c8d118fd50fa [^]

Related to issue 35741: Refactored delete complementary lines process.

Due to the 'Delete Lines' refactor, the delete process of the complementary lines must also be refactored. Now, instead of listening to the remove triggers, there is a new hook which is executed for each line that is going to be deleted. The related lines to the original line are also deleted or cleared, depending of the choice the user has done. This process now can run with asynchrony.

---
M src/org/openbravo/retail/complementary/ComplementaryProductsComponentProvider.java
M web/org.openbravo.retail.complementary/js/hooks/hookPostUndo_DeleteLine.js
M web/org.openbravo.retail.complementary/js/hooks/hookPreDeleteLine.js
M web/org.openbravo.retail.complementary/js/hooks/hookRenderOrderLine.js
A web/org.openbravo.retail.complementary/js/hooks/hookPostDeleteRelatedServices.js
---
(0101011)
hgbot   
2017-12-13 14:18   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: da139c823f4750dd002a2a4fc48e658613a07187
Author: Asier Martirena <asier.martirena <at> openbravo.com>
Date: Wed Dec 13 14:17:17 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/da139c823f4750dd002a2a4fc48e658613a07187 [^]

Related to issue 35741: Code review.

Support asynchrony in the setUndo function.
Remove in the deleteLine API the lines even if the relation comes from external modules.

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0101012)
hgbot   
2017-12-13 14:18   
Repository: erp/pmods/org.openbravo.retail.complementary
Changeset: 2d8621e0bf16098eaf128b61efc97e9ca5cabe3f
Author: Asier Martirena <asier.martirena <at> openbravo.com>
Date: Tue Dec 12 09:12:40 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.complementary/rev/2d8621e0bf16098eaf128b61efc97e9ca5cabe3f [^]

Related to issue 35741: Code review.

During the delete lines process, complementary products are removed in the delete line API, not from the external complementary module. In this module, the lines to remove are just added to the array to remove.

---
M web/org.openbravo.retail.complementary/js/hooks/hookPostDeleteRelatedServices.js
---
(0101018)
hgbot   
2017-12-13 16:53   
Repository: erp/pmods/org.openbravo.retail.stockvalidation
Changeset: b3bc8a42fd65ed30a21651428873846ec60515b7
Author: Asier Martirena <asier.martirena <at> openbravo.com>
Date: Wed Dec 13 16:53:15 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.stockvalidation/rev/b3bc8a42fd65ed30a21651428873846ec60515b7 [^]

Related to issue 35741: Used the new refactored delete lines API

---
M web/org.openbravo.retail.stockvalidation/js/modals.js
---
(0101020)
hgbot   
2017-12-13 17:38   
Repository: erp/pmods/org.openbravo.retail.selfcheckout
Changeset: e3d2e2c92aca3cda77d5b52d3959cf60ccb84246
Author: Asier Martirena <asier.martirena <at> openbravo.com>
Date: Wed Dec 13 17:38:29 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.selfcheckout/rev/e3d2e2c92aca3cda77d5b52d3959cf60ccb84246 [^]

Related to issue 35741: Used the new delete lines API in the selfcheckout module

---
M web/org.openbravo.retail.selfcheckout/source/models/orderAPI.js
---