Openbravo Issue Tracking System - Retail Modules
View Issue Details
0034631Retail ModulesWeb POSpublic2016-11-25 09:452016-12-21 16:55
migueldejuana 
mario_castello 
normalmajoralways
closedfixed 
5
 
RR17Q1 
marvintm
No
0034631: Js error when splitting packs lines (7 packs in advance)
We get a Javascript error when we add many packs to the receipt and we split on of pack's line.

See steps.
The error happens in model/order.js file in line 3815:
clonedPromotion.amt = OB.DEC.toNumber(OB.DEC.toBigDecimal(OB.I18N.formatCurrency((promotion.amt * (clonedPromotion.obdiscQtyoffer / promotion.qtyOffer)))));

If we add 6 packs, the error doesn't appears but if we add 7,8,9... the error starts happening.

 
- Login
- Go to the browser and add 7 times Camping Pack
- We get 14 Down sleeping bag 500
- Select this line and press Split button in EDIT panel
- In Split modal, select 14 lines and press Apply
- ERROR! Javascript error: "bigdecimal-1.0.1.js:14 Uncaught BigDecimal(): Not a number: 1,,,0,0,3,.,6,2"
No tags attached.
Issue History
2016-11-25 09:45migueldejuanaNew Issue
2016-11-25 09:45migueldejuanaAssigned To => Retail
2016-11-25 09:45migueldejuanaTriggers an Emergency Pack => No
2016-12-06 21:58mario_castelloAssigned ToRetail => mario_castello
2016-12-06 21:58mario_castelloStatusnew => acknowledged
2016-12-06 21:58mario_castelloStatusacknowledged => scheduled
2016-12-08 16:26hgbotCheckin
2016-12-08 16:26hgbotNote Added: 0092216
2016-12-08 16:26hgbotStatusscheduled => resolved
2016-12-08 16:26hgbotResolutionopen => fixed
2016-12-08 16:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/711b9793838185ddb271105b38c4dc4053c5488a [^]
2016-12-08 16:27hgbotCheckin
2016-12-08 16:27hgbotNote Added: 0092217
2016-12-08 16:33hgbotCheckin
2016-12-08 16:33hgbotNote Added: 0092218
2016-12-08 16:40mario_castelloNote Added: 0092219
2016-12-08 16:41mario_castelloNote Edited: 0092219bug_revision_view_page.php?bugnote_id=0092219#r13968
2016-12-21 16:55marvintmReview Assigned To => marvintm
2016-12-21 16:55marvintmStatusresolved => closed
2016-12-21 16:55marvintmFixed in Version => RR17Q1

Notes
(0092216)
hgbot   
2016-12-08 16:26   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 711b9793838185ddb271105b38c4dc4053c5488a
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Tue Dec 06 15:41:01 2016 -0600
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/711b9793838185ddb271105b38c4dc4053c5488a [^]

Fixed issue 0034631: Js error when splitting packs lines (7 packs in advance)

- Remove the call of the OB.I18N.formatCurrency function inside the transformation of the result to a Number.
- This function generate an error when the numer is over than one thousand because introduce the thousands separator and the result is an string.

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0092217)
hgbot   
2016-12-08 16:27   
Repository: tools/automation/pi-mobile
Changeset: c2ac6f00d6854349331096a05472b1141a87ea19
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Tue Dec 06 16:03:50 2016 -0600
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/c2ac6f00d6854349331096a05472b1141a87ea19 [^]

Verifies issue 34631: Added automated test I34631_VerifySplitLinesWithBigDiscount

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/splitline/I34631_VerifySplitLinesWithBigDiscount.java
---
(0092218)
hgbot   
2016-12-08 16:33   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 37b1f3f4030582aac69c60b59ccc17c16b76b9cd
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Wed Dec 07 09:57:28 2016 -0600
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/37b1f3f4030582aac69c60b59ccc17c16b76b9cd [^]

Verifies issue 0034631: Js error when splitting packs lines (7 packs in advance)

- Delete the function OB.I18N.formatCurrency when used before the convertion to BigDecimal.

---
M web/org.openbravo.retail.posterminal/js/components/modalsplitlines.js
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0092219)
mario_castello   
2016-12-08 16:40   
(edited on: 2016-12-08 16:41)
It is not necessary use the formatCurrency when the result can be tranforming to a Number
because this function returns a number as string with formatt.