Openbravo Issue Tracking System - Retail Modules
View Issue Details
0038745Retail ModulesWeb POSpublic2018-06-13 09:122018-06-13 09:15
guillermogil 
Retail 
highmajoralways
newopen 
5
 
 
No
0038745: In case currencyFormat is set a precision 0 foreign currency precision should override it
In case currencyFormat is set a precision 0 foreign currency precision should override it.
- Configure Format.xml with 2 decimals
- Configure currency format as 0 decimals
- Set EUR currency as precision 0
- Set USD currency as precision 2

Login on WebPOS
Add a product
Pay with USD

We have lost all that information
In will be needed to add a new parameter in OB.I18N.formatCurrency to send the precision of the currency.
e.g.-
  OB.I18N.formatCurrency = function (number, precision) {
     var maskNumeric = OB.Format.formats.priceInform,
         decSeparator = OB.Format.defaultDecimalSymbol,
         groupSeparator = OB.Format.defaultGroupingSymbol,
         groupInterval = OB.Format.defaultGroupingSize;
 
    if (precision) {
      var maskNumericSplitted = maskNumeric.split('.');
      if (maskNumericSplitted.length = 1 || maskNumericSplitted[1].length !== precision) {
        if (precision > 0) {
          maskNumeric = maskNumericSplitted[0] + '.' + ''.padStart(precision, 0);
        } else {
          maskNumeric = maskNumericSplitted[0];
        }
      }
    }

     maskNumeric = maskNumeric.replace(',', 'dummy').replace('.', decSeparator).replace('dummy', groupSeparator);
 
     return OB.Utilities.Number.JSToOBMasked(number, maskNumeric, decSeparator, groupSeparator, groupInterval);
   };
No tags attached.
related to defect 0038743 closed adrianromero If there is a different currency precision on the foreign currency 
Issue History
2018-06-13 09:12guillermogilNew Issue
2018-06-13 09:12guillermogilAssigned To => Retail
2018-06-13 09:12guillermogilTriggers an Emergency Pack => No
2018-06-13 09:12guillermogilRelationship addedrelated to 0038743
2018-06-13 09:15guillermogilProposed Solution updated

There are no notes attached to this issue.