feat: additional custom discount applied to total price
This commit is contained in:
@@ -47,9 +47,7 @@
|
||||
{{ form_row(form.boardService) }}
|
||||
{% endif %}
|
||||
{% if form.selectedAdditionalServices is defined %}
|
||||
<div class="lg:col-span-2">
|
||||
{{ form_row(form.selectedAdditionalServices) }}
|
||||
</div>
|
||||
{{ form_row(form.selectedAdditionalServices) }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -76,9 +74,15 @@
|
||||
{{ form_row(form.managedBy) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{{ form_row(form.accommodationDiscount) }}
|
||||
{{ form_row(form.boardServiceDiscount) }}
|
||||
{{ form_row(form.additionalServicesDiscount) }}
|
||||
<div class="lg:col-span-2 grid lg:grid-cols-3 gap-y-4 lg:gap-x-8">
|
||||
{{ form_row(form.accommodationDiscount) }}
|
||||
{{ form_row(form.boardServiceDiscount) }}
|
||||
{{ form_row(form.additionalServicesDiscount) }}
|
||||
</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) }}
|
||||
</div>
|
||||
<div class="lg:col-span-2">
|
||||
{{ form_row(form.remarks) }}
|
||||
</div>
|
||||
|
||||
@@ -84,6 +84,9 @@
|
||||
{% 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 ~ '%']) %}
|
||||
{% endif %}
|
||||
<a href="{{ edit_url }}">{{ discounts | length > 0 ? (discounts | join(', ')) : '–' }}</a>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
|
||||
@@ -148,11 +148,23 @@
|
||||
</tr>
|
||||
{% for discount in priceBreakdown.discounts %}
|
||||
<tr class="text-green-700">
|
||||
<td class="pt-1">Rabatt {{ discount.label }} {{ discount.percent }} %</td>
|
||||
<td class="pt-1">{{ discount.label }} {{ discount.percent }} %</td>
|
||||
<td class="pt-1 text-right whitespace-nowrap">– {{ (discount.amount / 100) | format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if priceBreakdown.discounts is not empty %}
|
||||
{% if priceBreakdown.discountSubtotal is not null %}
|
||||
<tr class="border-t border-gray-200">
|
||||
<td class="pt-2">Zwischensumme</td>
|
||||
<td class="pt-2 text-right whitespace-nowrap">{{ (priceBreakdown.discountSubtotal / 100) | format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if priceBreakdown.totalDiscountDetails is not null %}
|
||||
<tr class="text-green-700">
|
||||
<td class="pt-1">{{ priceBreakdown.totalDiscountDetails.label }} {{ priceBreakdown.totalDiscountDetails.percent }} %</td>
|
||||
<td class="pt-1 text-right whitespace-nowrap">– {{ (priceBreakdown.totalDiscountDetails.amount / 100) | format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if priceBreakdown.discounts is not empty or priceBreakdown.totalDiscountDetails is not null %}
|
||||
<tr class="border-t border-gray-200 font-bold text-green-700">
|
||||
<td class="pt-2">Gesamtpreis nach Rabatt</td>
|
||||
<td class="pt-2 text-right whitespace-nowrap">{{ (priceBreakdown.discountedTotal / 100) | format_currency(currency) }}</td>
|
||||
|
||||
@@ -75,11 +75,25 @@
|
||||
</tr>
|
||||
{% for discount in priceBreakdown.discounts %}
|
||||
<tr>
|
||||
<td style="{{ cell }}">Rabatt {{ discount.label }} {{ discount.percent }} %</td>
|
||||
<td style="{{ cell }}">{{ discount.label }} {{ discount.percent }} %</td>
|
||||
<td style="{{ amount }}">– {{ (discount.amount / 100)|format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if priceBreakdown.discounts is not empty %}
|
||||
{% if priceBreakdown.discountSubtotal is not null %}
|
||||
<tr>
|
||||
<td style="{{ cell }} border-top: 1px solid #d1d5db;">Zwischensumme</td>
|
||||
<td style="{{ amount }} border-top: 1px solid #d1d5db;">
|
||||
{{ (priceBreakdown.discountSubtotal / 100)|format_currency(currency) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if priceBreakdown.totalDiscountDetails is not null %}
|
||||
<tr>
|
||||
<td style="{{ cell }}">{{ priceBreakdown.totalDiscountDetails.label }} {{ priceBreakdown.totalDiscountDetails.percent }} %</td>
|
||||
<td style="{{ amount }}">– {{ (priceBreakdown.totalDiscountDetails.amount / 100)|format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if priceBreakdown.discounts is not empty or priceBreakdown.totalDiscountDetails is not null %}
|
||||
<tr>
|
||||
<td style="{{ cell }} border-top: 1px solid #d1d5db; font-weight: bold;">Gesamtpreis nach Rabatt</td>
|
||||
<td style="{{ amount }} border-top: 1px solid #d1d5db; font-weight: bold;">
|
||||
|
||||
@@ -152,11 +152,23 @@
|
||||
</tr>
|
||||
{% 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">{{ 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 %}
|
||||
{% if ctx.priceBreakdown.discountSubtotal is not null %}
|
||||
<tr class="border-t border-primary-bg">
|
||||
<td class="p-2">Zwischensumme</td>
|
||||
<td class="p-2 text-right whitespace-nowrap">{{ (ctx.priceBreakdown.discountSubtotal / 100)|format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% 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 }} %</td>
|
||||
<td class="p-2 text-right whitespace-nowrap">– {{ (ctx.priceBreakdown.totalDiscountDetails.amount / 100)|format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if ctx.priceBreakdown.discounts is not empty or ctx.priceBreakdown.totalDiscountDetails is not null %}
|
||||
<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">{{ (ctx.priceBreakdown.discountedTotal / 100)|format_currency(currency) }}</td>
|
||||
|
||||
Reference in New Issue
Block a user