Openbravo Issue Tracking System - Retail Modules
View Issue Details
0047544Retail ModulesWeb POSpublic2021-08-13 08:172021-08-25 07:37
caristu 
ranjith_qualiantech_com 
highminorhave not tried
closedfixed 
5
 
RR21Q4 
No
0047544: addPaymentRounding utility function should be pure
The addPaymentRounding[1] utility function should be pure. Currently it is not because it has side effects: it is modifying the received payload argument on some points, like here[2].

[1] https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/blob/master/web/org.openbravo.retail.posterminal/app/model/business-object/ticket/AddPaymentUtils.js#L180 [^]
[2] https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/blob/master/web/org.openbravo.retail.posterminal/app/model/business-object/ticket/AddPaymentUtils.js#L252 [^]
.
Refactor the function to avoid doing modifications on the received payload. A possible solution is to make this function return also a new payload with the changes.
No tags attached.
Issue History
2021-08-13 08:17caristuNew Issue
2021-08-13 08:17caristuAssigned To => Retail
2021-08-13 08:17caristuTriggers an Emergency Pack => No
2021-08-13 08:19caristuDescription Updatedbug_revision_view_page.php?rev_id=22993#r22993
2021-08-13 08:19caristuDescription Updatedbug_revision_view_page.php?rev_id=22994#r22994
2021-08-23 10:55ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2021-08-23 12:06ranjith_qualiantech_comStatusnew => scheduled
2021-08-24 16:37hgbotNote Added: 0131327
2021-08-25 07:37hgbotResolutionopen => fixed
2021-08-25 07:37hgbotStatusscheduled => closed
2021-08-25 07:37hgbotFixed in Version => RR21Q4
2021-08-25 07:37hgbotNote Added: 0131334
2021-08-25 07:37hgbotNote Added: 0131335

Notes
(0131327)
hgbot   
2021-08-24 16:37   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/552 [^]
(0131334)
hgbot   
2021-08-25 07:37   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 97b2e409534526a825eaa79134810032d867d55c
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2021-08-25T05:35:51+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/97b2e409534526a825eaa79134810032d867d55c [^]

Fixed ISSUE-47544: Added payload with ticket return value of addPaymentRounding util function
* When rounding payment is added to the ticket, addPaymentRounding fn should return the payload with updated payment

---
M web/org.openbravo.retail.posterminal/app/model/business-object/ticket/AddPaymentUtils.js
M web/org.openbravo.retail.posterminal/app/model/business-object/ticket/actions/AddPayment.js
M web/org.openbravo.retail.posterminal/app/model/business-object/ticket/actions/AddPaymentRounding.js
M web/org.openbravo.retail.posterminal/app/model/business-object/ticket/actions/ReversePayment.js
---
(0131335)
hgbot   
2021-08-25 07:37   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/552 [^]