feat: replace custom discount with absolute value in favor of percentage

This commit is contained in:
2026-09-08 17:11:00 +02:00
parent d6c2cfaf1c
commit f8ff4b82a3
15 changed files with 105 additions and 50 deletions
@@ -81,7 +81,7 @@
</div>
<div class="lg:col-span-2 grid lg:grid-cols-2 gap-y-4 lg:gap-x-8">
{{ form_row(form.totalDiscountLabel) }}
{{ form_row(form.totalDiscount) }}
{{ form_row(form.totalDiscountAmount) }}
</div>
<div class="lg:col-span-2">
{{ form_row(form.remarks) }}
@@ -84,8 +84,8 @@
{% if booking.additionalServicesDiscount is not null %}
{% set discounts = discounts | merge(['Zusatzleistungen ' ~ booking.additionalServicesDiscount ~ '%']) %}
{% endif %}
{% if booking.totalDiscount is not null %}
{% set discounts = discounts | merge([(booking.totalDiscountLabel ?: 'Gesamtpreis') ~ ' ' ~ booking.totalDiscount ~ '%']) %}
{% if booking.totalDiscountAmount is not null %}
{% set discounts = discounts | merge([(booking.totalDiscountLabel ?: 'Gesamtpreis') ~ ' ' ~ ((booking.totalDiscountAmount / 100) | format_currency(booking.pricingCurrency ?: 'EUR'))]) %}
{% endif %}
<a href="{{ edit_url }}">{{ discounts | length > 0 ? (discounts | join(', ')) : '' }}</a>
</td>
@@ -160,7 +160,7 @@
{% endif %}
{% if priceBreakdown.totalDiscountDetails is not null %}
<tr class="text-green-700">
<td class="pt-1">{{ priceBreakdown.totalDiscountDetails.label }} {{ priceBreakdown.totalDiscountDetails.percent }}&nbsp;%</td>
<td class="pt-1">{{ priceBreakdown.totalDiscountDetails.label }}</td>
<td class="pt-1 text-right whitespace-nowrap"> {{ (priceBreakdown.totalDiscountDetails.amount / 100) | format_currency(currency) }}</td>
</tr>
{% endif %}
+1 -1
View File
@@ -89,7 +89,7 @@
{% endif %}
{% if priceBreakdown.totalDiscountDetails is not null %}
<tr>
<td style="{{ cell }}">{{ priceBreakdown.totalDiscountDetails.label }} {{ priceBreakdown.totalDiscountDetails.percent }}&nbsp;%</td>
<td style="{{ cell }}">{{ priceBreakdown.totalDiscountDetails.label }}</td>
<td style="{{ amount }}"> {{ (priceBreakdown.totalDiscountDetails.amount / 100)|format_currency(currency) }}</td>
</tr>
{% endif %}
+1 -1
View File
@@ -164,7 +164,7 @@
{% endif %}
{% if ctx.priceBreakdown.totalDiscountDetails is not null %}
<tr class="text-green-700">
<td class="p-2">{{ ctx.priceBreakdown.totalDiscountDetails.label }} {{ ctx.priceBreakdown.totalDiscountDetails.percent }}&nbsp;%</td>
<td class="p-2">{{ ctx.priceBreakdown.totalDiscountDetails.label }}</td>
<td class="p-2 text-right whitespace-nowrap"> {{ (ctx.priceBreakdown.totalDiscountDetails.amount / 100)|format_currency(currency) }}</td>
</tr>
{% endif %}