Bug 38010: Fix tax rate display
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
0d232857f9
commit
7c824a4d0f
|
|
@ -48,9 +48,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<label>{{ $__("Tax rate") }}:</label>
|
||||
<span>
|
||||
{{ (vendor.tax_rate || 0) * 100 }}
|
||||
</span>
|
||||
<span> {{ formatTaxRate(vendor.tax_rate) }}% </span>
|
||||
</li>
|
||||
<li v-if="vendor.deliverytime">
|
||||
<label>{{ $__("Delivery time") }}:</label>
|
||||
|
|
@ -241,5 +239,13 @@ export default {
|
|||
gstValues,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
formatTaxRate(taxRate) {
|
||||
if (!taxRate) return 0;
|
||||
const decimalPlaces = taxRate.toString().split(".")[1]?.length || 0;
|
||||
const multiplier = 10 ** decimalPlaces;
|
||||
return Math.round(taxRate * multiplier) / (multiplier / 100);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue