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

@@ -38,10 +38,31 @@
</td>
</tr>
{% endif %}
{% if customer.addressLine1 is not empty %}
<tr>
<th>{{ 'address'|trans }}</th>
<td>
{{ customer.addressLine1 }}<br>
{% if customer.addressLine2 is not empty %}
{{ customer.addressLine2 }}<br>
{% endif %}
{% if customer.addressLine3 is not empty %}
{{ customer.addressLine3 }}<br>
{% endif %}
{{ customer.postCode }} {{ customer.city }}
</td>
</tr>
{% endif %}
{% if customer.address is not empty %}
<tr>
<th>{{ 'address'|trans }}</th>
<td>{{ customer.address|nl2br }}</td>
<td>
{{ widgets.alert('info', 'address_deprecated'|trans) }}
<br>
<i>
{{ customer.address|nl2br }}
</i>
</td>
</tr>
{% endif %}
{% if customer.country is not empty %}

View File

@@ -18,28 +18,16 @@
</div>
</div>
{{ form_row(form.comment) }}
{{ form_row(form.address) }}
<div class="row">
<div class="col-md-4">
{{ form_row(form.company) }}
</div>
<div class="col-md-4">
{{ form_row(form.number) }}
</div>
<div class="col-md-4">
{{ form_row(form.vatId) }}
</div>
</div>
<div class="row">
<div class="col-md-4">
{{ form_row(form.country) }}
</div>
<div class="col-md-4">
{{ form_row(form.currency) }}
</div>
<div class="col-md-4">
{{ form_row(form.timezone) }}
</div>
</div>
<div class="row">
<div class="col-md-4">
@@ -87,21 +75,66 @@
</div>
</div>
{% endif %}
<div class="row">
<div class="col-md-6">
{{ form_row(form.visible) }}
</div>
<div class="col-md-6">
{{ form_row(form.billable) }}
</div>
</div>
{% if form.metaFields is defined and form.metaFields is not empty %}
{{ form_row(form.metaFields) }}
{% endif %}
{% embed '@theme/embeds/collapsible.html.twig' with {id: 'customer_address_settings'} %}
{% import "macros/widgets.html.twig" as widgets %}
{% block title %}{{ 'address'|trans }}{% endblock %}
{% block body %}
<div class="row">
<div class="col-12">
{{ form_row(form.company) }}
</div>
</div>
{% if form.address is defined %}
<div class="row">
<div class="col-12">
{{ form_row(form.address) }}
</div>
</div>
{% endif %}
<div class="row">
<div class="col-12">
{{ form_row(form.address_line1, {attr: {placeholder: 'address_row'|trans({'%row%': 1})}}) }}
</div>
</div>
<div class="row">
<div class="col-12">
{{ form_row(form.address_line2, {attr: {placeholder: 'address_row'|trans({'%row%': 2})}}) }}
</div>
</div>
<div class="row">
<div class="col-12">
{{ form_row(form.address_line3, {attr: {placeholder: 'address_row'|trans({'%row%': 3})}}) }}
</div>
</div>
<div class="row">
<div class="col-md-3">
{{ form_row(form.postcode) }}
</div>
<div class="col-md-9">
{{ form_row(form.city) }}
</div>
</div>
<div class="row">
<div class="col-md-6">
{{ form_row(form.country) }}
</div>
<div class="col-md-6">
{{ form_row(form.timezone) }}
</div>
</div>
{% endblock %}
{% endembed %}
{% embed '@theme/embeds/collapsible.html.twig' with {id: 'customer_invoice_settings'} %}
{% import "macros/widgets.html.twig" as widgets %}
{% block title %}{{ 'invoices'|trans }}{% endblock %}
{% block body %}
{% if form.buyerReference is defined %}
{{ form_row(form.buyerReference) }}
{% endif %}
{% if form.invoiceTemplate is defined %}
{{ form_row(form.invoiceTemplate) }}
{% endif %}
@@ -110,6 +143,14 @@
{% endif %}
{% endblock %}
{% endembed %}
<div class="row">
<div class="col-md-6">
{{ form_row(form.visible) }}
</div>
<div class="col-md-6">
{{ form_row(form.billable) }}
</div>
</div>
{{ form_rest(form) }}
{% endblock %}
{% endembed %}

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 %}

View File

@@ -26,14 +26,6 @@
{{ form_row(form.number) }}
</div>
</div>
<div class="row">
<div class="col-md-6">
{{ form_row(form.orderNumber) }}
</div>
<div class="col-md-6">
{{ form_row(form.orderDate) }}
</div>
</div>
<div class="row">
<div class="col-md-6">
{{ form_row(form.start) }}
@@ -66,6 +58,26 @@
</div>
</div>
{% endif %}
{% if form.metaFields is defined and form.metaFields is not empty %}
{{ form_row(form.metaFields) }}
{% endif %}
{% embed '@theme/embeds/collapsible.html.twig' with {id: 'project_invoice_settings'} %}
{% import "macros/widgets.html.twig" as widgets %}
{% block title %}{{ 'invoices'|trans }}{% endblock %}
{% block body %}
<div class="row">
<div class="col-md-6">
{{ form_row(form.orderNumber) }}
</div>
<div class="col-md-6">
{{ form_row(form.orderDate) }}
</div>
</div>
{% if form.invoiceText is defined %}
{{ form_row(form.invoiceText) }}
{% endif %}
{% endblock %}
{% endembed %}
<div class="row">
<div class="col-md-4">
{{ form_row(form.visible) }}
@@ -77,18 +89,6 @@
{{ form_row(form.globalActivities) }}
</div>
</div>
{% if form.metaFields is defined and form.metaFields is not empty %}
{{ form_row(form.metaFields) }}
{% endif %}
{% embed '@theme/embeds/collapsible.html.twig' with {id: 'project_invoice_settings'} %}
{% import "macros/widgets.html.twig" as widgets %}
{% block title %}{{ 'invoices'|trans }}{% endblock %}
{% block body %}
{% if form.invoiceText is defined %}
{{ form_row(form.invoiceText) }}
{% endif %}
{% endblock %}
{% endembed %}
{{ form_rest(form) }}
{% endblock %}
{% endembed %}