Skip to content

Commit

Permalink
Merge pull request #2700 from dpfaffenbauer/issue/2699
Browse files Browse the repository at this point in the history
[OrderBundle] fix precison/factor for Payment Total
  • Loading branch information
dpfaffenbauer authored Sep 7, 2024
2 parents e667a69 + 5a4dad4 commit 9b0f2ea
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,
data.precision,
data.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,
data.precision,
data.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 9b0f2ea

Please sign in to comment.