1
- {% extends ' invoice/layout.html.twig' %}
1
+ <!DOCTYPE html>
2
+ {% set fallback = app .request is not null ? app .request .locale : ' en' %}
3
+ {% set language = model .template .language | default (fallback ) %}
4
+ <html lang =" {{ language }}" >
5
+ <head >
6
+ <meta charset =" utf-8" >
7
+ <style type =" text/css" >
8
+ {{ encore_entry_css_source(' invoice' )| raw }}
9
+ </style >
10
+ </head >
11
+ <body class =" invoice_print" >
12
+ <div class =" wrapper" >
13
+ <section class =" invoice" >
2
14
3
- {% block invoice %}
4
- <div class =" row" >
5
- <div class =" col-xs-12" >
6
- <h2 class =" page-header" >
7
- <span contenteditable =" true" >{{ model .template .title }}</span >
8
- <small class =" pull-right" >{{ ' date' | trans }}: {{ model .invoiceDate | date_short }}</small >
9
- </h2 >
10
- </div >
11
- </div >
15
+ <div class =" row" >
16
+ <div class =" col-xs-12" >
17
+ <h2 class =" page-header" >
18
+ <span contenteditable =" true" >{{ model .template .title }}</span >
19
+ <small class =" pull-right" >{{ ' date' | trans }}: {{ model .invoiceDate | date_short }}</small >
20
+ </h2 >
21
+ </div >
22
+ </div >
12
23
13
- <div class =" row" >
14
- <div class =" col-sm-5" >
15
- {{ ' invoice.from' | trans }}
16
- <address contenteditable =" true" >
17
- <strong >{{ model .template .company }}</strong ><br >
18
- {{ model .template .address | trim | nl2br }}
19
- {% if model .template .vatId is not empty %}
20
- <br >
21
- {{ ' vat_id' | trans }}:
22
- {{ model .template .vatId }}
23
- {% endif %}
24
- </address >
25
- </div >
26
- <div class =" col-sm-2" ></div >
27
- <div class =" col-sm-5" >
28
- {% set customerPhone = model .customer .phone | default (model .customer .mobile ) %}
29
- {{ ' invoice.to' | trans }}
30
- <address contenteditable =" true" >
31
- <strong >{{ model .customer .company | default (model .customer .name ) }}</strong ><br >
32
- {{ model .customer .address | nl2br }}
33
- {% if model .customer .vatId is not empty %}
34
- <br >
35
- {{ ' vat_id' | trans }}: {{ model .customer .vatId }}
36
- {% endif %}
37
- {% if model .customer .number is not empty %}
38
- <br >
39
- {{ ' number' | trans }}: {{ model .customer .number }}
40
- {% endif %}
41
- {% if model .query .project is not empty and model .query .project .orderNumber is not empty %}
42
- <br >
43
- {{ ' orderNumber' | trans }}: {{ model .query .project .orderNumber }}
44
- {% endif %}
45
- </address >
46
- </div >
47
- </div >
24
+ <div class =" row" >
25
+ <div class =" col-sm-5" >
26
+ {{ ' invoice.from' | trans }}
27
+ <address contenteditable =" true" >
28
+ <strong >{{ model .template .company }}</strong ><br >
29
+ {{ model .template .address | trim | nl2br }}
30
+ {% if model .template .vatId is not empty %}
31
+ <br >
32
+ {{ ' vat_id' | trans }}:
33
+ {{ model .template .vatId }}
34
+ {% endif %}
35
+ </address >
36
+ </div >
37
+ <div class =" col-sm-2" ></div >
38
+ <div class =" col-sm-5" >
39
+ {% set customerPhone = model .customer .phone | default (model .customer .mobile ) %}
40
+ {{ ' invoice.to' | trans }}
41
+ <address contenteditable =" true" >
42
+ <strong >{{ model .customer .company | default (model .customer .name ) }}</strong ><br >
43
+ {{ model .customer .address | nl2br }}
44
+ {% if model .customer .vatId is not empty %}
45
+ <br >
46
+ {{ ' vat_id' | trans }}: {{ model .customer .vatId }}
47
+ {% endif %}
48
+ {% if model .customer .number is not empty %}
49
+ <br >
50
+ {{ ' number' | trans }}: {{ model .customer .number }}
51
+ {% endif %}
52
+ {% if model .query .project is not empty and model .query .project .orderNumber is not empty %}
53
+ <br >
54
+ {{ ' orderNumber' | trans }}: {{ model .query .project .orderNumber }}
55
+ {% endif %}
56
+ </address >
57
+ </div >
58
+ </div >
48
59
49
- <div class =" row" >
50
- <div class =" col-sm-5" >
51
- <p contenteditable =" true" >
52
- <strong >{{ ' invoice.number' | trans }}:</strong >
53
- {{ model .invoiceNumber }}
60
+ <div class =" row" >
61
+ <div class =" col-sm-5" >
62
+ <p contenteditable =" true" >
63
+ <strong >{{ ' invoice.number' | trans }}:</strong >
64
+ {{ model .invoiceNumber }}
54
65
55
- <br >
56
- <strong >{{ ' invoice.due_days' | trans }}:</strong >
57
- {{ model .dueDate | date_short }}
58
- </p >
59
- </div >
60
- <div class =" col-sm-7" ></div >
61
- </div >
66
+ <br >
67
+ <strong >{{ ' invoice.due_days' | trans }}:</strong >
68
+ {{ model .dueDate | date_short }}
69
+ </p >
70
+ </div >
71
+ <div class =" col-sm-7" ></div >
72
+ </div >
62
73
63
- <div class =" row invoice-items" >
64
- <div class =" col-xs-12 table-responsive" >
65
- <table class =" table" >
66
- <thead >
67
- <tr >
68
- <th >{{ ' date' | trans }}</th >
69
- <th >{{ ' description' | trans }}</th >
70
- <th class =" text-right" >{{ ' unit_price' | trans }}</th >
71
- <th class =" text-right" >{{ ' amount' | trans }}</th >
72
- <th class =" text-right" >{{ ' total_rate' | trans }}</th >
73
- </tr >
74
- </thead >
75
- <tbody >
76
- {% for entry in model .calculator .entries %}
77
- {% set duration = entry .duration | duration(true ) %}
78
- {% if entry .fixedRate %}
79
- {% set rate = entry .fixedRate %}
80
- {% set duration = entry .amount | amount %}
81
- {% else %}
82
- {% set rate = entry .hourlyRate %}
83
- {% endif %}
84
- <tr >
85
- <td nowrap class =" text-nowrap" >{{ entry .begin | date_short }}</td >
86
- <td contenteditable =" true" >
87
- {% if entry .description is not empty %}
88
- {{ entry .description | nl2br }}
74
+ <div class =" row invoice-items" >
75
+ <div class =" col-xs-12 table-responsive" >
76
+ <table class =" table" >
77
+ <thead >
78
+ <tr >
79
+ <th >{{ ' date' | trans }}</th >
80
+ <th >{{ ' description' | trans }}</th >
81
+ <th class =" text-right" >{{ ' unit_price' | trans }}</th >
82
+ <th class =" text-right" >{{ ' amount' | trans }}</th >
83
+ <th class =" text-right" >{{ ' total_rate' | trans }}</th >
84
+ </tr >
85
+ </thead >
86
+ <tbody >
87
+ {% for entry in model .calculator .entries %}
88
+ {% set duration = entry .duration | duration(true ) %}
89
+ {% if entry .fixedRate %}
90
+ {% set rate = entry .fixedRate %}
91
+ {% set duration = entry .amount | amount %}
89
92
{% else %}
90
- {{ entry . activity . name }} / {{ entry .project . name } }
93
+ {% set rate = entry .hourlyRate % }
91
94
{% endif %}
92
- </td >
93
- <td nowrap class =" text-nowrap text-right" >{{ rate | money(model .calculator .currency ) }}</td >
94
- <td nowrap class =" text-nowrap text-right" >{{ duration }}</td >
95
- <td nowrap class =" text-nowrap text-right" >{{ entry .rate | money(model .calculator .currency ) }}</td >
96
- </tr >
97
- {% endfor %}
98
- </tbody >
99
- <tfoot >
100
- <tr >
101
- <td colspan =" 4" class =" text-right" >
102
- {{ ' invoice.subtotal' | trans }}
103
- </td >
104
- <td class =" text-right" >{{ model .calculator .subtotal | money(model .calculator .currency ) }}</td >
105
- </tr >
106
- <tr >
107
- <td colspan =" 4" class =" text-right" >
108
- {{ ' invoice.tax' | trans }} ({{ model .calculator .vat }}%)
109
- </td >
110
- <td class =" text-right" >{{ model .calculator .tax | money(model .calculator .currency ) }}</td >
111
- </tr >
112
- <tr >
113
- <td colspan =" 4" class =" text-right text-nowrap" >
114
- <strong >{{ ' invoice.total' | trans }}</strong >
115
- </td >
116
- <td class =" text-right" >
117
- <strong >{{ model .calculator .total | money(model .calculator .currency ) }}</strong >
118
- </td >
119
- </tr >
120
- </tfoot >
121
- </table >
122
- </div >
123
- </div >
95
+ <tr >
96
+ <td nowrap class =" text-nowrap" >{{ entry .begin | date_short }}</td >
97
+ <td contenteditable =" true" >
98
+ {% if entry .description is not empty %}
99
+ {{ entry .description | nl2br }}
100
+ {% else %}
101
+ {{ entry .activity .name }} / {{ entry .project .name }}
102
+ {% endif %}
103
+ </td >
104
+ <td nowrap class =" text-nowrap text-right" >{{ rate | money(model .calculator .currency ) }}</td >
105
+ <td nowrap class =" text-nowrap text-right" >{{ duration }}</td >
106
+ <td nowrap class =" text-nowrap text-right" >{{ entry .rate | money(model .calculator .currency ) }}</td >
107
+ </tr >
108
+ {% endfor %}
109
+ </tbody >
110
+ <tfoot >
111
+ <tr >
112
+ <td colspan =" 4" class =" text-right" >
113
+ {{ ' invoice.subtotal' | trans }}
114
+ </td >
115
+ <td class =" text-right" >{{ model .calculator .subtotal | money(model .calculator .currency ) }}</td >
116
+ </tr >
117
+ <tr >
118
+ <td colspan =" 4" class =" text-right" >
119
+ {{ ' invoice.tax' | trans }} ({{ model .calculator .vat }}%)
120
+ </td >
121
+ <td class =" text-right" >{{ model .calculator .tax | money(model .calculator .currency ) }}</td >
122
+ </tr >
123
+ <tr >
124
+ <td colspan =" 4" class =" text-right text-nowrap" >
125
+ <strong >{{ ' invoice.total' | trans }}</strong >
126
+ </td >
127
+ <td class =" text-right" >
128
+ <strong >{{ model .calculator .total | money(model .calculator .currency ) }}</strong >
129
+ </td >
130
+ </tr >
131
+ </tfoot >
132
+ </table >
133
+ </div >
134
+ </div >
124
135
125
- <div class =" row" >
126
- <div class =" col-xs-12" >
127
- {% if model .template .paymentTerms is not empty %}
128
- <div contenteditable =" true" class =" paymentTerms" >
129
- {{ model .template .paymentTerms | nl2br | md2html }}
136
+ <div class =" row" >
137
+ <div class =" col-xs-12" >
138
+ {% if model .template .paymentTerms is not empty %}
139
+ <div contenteditable =" true" class =" paymentTerms" >
140
+ {{ model .template .paymentTerms | nl2br | md2html }}
141
+ </div >
142
+ {% endif %}
143
+ </div >
130
144
</div >
131
- {% endif %}
132
- </div >
133
- </div >
134
145
135
- <footer class =" footer" >
136
- <p >
137
- <strong >{{ ' address' | trans }}</strong >: {{ model .template .company }} – {{ model .template .address | replace ({" \n" : ' – ' , " \r\n" : ' – ' , " \r" : ' – ' })| raw }}
138
- <br >
139
- <strong >{{ ' invoice_bank_account' | trans }}</strong >: {{ model .template .paymentDetails | replace ({" \n" : ' – ' , " \r\n" : ' – ' , " \r" : ' – ' })| raw }}
140
- <br >
141
- <strong >{{ ' contact' | trans }}</strong >: {{ model .template .contact | replace ({" \n" : ' – ' , " \r\n" : ' – ' , " \r" : ' – ' })| raw }}
142
- </p >
143
- </footer >
146
+ <footer class =" footer" >
147
+ <p >
148
+ <strong >{{ ' address' | trans }}</strong >: {{ model .template .company }} – {{ model .template .address | replace ({" \n" : ' – ' , " \r\n" : ' – ' , " \r" : ' – ' })| raw }}
149
+ <br >
150
+ <strong >{{ ' invoice_bank_account' | trans }}</strong >: {{ model .template .paymentDetails | replace ({" \n" : ' – ' , " \r\n" : ' – ' , " \r" : ' – ' })| raw }}
151
+ <br >
152
+ <strong >{{ ' contact' | trans }}</strong >: {{ model .template .contact | replace ({" \n" : ' – ' , " \r\n" : ' – ' , " \r" : ' – ' })| raw }}
153
+ </p >
154
+ </footer >
144
155
145
- {% endblock %}
156
+ </section >
157
+ </div >
158
+ </body >
159
+ </html >
0 commit comments