Openbravo Issue Tracking System - Retail Modules
View Issue Details
0028925Retail ModulesWeb POSpublic2015-02-12 13:562015-02-12 13:56
Orekaria 
marvintm 
normalminoralways
newopen 
5
 
 
No
0028925: Refactor the cash management rate conversion to use the Currency API
Refactor the cash management rate conversion to use the Currency Conversion API
Verify that in the 'cashmgmt-model.js' file, the amount and origamount are not using the Currency API:

          amount: OB.DEC.mul(p.amount, p.rate),
          origAmount: p.amount,
Close example can be found in 'cashup-model.js' lines 180-188

          var fromCurrencyId = auxPay.paymentMethod.currency;
          cashUpReport.get('deposits').push(new Backbone.Model({
            searchKey: p.get('searchKey'),
            origAmount: OB.UTIL.currency.toDefaultCurrency(fromCurrencyId, OB.DEC.add(p.get('totalDeposits'), p.get('totalSales'))),
            amount: OB.DEC.add(0, OB.DEC.add(p.get('totalDeposits'), p.get('totalSales'))),
            description: p.get('name'),
            isocode: auxPay.isocode,
            rate: p.get('rate')
          }));


The reason is that we need to centralize all currency conversion operations
- for easier maintenance
- because we have a precission bug that will be solved in a centralized way
- easier custom developments
No tags attached.
blocks defect 0028916 closed guillermogil Doing a cash management with a different currency than the original generates wrong data 
Issue History
2015-02-12 13:56OrekariaNew Issue
2015-02-12 13:56OrekariaAssigned To => marvintm
2015-02-12 13:56OrekariaTriggers an Emergency Pack => No
2015-02-12 13:56OrekariaRelationship addedblocks 0028916

There are no notes attached to this issue.