fix: streamlined discount display in all breakdowns
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
{% if ctx.priceBreakdown is not null %}
|
||||
<div class="flex items-center justify-between pb-2">
|
||||
<span class="block uppercase font-semibold">Gesamtpreis</span>
|
||||
<span class="font-semibold">{{ (displayTotal / 100)|format_currency(currency) }}</span>
|
||||
<span class="font-semibold">{{ (ctx.priceBreakdown.discountedTotal / 100)|format_currency(currency) }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="flex items-center justify-between">
|
||||
@@ -150,31 +150,16 @@
|
||||
{{ (ctx.priceBreakdown.total / 100)|format_currency(currency) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% if booking.accommodationDiscount is not null or booking.boardServiceDiscount is not null or booking.additionalServicesDiscount is not null %}
|
||||
{% if booking.accommodationDiscount is not null %}
|
||||
{% set accommodationDiscountAmount = ((ctx.priceBreakdown.basePrice + ctx.priceBreakdown.additionalPersonsPrice) * booking.accommodationDiscount / 100) | round %}
|
||||
<tr class="text-green-700">
|
||||
<td class="p-2">Rabatt Unterkunft {{ booking.accommodationDiscount }} %</td>
|
||||
<td class="p-2 text-right whitespace-nowrap">– {{ (accommodationDiscountAmount / 100)|format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if booking.boardServiceDiscount is not null %}
|
||||
{% set boardDiscountAmount = (ctx.priceBreakdown.boardPrice * booking.boardServiceDiscount / 100) | round %}
|
||||
<tr class="text-green-700">
|
||||
<td class="p-2">Rabatt Verpflegung {{ booking.boardServiceDiscount }} %</td>
|
||||
<td class="p-2 text-right whitespace-nowrap">– {{ (boardDiscountAmount / 100)|format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if booking.additionalServicesDiscount is not null %}
|
||||
{% set servicesDiscountAmount = (ctx.priceBreakdown.servicesPrice * booking.additionalServicesDiscount / 100) | round %}
|
||||
<tr class="text-green-700">
|
||||
<td class="p-2">Rabatt Zusatzleistungen {{ booking.additionalServicesDiscount }} %</td>
|
||||
<td class="p-2 text-right whitespace-nowrap">– {{ (servicesDiscountAmount / 100)|format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% for discount in ctx.priceBreakdown.discounts %}
|
||||
<tr class="text-green-700">
|
||||
<td class="p-2">Rabatt {{ discount.label }} {{ discount.percent }} %</td>
|
||||
<td class="p-2 text-right whitespace-nowrap">– {{ (discount.amount / 100)|format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if ctx.priceBreakdown.discounts is not empty %}
|
||||
<tr class="border-t border-primary-bg font-bold text-base text-green-700">
|
||||
<td class="p-2">Gesamtpreis nach Rabatt</td>
|
||||
<td class="p-2 text-right whitespace-nowrap">{{ ((booking.totalPrice ?? ctx.priceBreakdown.total) / 100)|format_currency(currency) }}</td>
|
||||
<td class="p-2 text-right whitespace-nowrap">{{ (ctx.priceBreakdown.discountedTotal / 100)|format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
{% block content %}
|
||||
{% set currency = booking.pricingCurrency ?? priceBreakdown.currency %}
|
||||
{% set displayTotal = booking.totalPrice ?? (priceBreakdown.total ?? null) %}
|
||||
|
||||
<div class="flex-1 flex flex-col lg:grid lg:grid-cols-5 min-h-0 relative">
|
||||
|
||||
@@ -42,7 +41,6 @@
|
||||
booking: booking,
|
||||
ctx: ctx,
|
||||
currency: currency,
|
||||
displayTotal: displayTotal,
|
||||
} %}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user