Meta-fields for InvoiceTemplate, structured Customer address (#5519)

This commit is contained in:
Kevin Papst
2025-11-02 11:24:17 +01:00
committed by GitHub
parent 76821c24ed
commit cc64acf0f8
72 changed files with 2111 additions and 801 deletions

View File

@@ -48,6 +48,10 @@ mpdf-->
<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'] }}
@@ -59,6 +63,12 @@ mpdf-->
<strong>{{ invoice['template.company'] }}</strong>
<br>
{{ invoice['template.address']|trim|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 %}
{% if invoice['template.vat_id'] is not empty %}
<br>
{{ 'vat_id'|trans }}:

View File

@@ -25,6 +25,10 @@
<address contenteditable="true">
<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'] }}
@@ -45,6 +49,12 @@
<address contenteditable="true">
<strong>{{ invoice['template.company'] }}</strong><br>
{{ invoice['template.address']|trim|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 %}
{% if invoice['template.vat_id'] is not empty %}
<br>
{{ 'vat_id'|trans }}:

View File

@@ -14,6 +14,12 @@
<tr>
<td class="text-small">
{{ invoice['template.company'] }} &ndash; {{ 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 %}
&ndash; {{ 'vat_id'|trans }}: {{ invoice['template.vat_id'] }}
{% endif %}
@@ -33,6 +39,12 @@
<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>
@@ -54,6 +66,10 @@ mpdf-->
<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 %}
</td>
<td class="text-right">
{% set classLeft = 'text-left' %}

View File

@@ -18,25 +18,19 @@
</div>
</div>
<div class="row">
<div class="col-md-6">
{{ form_row(form.company) }}
</div>
<div class="col-md-6">
{{ form_row(form.vatId) }}
<div class="col-md-12">
{{ form_row(form.customer) }}
</div>
</div>
<div class="row">
<div class="col-md-6">
{{ form_row(form.address) }}
<div class="col-md-12">
{{ form_row(form.paymentTerms) }}
</div>
</div>
<div class="row">
<div class="col-md-6">
{{ form_row(form.contact) }}
</div>
</div>
<div class="row">
<div class="col-md-6">
{{ form_row(form.paymentTerms) }}
</div>
<div class="col-md-6">
{{ form_row(form.paymentDetails) }}
</div>
@@ -70,6 +64,15 @@
</div>
</div>
</fieldset>
{% if form.metaFields is defined and form.metaFields is not empty %}
<fieldset class="form-fieldset pb-0">
<div class="row">
<div class="col">
{{ form_row(form.metaFields) }}
</div>
</div>
</fieldset>
{% endif %}
{{ form_rest(form) }}
{% endblock %}
{% endembed %}