From 490d711b32ee2c5e8d57d1e8720c86c2077f2316 Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Thu, 5 Sep 2024 15:39:12 +0200 Subject: [PATCH] [OrderBundle] fix precison/factor for Payment Total --- .../pimcore/js/order/detail/blocks/detail.js | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/CoreShop/Bundle/OrderBundle/Resources/public/pimcore/js/order/detail/blocks/detail.js b/src/CoreShop/Bundle/OrderBundle/Resources/public/pimcore/js/order/detail/blocks/detail.js index d4dfb49641..be6213ecee 100644 --- a/src/CoreShop/Bundle/OrderBundle/Resources/public/pimcore/js/order/detail/blocks/detail.js +++ b/src/CoreShop/Bundle/OrderBundle/Resources/public/pimcore/js/order/detail/blocks/detail.js @@ -268,7 +268,17 @@ coreshop.order.order.detail.blocks.detail = Class.create(coreshop.order.order.de dataIndex: 'value', width: 150, align: 'right', - renderer: function (value) { + renderer: function (value, metaData, record) { + var data = record.data; + if (data.hasOwnProperty('precision') && data.hasOwnProperty('factor')) { + return '' + coreshop.util.format.currency_precision( + this.sale.baseCurrency.isoCode, + value, + pimcore.globalmanager.get('coreshop.currency.decimal_precision'), + pimcore.globalmanager.get('coreshop.currency.decimal_factor'), + ) + ''; + } + return '' + coreshop.util.format.currency(this.sale.baseCurrency.isoCode, value) + ''; }.bind(this) }, @@ -278,7 +288,18 @@ coreshop.order.order.detail.blocks.detail = Class.create(coreshop.order.order.de width: 150, align: 'right', hidden: this.sale.currency.id === this.sale.baseCurrency.id, - renderer: function (value) { + renderer: function (value, metaData, record) { + var data = record.data; + + if (data.hasOwnProperty('precision') && data.hasOwnProperty('factor')) { + return '' + coreshop.util.format.currency_precision( + this.sale.currency.isoCode, + value, + pimcore.globalmanager.get('coreshop.currency.decimal_precision'), + pimcore.globalmanager.get('coreshop.currency.decimal_factor'), + ) + ''; + } + return '' + coreshop.util.format.currency(this.sale.currency.isoCode, value) + ''; }.bind(this) }