137 lines
6.7 KiB
Twig
137 lines
6.7 KiB
Twig
{% extends 'layout_admin.html.twig' %}
|
||
|
||
{% block content %}
|
||
<twig:page:heading>Buchungen & Anfragen</twig:page:heading>
|
||
{{ include('_partials/_list_filter_bar.html.twig', {
|
||
'filter': filter,
|
||
'form': filter_form,
|
||
'route': 'app_admin_accommodationbooking',
|
||
'modal_route': 'app_admin_accommodationbooking_filter',
|
||
}) }}
|
||
<div class="data-table-wrapper">
|
||
<div class="data-table-wrapper__inner text-sm">
|
||
<table class="data-table">
|
||
<thead>
|
||
<tr>
|
||
<th>
|
||
{{ knp_pagination_sortable(pagination, 'Eingang', 'booking.createdAt') }}
|
||
</th>
|
||
<th>
|
||
{{ knp_pagination_sortable(pagination, 'Gruppenhaus', 'accommodation.name') }}
|
||
</th>
|
||
<th>
|
||
{{ knp_pagination_sortable(pagination, 'Gruppe', 'booking.groupName') }}
|
||
</th>
|
||
<th>
|
||
{{ knp_pagination_sortable(pagination, 'Anreise', 'booking.dateFrom') }}
|
||
</th>
|
||
<th>
|
||
Personen
|
||
</th>
|
||
<th>
|
||
Betreuer:in
|
||
</th>
|
||
<th>
|
||
Status
|
||
</th>
|
||
<th>
|
||
Rabatt
|
||
</th>
|
||
<th></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for booking in pagination %}
|
||
{% set edit_url = path('app_admin_accommodationbooking_edit', { 'id': booking.id, 'r': return_url() }) %}
|
||
<tr>
|
||
<td>
|
||
<a href="{{ edit_url }}">{{ booking.createdAt | date('d.m.Y, H:i') }}</a>
|
||
</td>
|
||
<td>
|
||
<a href="{{ edit_url }}">{{ booking.accommodation.name }}</a>
|
||
</td>
|
||
<td>
|
||
<a href="{{ edit_url }}">{{ booking.groupName }}</a>
|
||
</td>
|
||
<td>
|
||
<a href="{{ edit_url }}">{{ booking.dateFrom | date('d.m.Y') }} – {{ booking.dateTo | date('d.m.Y') }}</a>
|
||
</td>
|
||
<td>
|
||
<a href="{{ edit_url }}">{{ booking.paxCount }}</a>
|
||
</td>
|
||
<td>
|
||
<a href="{{ edit_url }}">
|
||
{% if booking.managedBy is not null %}
|
||
{{ booking.managedBy.displayName }}
|
||
{% else %}
|
||
keine Zuordnung
|
||
{% endif %}
|
||
</a>
|
||
</td>
|
||
<td>
|
||
<a href="{{ edit_url }}">
|
||
{{ booking.recordLabel }} · {% include 'admin/accommodation_booking/_status_label.html.twig' %}
|
||
</a>
|
||
</td>
|
||
<td>
|
||
{% set discounts = [] %}
|
||
{% if booking.accommodationDiscount is not null %}
|
||
{% set discounts = discounts | merge(['Unterkunft ' ~ booking.accommodationDiscount ~ '%']) %}
|
||
{% endif %}
|
||
{% if booking.boardServiceDiscount is not null %}
|
||
{% set discounts = discounts | merge(['Verpflegung ' ~ booking.boardServiceDiscount ~ '%']) %}
|
||
{% endif %}
|
||
{% if booking.additionalServicesDiscount is not null %}
|
||
{% set discounts = discounts | merge(['Zusatzleistungen ' ~ booking.additionalServicesDiscount ~ '%']) %}
|
||
{% endif %}
|
||
{% 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>
|
||
<td class="text-right">
|
||
<twig:dropdown>
|
||
<twig:dropdown:link url="{{ path('app_admin_accommodationbooking_show', { 'id': booking.id, 'r': return_url() }) }}">
|
||
Details
|
||
</twig:dropdown:link>
|
||
<twig:dropdown:link url="{{ edit_url }}">
|
||
bearbeiten
|
||
</twig:dropdown:link>
|
||
{% if booking.confirmed %}
|
||
<twig:dropdown:link url="{{ path('app_admin_accommodationbooking_pdf', { 'id': booking.id }) }}">
|
||
PDF herunterladen
|
||
</twig:dropdown:link>
|
||
{% endif %}
|
||
{# A record that has been in front of the customer gets discarded,
|
||
not removed — see DeleteController. #}
|
||
{% if booking.draft %}
|
||
<twig:dropdown:hxbutton url="{{ path('app_admin_accommodationbooking_delete', { 'id': booking.id, 'r': return_url() }) }}" warning>
|
||
löschen
|
||
</twig:dropdown:hxbutton>
|
||
{% endif %}
|
||
</twig:dropdown>
|
||
</td>
|
||
</tr>
|
||
{% else %}
|
||
<tr>
|
||
<td colspan="9">
|
||
{{ filter.isActive ? 'Keine Treffer für diesen Filter.' : 'Keine Daten...' }}
|
||
</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
{{ knp_pagination_render(pagination) }}
|
||
</div>
|
||
</div>
|
||
<div class="flex justify-end">
|
||
<button type="button"
|
||
hx-get="{{ path('app_admin_accommodationbooking_create') }}"
|
||
hx-target="body"
|
||
hx-swap="beforeend"
|
||
class="button button--primary button--small">
|
||
neu
|
||
</button>
|
||
</div>
|
||
{% endblock %}
|