Widget: fix show taxline for 0 or 0.00 tax-rate

This commit is contained in:
Richard Schreiber
2026-08-27 16:43:36 +02:00
parent 2e8e6a6b07
commit 5702f51973
2 changed files with 7 additions and 2 deletions
@@ -345,7 +345,7 @@ Vue.component('pricebox', {
+ ' :min="display_price_nonlocalized" :value="suggested_price_nonlocalized" :name="field_name"'
+ ' step="any" v-bind:aria-labelledby="aria_labelledby" v-bind:aria-describedby="price_desc_id">'
+ '</div>'
+ '<small class="pretix-widget-pricebox-tax" :id="price_desc_id" v-if="price.rate != \'0\' && price.gross != \'0.00\'">'
+ '<small class="pretix-widget-pricebox-tax" :id="price_desc_id" v-if="show_taxline">'
+ '{{ taxline }}'
+ '</small>'
+ '</div>'),
@@ -422,6 +422,10 @@ Vue.component('pricebox', {
return '<span class="pretix-widget-pricebox-currency">' + this.$root.currency + "</span> " + this.display_price;
}
},
show_taxline: function () {
// rate can either be "0.00" or "0" => parseFloat to check
return Number.parseFloat(this.price.rate) && Number.parseFloat(this.price.gross);
},
taxline: function () {
if (this.$root.display_net_prices) {
if (this.price.includes_mixed_tax_rate) {
@@ -86,7 +86,8 @@ const taxline = computed(() => {
}
})
const showTaxline = computed(() => props.price.rate !== '0' && props.price.gross !== '0.00')
// rate can either be "0.00" or "0" => parseFloat to check
const showTaxline = computed(() => Number.parseFloat(props.price.rate) && Number.parseFloat(props.price.gross))
</script>
<template lang="pug">
.pretix-widget-pricebox