Skip to content

Commit

Permalink
[OrderBundle] fix precison/factor for Payment Total
Browse files Browse the repository at this point in the history
  • Loading branch information
dpfaffenbauer committed Sep 5, 2024
1 parent 734981e commit 490d711
Showing 1 changed file with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<span style="font-weight:bold">' + coreshop.util.format.currency_precision(
this.sale.baseCurrency.isoCode,
value,
pimcore.globalmanager.get('coreshop.currency.decimal_precision'),
pimcore.globalmanager.get('coreshop.currency.decimal_factor'),
) + '</span>';
}

return '<span style="font-weight:bold">' + coreshop.util.format.currency(this.sale.baseCurrency.isoCode, value) + '</span>';
}.bind(this)
},
Expand All @@ -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 '<span style="font-weight:bold">' + coreshop.util.format.currency_precision(
this.sale.currency.isoCode,
value,
pimcore.globalmanager.get('coreshop.currency.decimal_precision'),
pimcore.globalmanager.get('coreshop.currency.decimal_factor'),
) + '</span>';
}

return '<span style="font-weight:bold">' + coreshop.util.format.currency(this.sale.currency.isoCode, value) + '</span>';
}.bind(this)
}
Expand Down

0 comments on commit 490d711

Please sign in to comment.