mirror of
https://github.com/kevinpapst/kimai2.git
synced 2025-05-15 22:10:32 +00:00
76 lines
4.3 KiB
Twig
76 lines
4.3 KiB
Twig
{% extends 'base.html.twig' %}
|
|
{% import "macros/widgets.html.twig" as widgets %}
|
|
{% import "macros/toolbar.html.twig" as toolbar %}
|
|
{% import "macros/datatables.html.twig" as tables %}
|
|
{% import "invoice/actions.html.twig" as actions %}
|
|
{% import "invoice/macros.html.twig" as macros %}
|
|
|
|
{% set columns = {
|
|
'date': {'class': 'alwaysVisible', 'orderBy': false},
|
|
'user': {'class': 'hidden-xs hidden-sm text-nowrap hidden', 'orderBy': false},
|
|
'customer': {'class': 'hidden-xs hidden-sm text-nowrap', 'orderBy': false},
|
|
'invoice_number': {'class': 'hidden-xs hidden-sm w-min', 'title': 'invoice.number'|trans, 'orderBy': false},
|
|
'due_date': {'class': 'hidden-xs w-min', 'title': 'invoice.due_days'|trans, 'orderBy': false},
|
|
'payment_date': {'class': 'hidden-xs hidden w-min', 'title': 'invoice.payment_date'|trans, 'orderBy': false},
|
|
'status': {'class': 'alwaysVisible w-min', 'orderBy': false},
|
|
'subtotal': {'class': 'hidden-xs text-right w-min hidden', 'title': 'invoice.subtotal'|trans, 'orderBy': false},
|
|
'tax': {'class': 'hidden-xs text-right w-min hidden', 'title': 'invoice.tax'|trans, 'orderBy': false},
|
|
'total_rate': {'class': 'hidden-xs text-right w-min', 'orderBy': false},
|
|
'actions': {'class': 'actions alwaysVisible', 'orderBy': false},
|
|
} %}
|
|
|
|
{% set tableName = 'invoices' %}
|
|
|
|
{% block page_title %}{{ 'invoice.title'|trans }}{% endblock %}
|
|
{% block page_actions %}{{ actions.invoice_listing('index') }}{% endblock %}
|
|
{% block page_search %}{{ toolbar.dropDownSearch(toolbarForm) }}{% endblock %}
|
|
|
|
{% block main_before %}
|
|
{{ tables.data_table_column_modal(tableName, columns) }}
|
|
{% endblock %}
|
|
|
|
{% block main %}
|
|
|
|
{% if entries is empty %}
|
|
{{ widgets.nothing_found() }}
|
|
{% else %}
|
|
{{ tables.datatable_header(tableName, columns, query, {}) }}
|
|
{% for entry in entries %}
|
|
<tr class="alternative-link open-edit" data-href="{{ path('admin_invoice_download', {'id': entry.id}) }}">
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'date') }}">{{ entry.createdAt|date_short }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'user') }}">{{ widgets.user_avatar(entry.user) }} {{ widgets.username(entry.user) }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'customer') }}">{{ widgets.label_customer(entry.customer) }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'invoice_number') }}">{{ widgets.label(entry.invoiceNumber, 'default') }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'due_date') }}">{{ macros.invoice_due_date(entry) }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'payment_date') }}">
|
|
{% if entry.paymentDate and entry.paid %}
|
|
{{ widgets.label(entry.paymentDate|date_short, 'primary') }}
|
|
{% endif %}
|
|
</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'status') }}">{{ macros.invoice_status(entry) }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'subtotal') }}">{{ entry.subtotal|money(entry.currency) }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'tax') }}">{{ entry.tax|money(entry.currency) }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'total_rate') }}">{{ entry.total|money(entry.currency) }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'actions') }}">{{ actions.invoice(entry, 'index') }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
{{ tables.data_table_footer(entries, 'admin_invoice_list') }}
|
|
{% endif %}
|
|
|
|
{% endblock %}
|
|
|
|
{% block javascripts %}
|
|
{{ parent() }}
|
|
{% if download is not null %}
|
|
<script type="text/javascript">
|
|
document.addEventListener('kimai.initialized', function() {
|
|
location.href = '{{ path('admin_invoice_download', {'id': download.id}) }}';
|
|
});
|
|
</script>
|
|
{% endif %}
|
|
<script type="text/javascript">
|
|
document.addEventListener('kimai.initialized', function() {
|
|
KimaiReloadPageWidget.create('kimai.invoiceUpdate');
|
|
});
|
|
</script>
|
|
{% endblock %}
|