-
Notifications
You must be signed in to change notification settings - Fork 973
/
letter_header.html.twig
109 lines (102 loc) · 5.09 KB
/
letter_header.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
{#
Notice for plugins and theme developer: Do not extend this template!
This template will be rendered over the `block` function.
Templates which are rendered over the `block` function can not be extended.
Instead of extending this template, simply extend the `base.html.twig` (or the document specific template) and override the block you want.
All blocks of this template are available in the template which renders this template over the `block` function.
#}
{% block letter_header %}
<div class="letter-header">
<div class="recipient-address-container">
{% block document_recipient %}
{% if config.displayCompanyAddress and config.companyAddress is not empty %}
{{ config.companyAddress }}<br><br>
{% endif %}
{% sw_include '@Framework/snippets/render.html.twig' with {
format: billingAddress.country.translated.addressFormat,
address: billingAddress
} %}<br/>
{% if (customer.customer.vatIds|first and config.displayCustomerVatId) or (customer.customer.vatIds|first and billingAddress.country.companyTax.enabled and config.displayAdditionalNoteDelivery and billingAddress.country.id in config.deliveryCountries) %}
{{ 'document.vatId'|trans({'%vatId%': customer.customer.vatIds|first})|sw_sanitize }}<br>
{% endif %}
{% endblock %}
</div>
<div class="sender-address-container">
{% block document_sender_address %}
<table>
{% if config.companyName %}
{% block document_side_company_name %}
<tr>
<td class="bold">{{ config.companyName }}</td>
</tr>
{% endblock %}
{% endif %}
<tr>
<td>
{% if config.displayCompanyAddress and config.companyAddress is not empty %}
{{ config.companyAddress|replace({' - ': '</td></tr><tr><td>'})|raw }}
{% endif %}
</td>
</tr>
{% if config.companyPhone %}
{% block document_side_info_phone_number %}
<tr>
<td>
{{'document.phoneNumber'|trans({'%phoneNumber%': config.companyPhone })|sw_sanitize }}
</td>
</tr>
{% endblock %}
{% endif %}
{% if config.companyEmail %}
{% block document_side_info_email %}
<tr>
<td>{{ config.companyEmail }}</td>
</tr>
{% endblock %}
{% endif %}
{% if config.companyUrl %}
{% block document_side_company_url %}
<tr>
<td>{{ config.companyUrl }}</td>
</tr>
{% endblock %}
{% endif %}
</table><br>
{% endblock %}
{% block document_side_info %}
<table>
{% block document_side_info_contents %}
{% block document_side_info_customer_number %}
<tr>
<td>
{{ 'document.customerNumber'|trans({'%customerNumber%': customer.customerNumber})|sw_sanitize }}
</td>
</tr>
{% endblock %}
{% block document_side_info_order_number %}
<tr>
<td>
{{ 'document.orderNumber'|trans({'%orderNumber%': order.orderNumber })|sw_sanitize }}
</td>
</tr>
{% endblock %}
{% block document_side_info_order_date %}
<tr>
<td>
{{ 'document.orderDate'|trans({'%orderDate%': order.orderDateTime|format_date('medium', locale=locale)})|sw_sanitize }}
</td>
</tr>
{% endblock %}
{% block document_side_info_date %}
<tr>
<td>
{{ 'document.date'|trans({'%date%': config.documentDate|format_date('medium', locale=locale)})|sw_sanitize }}
</td>
</tr>
{% endblock %}
{% endblock %}
</table>
{% endblock %}
</div>
</div>
{% endblock %}