Openbravo Issue Tracking System - Retail Modules
View Issue Details
0043710Retail ModulesWeb POSpublic2020-04-08 16:032020-04-27 15:09
gorkaion 
prakashmurugesan88 
highmajoralways
closedfixed 
5
 
RR20Q3 
marvintm
No
0043710: on manual return change the customer to a one with a different pricelist changes the qty to possitive values
On an environment using multipricelist.

While doing a manual return (not verified return) if you add some lines and later change the business partner the receipt is recalculated with positive quantities instead of negative.
1 Log in in MPL1 terminal.
2 Set the receipt to be returned.
3 Add Alpine skiing backpack 27 L product
4 Change the customer to Bryan Raymond
5 The receipt is recalculated and the line is now with positive quantity.
The issue is in _addProduct function of order.js [1]

These lines:
      if (this.get('orderType') === 1) {
        qty = qty ? -qty : -1;
      } else {
        qty = qty || 1;
      }

If the ordertype is 1 it changes the sign of the quantity. So there are 2 possibilities:

1. Fix that logic to ensure that if the qty is already negative it does not require to change the sign.
2. Fix the logic in removeAndInsertLines function. So when the lines are inserted back the quantity used in the addProduct is positive.

[1] https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/blob/master/web/org.openbravo.retail.posterminal/js/model/order.js#L3394 [^]
No tags attached.
Issue History
2020-04-08 16:03gorkaionNew Issue
2020-04-08 16:03gorkaionAssigned To => Retail
2020-04-08 16:03gorkaionResolution time => 1588111200
2020-04-08 16:03gorkaionTriggers an Emergency Pack => No
2020-04-08 16:42ahernandezgilIssue Monitored: ahernandezgil
2020-04-17 10:24prakashmurugesan88Assigned ToRetail => prakashmurugesan88
2020-04-20 10:07prakashmurugesan88Statusnew => scheduled
2020-04-22 08:33hgbotCheckin
2020-04-22 08:33hgbotNote Added: 0119315
2020-04-22 08:33hgbotStatusscheduled => resolved
2020-04-22 08:33hgbotResolutionopen => fixed
2020-04-22 08:33hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/f5983910853ac45262269a27f29218788a4e7690 [^]
2020-04-22 08:33hgbotCheckin
2020-04-22 08:33hgbotNote Added: 0119316
2020-04-22 18:37marvintmNote Added: 0119343
2020-04-22 18:37marvintmStatusresolved => new
2020-04-22 18:37marvintmResolutionfixed => open
2020-04-23 10:22prakashmurugesan88Statusnew => scheduled
2020-04-24 15:19hgbotCheckin
2020-04-24 15:19hgbotNote Added: 0119400
2020-04-24 15:19hgbotStatusscheduled => resolved
2020-04-24 15:19hgbotResolutionopen => fixed
2020-04-24 15:19hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/f5983910853ac45262269a27f29218788a4e7690 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/99383eef2ef8fc616058ec055b6cfd6a82a32bef [^]
2020-04-24 15:19hgbotCheckin
2020-04-24 15:19hgbotNote Added: 0119401
2020-04-27 15:09marvintmReview Assigned To => marvintm
2020-04-27 15:09marvintmStatusresolved => closed
2020-04-27 15:09marvintmFixed in Version => RR20Q3

Notes
(0119315)
hgbot   
2020-04-22 08:33   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: f5983910853ac45262269a27f29218788a4e7690
Author: Prakash M <prakash <at> qualiantech.com>
Date: Wed Apr 22 12:02:57 2020 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/f5983910853ac45262269a27f29218788a4e7690 [^]

Fixed BUG-43710: Change of customer with different pricelist in manual return
changes line qty from negative to positive.

Issue caused in _addProduct function
Here when orderType is return, it converts the sign.
Therefore negative qty converted again to positive.

In removeAndInsertLines function quantites are converted to positive before
addProduct.
Therefore sign convertion for return handled in existing _addProduct function

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0119316)
hgbot   
2020-04-22 08:33   
Repository: tools/automation/pi-mobile
Changeset: 8c948ba40e05384b8e3782c26b239a5bb6594f2b
Author: Prakash M <prakash <at> qualiantech.com>
Date: Wed Apr 22 12:03:29 2020 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/8c948ba40e05384b8e3782c26b239a5bb6594f2b [^]

Related to BUG-43710: verifies return qty remains negative on changing customer
with different pricelist in manual return

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/multipricelists/I43710_MPLManualReturn.java
---
(0119343)
marvintm   
2020-04-22 18:37   
Fix doesn't work correctly in all cases.

Now it works correctly when "Return this receipt" option has been selected.

However, if a normal ticket is created, a line is added, and then "Return line" is selected on this line, and then customer is changed to one that has a different pricelist, the quantity is still changed to positive values.
(0119400)
hgbot   
2020-04-24 15:19   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 99383eef2ef8fc616058ec055b6cfd6a82a32bef
Author: Prakash M <prakash <at> qualiantech.com>
Date: Fri Apr 24 18:48:11 2020 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/99383eef2ef8fc616058ec055b6cfd6a82a32bef [^]

Fixed BUG-43710: Change of customer with different pricelist in a receipt with
line having negative qty, changes qty to positive

* negative quantites are converted to positive for all order types.
* But it should be only for return order.

* In removeAndInsertLines function quantites are converted to positive only if
it is return receipt
* Therefore sign convertion for return receipt handled in existing _addProduct
function

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0119401)
hgbot   
2020-04-24 15:19   
Repository: tools/automation/pi-mobile
Changeset: 4fde4fc5a744c91383c3b6dcc81dcdcfc53ba567
Author: Prakash M <prakash <at> qualiantech.com>
Date: Fri Apr 24 18:48:02 2020 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/4fde4fc5a744c91383c3b6dcc81dcdcfc53ba567 [^]

Related to BUG-43710: verifies return qty remains negative on changing customer
with different pricelist in order with negative line

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/multipricelists/I43710_MPLOrderWithNegativeLine.java
---