Openbravo Issue Tracking System - Retail Modules
View Issue Details
0027922Retail ModulesWeb POSpublic2014-10-20 23:402014-10-27 13:05
jecharri 
marvintm 
immediatemajoralways
closedfixed 
5
 
 
migueldejuana
Production - Confirmed Stable
2014-05-17
RR14Q2
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/e7c8bb410309 [^]
No
0027922: You will receive errors in Web POS if you work with created Currency
You will receive errors in Web POS if you work with created Currency

The problem happens when you insert a new value in currency window and you use it in Web POS
-Create a new currency and configure a terminal with that currency

You will receive error:

Uncaught TypeError: Cannot read property 'getFinancialAmountOf' of undefined 1ba93fe1eda59989e009edf875db1766_OBMOBCR.js:19193OB.UTIL.currency.toDefaultCurrency 1ba93fe1eda59989e009edf875db1766_OBMOBCR.js:19193OB.UTIL.calculateCurrentCash.OB.Dal.find.OB.Dal.find._.each.OB.Dal.find.me 1ba93fe1eda59989e009edf875db1766_OBMOBCR.js:21376(anonymous function)

The problem is function
toDefaultCurrency: function (fromCurrencyId, amount) {
and line
 fromCurrencyId = parseInt(fromCurrencyId, 10);

The problem is that when you create a new currency, the currency_id is not a number as it happens in the Openbravo sampledata, so when it tries to convert to int something that it is an Id you will receive NaN error.
No tags attached.
Issue History
2014-10-20 23:40jecharriNew Issue
2014-10-20 23:40jecharriAssigned To => marvintm
2014-10-20 23:40jecharriResolution time => 1414015200
2014-10-20 23:40jecharriRegression level => Production - Confirmed Stable
2014-10-20 23:40jecharriRegression date => 2014-05-17
2014-10-20 23:40jecharriRegression introduced in release => RR14Q2
2014-10-20 23:40jecharriRegression introduced by commit => https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/e7c8bb410309 [^]
2014-10-20 23:40jecharriTriggers an Emergency Pack => No
2014-10-21 10:51caristuIssue Monitored: caristu
2014-10-22 09:48hgbotCheckin
2014-10-22 09:48hgbotNote Added: 0071111
2014-10-22 09:48hgbotStatusnew => resolved
2014-10-22 09:48hgbotResolutionopen => fixed
2014-10-22 09:48hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9d640fb98a34911d1c7e8ac50422b09bbded8e63 [^]
2014-10-27 11:40OrekariaIssue Monitored: guillermogil
2014-10-27 13:05migueldejuanaReview Assigned To => migueldejuana
2014-10-27 13:05migueldejuanaNote Added: 0071193
2014-10-27 13:05migueldejuanaStatusresolved => closed

Notes
(0071111)
hgbot   
2014-10-22 09:48   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 9d640fb98a34911d1c7e8ac50422b09bbded8e63
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Wed Oct 22 09:48:01 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9d640fb98a34911d1c7e8ac50422b09bbded8e63 [^]

Fixes issue 27922: The 'currencyId' in OB.UTIL.currency is not enforced to be an 'int'

The problem was that the new ids are uuids and the webpos sampledata used 'int's, so the code was develop assuming there would be 'int's

- the ids are normalized to 'String's
- the argument checks use the OB.UTIL.Debug.isDefined method
- removed 'DEVELOPER'

---
M web/org.openbravo.retail.posterminal/js/utils/ob-utilitiesuipos.js
---
(0071193)
migueldejuana   
2014-10-27 13:05   
Tested and reviewed in d308fc27eca9