204 lines
8.8 KiB
Twig
204 lines
8.8 KiB
Twig
<!DOCTYPE html>
|
||
<html lang="{{ invoice['invoice.language'] }}">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title>{{ invoice['invoice.number'] }}-{{ invoice['customer.company']|default(invoice['customer.name'])|u.snake }}</title>
|
||
<style>
|
||
{{ encore_entry_css_source('invoice-pdf')|raw }}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<!--mpdf
|
||
<htmlpageheader name="header">
|
||
<table class="header">
|
||
<tr>
|
||
<td class="text-small">
|
||
{{ invoice['template.company'] }} – {{ invoice['template.address']|nl2str(' – ') }}
|
||
{% if invoice['template.country'] is not null %}
|
||
{% set country = invoice['template.country']|country_name(invoice['invoice.language']) %}
|
||
{% if country not in invoice['template.address'] %}
|
||
– {{ country }}
|
||
{% endif %}
|
||
{% endif %}
|
||
{% if invoice['template.vat_id'] is not empty %}
|
||
– {{ 'vat_id'|trans }}: {{ invoice['template.vat_id'] }}
|
||
{% endif %}
|
||
</td>
|
||
<td class="text-small text-right">
|
||
{{ 'export.page_of'|trans({'%page%': '{PAGENO}', '%pages%': '{nb}'}) }}
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</htmlpageheader>
|
||
<sethtmlpageheader name="header" page="ALL" value="on" show-this-page="1" />
|
||
<htmlpagefooter name="footer">
|
||
<table class="footer text-small">
|
||
<tr>
|
||
<td style="width: 33%">
|
||
<strong>{{ 'address'|trans }}</strong>
|
||
<br>
|
||
{{ invoice['template.company'] }}<br>
|
||
{{ invoice['template.address']|nl2br }}
|
||
{% if invoice['template.country'] is not null %}
|
||
{% set country = invoice['template.country']|country_name(invoice['invoice.language']) %}
|
||
{% if country not in invoice['template.address'] %}
|
||
<br> {{ country }}
|
||
{% endif %}
|
||
{% endif %}
|
||
</td>
|
||
<td class="text-center">
|
||
<strong>{{ 'invoice_bank_account'|trans }}</strong>
|
||
<br>
|
||
{{ invoice['template.payment_details']|nl2br }}
|
||
</td>
|
||
<td class="text-right" style="width: 33%">
|
||
<strong>{{ 'contact'|trans }}</strong>
|
||
<br>
|
||
{{ invoice['template.contact']|nl2br }}
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</htmlpagefooter>
|
||
<sethtmlpagefooter page="ALL" value="on" name="footer" show-this-page="1" />
|
||
mpdf-->
|
||
<table class="addresses">
|
||
<tr>
|
||
<td>
|
||
<strong>{{ invoice['customer.company']|default(invoice['customer.name']) }}</strong><br>
|
||
{{ invoice['customer.address']|nl2br }}
|
||
{% set country = invoice['customer.country']|country_name(invoice['invoice.language']) %}
|
||
{% if country not in invoice['customer.address'] %}
|
||
<br> {{ country }}
|
||
{% endif %}
|
||
{% if invoice['customer.vat_id'] is not empty %}
|
||
<br>{{ 'vat_id'|trans }}: {{ invoice['customer.vat_id'] }}
|
||
{% endif %}
|
||
</td>
|
||
<td class="text-right">
|
||
{% set classLeft = 'text-left' %}
|
||
{% set classRight = 'text-right text-nowrap padding-left' %}
|
||
<table style="width: 270px">
|
||
<tr>
|
||
<td class="{{ classLeft }}">{{ 'date'|trans }}</td>
|
||
<td class="{{ classRight }}">{{ invoice['invoice.date'] }}</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="{{ classLeft }}">{{ 'invoice.service_date'|trans }}</td>
|
||
<td class="{{ classRight }}">
|
||
{% if invoice['invoice.first_month'] != invoice['invoice.last_month'] or invoice['invoice.first_year'] != invoice['invoice.last_year'] %}
|
||
{{ invoice['invoice.first_month'] }} {{ invoice['invoice.first_year'] }}
|
||
–
|
||
{% endif %}
|
||
{{ invoice['invoice.last_month'] }} {{ invoice['invoice.last_year'] }}
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="{{ classLeft }}">{{ 'invoice.number'|trans }}</td>
|
||
<td class="{{ classRight }}">{{ invoice['invoice.number'] }}</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="{{ classLeft }}">{{ 'invoice.due_days'|trans }}</td>
|
||
<td class="{{ classRight }}">{{ invoice['invoice.due_date'] }}</td>
|
||
</tr>
|
||
{% if invoice['customer.number'] is not empty %}
|
||
<tr>
|
||
<td class="{{ classLeft }}">{{ 'number'|trans }}</td>
|
||
<td class="{{ classRight }}">{{ invoice['customer.number'] }}</td>
|
||
</tr>
|
||
{% endif %}
|
||
{% if invoice['project.counter'] == 1 and invoice['project.order_number'] is not empty %}
|
||
<tr>
|
||
<td class="{{ classLeft }}">{{ 'orderNumber'|trans }}</td>
|
||
<td class="{{ classRight }}">{{ invoice['project.order_number'] }}</td>
|
||
</tr>
|
||
{% endif %}
|
||
</table>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
|
||
<h2 style="margin-top: 60px; margin-bottom: 20px;">{{ invoice['template.title'] }}</h2>
|
||
|
||
{% if invoice['customer.invoice_text'] is not empty%}
|
||
{{ invoice['customer.invoice_text']|md2html }}
|
||
{% endif %}
|
||
|
||
{% if invoice['project.counter'] == 1 and invoice['project.invoice_text'] is not empty %}
|
||
{{ invoice['project.invoice_text']|md2html }}
|
||
{% endif %}
|
||
|
||
<table class="items">
|
||
<thead>
|
||
<tr>
|
||
<th class="first">{{ 'description'|trans }}</th>
|
||
<th class="text-right">{{ 'unit_price'|trans }}</th>
|
||
<th class="text-right">{{ 'amount'|trans }}</th>
|
||
<th class="last text-right">{{ 'total_rate'|trans }}</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for invoiceLineItem in entries %}
|
||
<!-- CONTENT_PART -->
|
||
<tr>
|
||
<td class="first">
|
||
{% if invoiceLineItem['entry.description'] is not empty %}
|
||
{{ invoiceLineItem['entry.description']|nl2br }}
|
||
{% else %}
|
||
{% if invoiceLineItem['entry.activity'] is defined %}
|
||
{{ invoiceLineItem['entry.activity'] }} /
|
||
{% endif %}
|
||
{{ invoiceLineItem['entry.project'] }}
|
||
{% endif %}
|
||
</td>
|
||
<td class="text-right text-nowrap">{{ invoiceLineItem['entry.rate'] }}</td>
|
||
<td class="text-right text-nowrap">{{ invoiceLineItem['entry.amount'] }}</td>
|
||
<td class="last text-right text-nowrap">{{ invoiceLineItem['entry.total'] }}</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
<tfoot>
|
||
<tr>
|
||
<td colspan="3" class="text-right">
|
||
{{ 'invoice.subtotal'|trans }}
|
||
</td>
|
||
<td class="last text-right">{{ invoice['invoice.subtotal'] }}</td>
|
||
</tr>
|
||
{% for taxRow in invoice['invoice.tax_rows'] %}
|
||
{% if taxRow['show'] %}
|
||
<tr>
|
||
<td colspan="3" class="text-right">
|
||
{{ taxRow['name']|trans }} ({{ taxRow['rate'] }}%)
|
||
{% if taxRow['note'] is not null %}
|
||
<sup>[{{ taxRow['counter'] }}]</sup>
|
||
{% endif %}
|
||
</td>
|
||
<td class="last text-right">{{ taxRow['amount']|money(taxRow['currency']) }}</td>
|
||
</tr>
|
||
{% endif %}
|
||
{% endfor %}
|
||
<tr>
|
||
<td colspan="3" class="text-right text-nowrap">
|
||
<strong>{{ 'invoice.total'|trans }}</strong>
|
||
</td>
|
||
<td class="last text-right">
|
||
<strong>{{ invoice['invoice.total'] }}</strong>
|
||
</td>
|
||
</tr>
|
||
</tfoot>
|
||
</table>
|
||
|
||
{% for taxRow in invoice['invoice.tax_rows'] %}
|
||
{% if taxRow['note'] is not null %}
|
||
<p>
|
||
<sup>[{{ taxRow['counter'] }}]</sup>
|
||
{{ taxRow['note']|trans }}
|
||
</p>
|
||
{% endif %}
|
||
{% endfor %}
|
||
|
||
{% if invoice['template.payment_terms'] is not empty %}
|
||
{{ invoice['template.payment_terms']|md2html }}
|
||
{% endif %}
|
||
</body>
|
||
</html>
|