forked from PrestaShop/PrestaShop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinvoice.tpl
377 lines (346 loc) · 14.3 KB
/
invoice.tpl
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
{*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div style="font-size: 8pt; color: #444">
<table>
<tr><td> </td></tr>
</table>
<!-- ADDRESSES -->
<table style="width: 100%">
<tr>
<td style="width: 15%"></td>
<td style="width: 85%">
{if !empty($delivery_address)}
<table style="width: 100%">
<tr>
<td style="width: 50%">
<span style="font-weight: bold; font-size: 10pt; color: #9E9F9E">{l s='Delivery Address' pdf='true'}</span><br />
{$delivery_address}
</td>
<td style="width: 50%">
<span style="font-weight: bold; font-size: 10pt; color: #9E9F9E">{l s='Billing Address' pdf='true'}</span><br />
{$invoice_address}
</td>
</tr>
</table>
{else}
<table style="width: 100%">
<tr>
<td style="width: 50%">
<span style="font-weight: bold; font-size: 10pt; color: #9E9F9E">{l s='Billing & Delivery Address.' pdf='true'}</span><br />
{$invoice_address}
</td>
<td style="width: 50%">
</td>
</tr>
</table>
{/if}
</td>
</tr>
</table>
<!-- / ADDRESSES -->
<div style="line-height: 1pt"> </div>
<!-- PRODUCTS TAB -->
<table style="width: 100%">
<tr>
<td style="width: 15%; padding-right: 7px; text-align: left; vertical-align: top; font-size: 7pt;">
<!-- CUSTOMER INFORMATION -->
<b>{l s='Order Number:' pdf='true'}</b><br />
{$order->getUniqReference()}<br />
<br />
<b>{l s='Order Date:' pdf='true'}</b><br />
{dateFormat date=$order->date_add full=0}<br />
<br />
<b>{l s='Payment Method:' pdf='true'}</b><br />
<table style="width: 100%;">
{foreach from=$order_invoice->getOrderPaymentCollection() item=payment}
<tr>
<td>
<strong style="font-style: italic">{$payment->payment_method}</strong><br>
{displayPrice price=$payment->amount currency=$order->id_currency}
</td>
</tr>
{foreachelse}
<tr>
<td>{l s='No payment' pdf='true'}</td>
</tr>
{/foreach}
</table>
<br />
{if isset($carrier)}
<b>{l s='Carrier:' pdf='true'}</b><br />
{$carrier->name}<br />
<br />
{/if}
<!-- / CUSTOMER INFORMATION -->
</td>
<td style="width: 85%; text-align: left">
<table style="width: 100%; font-size: 8pt;">
<tr style="line-height:5px;">
{if $display_product_images}
<td style="width: {$layout.image.width}%; text-align: center; background-color: #4D4D4D; color: #FFF; padding-left: 10px; font-weight: bold;">{l s='Image' pdf='true'}</td>
{/if}
<td style="width: {$layout.reference.width}%; text-align: left; background-color: #4D4D4D; color: #FFF; padding-left: 10px; font-weight: bold;">{l s='Product / Reference' pdf='true'}</td>
<td style="width: {$layout.unit_price_tax_excl.width}%; background-color: #4D4D4D; color: #FFF; text-align: right; font-weight: bold;">{l s='Unit Price <br> (Tax Excl.)' pdf='true'}</td>
{if !$tax_excluded_display}
<td style="width: {$layout.unit_price_tax_incl.width}%; background-color: #4D4D4D; color: #FFF; text-align: right; font-weight: bold;">
{l s='Unit Price <br> (Tax Incl.)' pdf='true'}
</td>
{/if}
<td style="width: {$layout.discount.width}%; background-color: #4D4D4D; color: #FFF; text-align: center; font-weight: bold; white-space: nowrap;">{l s='Discount' pdf='true'}</td>
<td style="width: {$layout.quantity.width}%; background-color: #4D4D4D; color: #FFF; text-align: center; font-weight: bold;">{l s='Qty' pdf='true'}</td>
<td style="width: {$layout.total.width}%; background-color: #4D4D4D; color: #FFF; text-align: right; font-weight: bold;">
{if $tax_excluded_display}
{l s='Total <br> (Tax Excl.)' pdf='true'}
{else}
{l s='Total <br> (Tax Incl.)' pdf='true'}
{/if}
</td>
</tr>
<!-- PRODUCTS -->
{foreach $order_details as $order_detail}
{cycle values='#FFF,#DDD' assign=bgcolor}
<tr style="line-height:5px;background-color:{$bgcolor};">
{if $display_product_images}
<td style="text-align: center;">
<div style="height:5px; overflow:hidden;"> </div>
{if isset($order_detail.image) && $order_detail.image->id}
{$order_detail.image_tag}
{/if}
</td>
{/if}
<td style="text-align: left;">
{$order_detail.product_name}
{if isset($order_detail.product_reference) && !empty($order_detail.product_reference)}
<br>
{$order_detail.product_reference|string_format:{l s='(Reference: %s)' pdf='true'}}
{/if}
</td>
<!-- unit price tax excluded is mandatory -->
<td style="text-align: right; white-space: nowrap;">
{displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl_including_ecotax}
{if $order_detail.ecotax_tax_excl > 0}
<br>
<small>{{displayPrice currency=$order->id_currency price=$order_detail.ecotax_tax_excl}|string_format:{l s='ecotax: %s' pdf='true'}}</small>
{/if}
</td>
{if !$tax_excluded_display}
<td style="text-align: right;">
{displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_incl_including_ecotax}
{if $order_detail.ecotax_tax_incl > 0}
<br>
<small>{{displayPrice currency=$order->id_currency price=$order_detail.ecotax_tax_incl}|string_format:{l s='ecotax: %s' pdf='true'}}</small>
{/if}
</td>
{/if}
<td style="text-align: center;">
{if (isset($order_detail.reduction_amount) && $order_detail.reduction_amount > 0)}
-{displayPrice currency=$order->id_currency price=$order_detail.reduction_amount}
{elseif (isset($order_detail.reduction_percent) && $order_detail.reduction_percent > 0)}
-{$order_detail.reduction_percent}%
{else}
--
{/if}
</td>
<td style="text-align: center;">{$order_detail.product_quantity}</td>
<td style="text-align: right; white-space: nowrap;">
{if $tax_excluded_display}
{displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_excl_including_ecotax}
{else}
{displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_incl_including_ecotax}
{/if}
</td>
</tr>
{foreach $order_detail.customizedDatas as $customizationPerAddress}
{foreach $customizationPerAddress as $customizationId => $customization}
<tr>
<td style="line-height: 1px;" colspan="{$layout._colCount}"></td>
</tr>
<tr style="font-size: 0.9em">
<td style="border: 1px solid #eee;" colspan="{$layout._colCount - 2}">
{if isset($customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_]) && count($customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_]) > 0}
<table style="width: 100%;">
{foreach $customization.datas[$smarty.const._CUSTOMIZE_TEXTFIELD_] as $customization_infos}
<tr>
<td style="font-style: italic; text-align: right;">
{$customization_infos.name|string_format:{l s='%s:' pdf='true'}}
</td>
<td style="text-align: justify;">{$customization_infos.value}</td>
</tr>
{/foreach}
</table>
{/if}
{if isset($customization.datas[$smarty.const._CUSTOMIZE_FILE_]) && count($customization.datas[$smarty.const._CUSTOMIZE_FILE_]) > 0}
<table style="width: 100%;">
<tr>
<td style="font-style: italic; text-align: right;">{l s='image(s):' pdf='true'}</td>
<td>{count($customization.datas[$smarty.const._CUSTOMIZE_FILE_])}</td>
</tr>
</table>
{/if}
</td>
<td style="text-align: center;">({if $customization.quantity == 0}1{else}{$customization.quantity}{/if})</td><!-- quantity -->
<td></td><!-- total -->
</tr>
<tr>
<td style="line-height: 1px;" colspan="{6 - $tax_excluded_display + Configuration::get('PS_PDF_IMG_INVOICE')}"></td>
</tr>
<!--if !$smarty.foreach.custo_foreach.last-->
{/foreach}
{/foreach}
{/foreach}
<!-- END PRODUCTS -->
<!-- CART RULES -->
{assign var="shipping_discount_tax_incl" value="0"}
{foreach from=$cart_rules item=cart_rule name="cart_rules_loop"}
{cycle values='#FFF,#DDD' assign=bgcolor}
{if $smarty.foreach.cart_rules_loop.first}
<tr>
<td style="text-align:left; font-style: italic;" colspan="{$layout._colCount}">
<br><br>
{l s='Discounts' pdf='true'}
</td>
</tr>
{/if}
<tr style="line-height:6px;background-color:{$bgcolor};text-align:left;">
<td style="text-align:left;vertical-align:top" colspan="{$layout._colCount - 1}">
{$cart_rule.name}
</td>
<td style="text-align:right;vertical-align:top">
{if $tax_excluded_display}
- {displayPrice currency=$order->id_currency price=$cart_rule.value_tax_excl}
{else}
- {displayPrice currency=$order->id_currency price=$cart_rule.value}
{/if}
</td>
</tr>
{/foreach}
<tr>
<td style="line-height: 2px;" colspan="{$layout._colCount}"></td>
</tr>
<!-- END CART RULES -->
</table>
<br>
{if $tax_excluded_display}
<table style="width: 100%; text-align: right;">
<tr style="line-height:5px;">
<td style="width: 83%; font-weight: bold">{l s='Product Total (Tax Excl.)' pdf='true'}</td>
<td style="width: 17%;">{displayPrice currency=$order->id_currency price=$footer.products_before_discounts_tax_excl}</td>
</tr>
{if $footer.product_discounts_tax_excl > 0}
<tr style="line-height:5px;">
<td style="text-align: right; font-weight: bold">{l s='Total Discounts (Tax Excl.)' pdf='true'}</td>
<td style="width: 17%;">-{displayPrice currency=$order->id_currency price=$footer.product_discounts_tax_excl}</td>
</tr>
{/if}
<tr style="line-height:5px;">
<td style="text-align: right; font-weight: bold">{l s='Shipping Cost (Tax Excl.)' pdf='true'}</td>
<td style="width: 17%;">
{if $footer.shipping_tax_excl > 0}
{displayPrice currency=$order->id_currency price=$footer.shipping_tax_excl}
{else}
{l s='Free Shipping' pdf=true}
{/if}
</td>
</tr>
{if $footer.wrapping_tax_excl > 0}
<tr style="line-height:5px;">
<td style="text-align: right; font-weight: bold">{l s='Wrapping Cost (Tax Excl.)' pdf='true'}</td>
<td style="width: 17%;">{displayPrice currency=$order->id_currency price=$footer.wrapping_tax_excl}</td>
</tr>
{/if}
{if $footer.total_taxes > 0}
<tr style="line-height:5px;">
<td style="text-align: right; font-weight: bold">{l s='Total (Tax Excl.)' pdf='true'}</td>
<td style="width: 17%;">{displayPrice currency=$order->id_currency price=$footer.total_paid_tax_excl}</td>
</tr>
<tr style="line-height:5px;">
<td style="text-align: right; font-weight: bold">{l s='Total Taxes' pdf='true'}</td>
<td style="width: 17%;">{displayPrice currency=$order->id_currency price=$footer.total_taxes}</td>
</tr>
{/if}
<tr style="line-height:5px;">
<td style="text-align: right; font-weight: bold">{l s='Total (Tax Incl.)' pdf='true'}</td>
<td style="width: 17%;">{displayPrice currency=$order->id_currency price=$footer.total_paid_tax_incl}</td>
</tr>
</table>
{else}
<table style="width: 100%; text-align: right;">
<tr style="line-height:5px;">
<td style="width: 83%; font-weight: bold">{l s='Product Total (Tax Incl.)' pdf='true'}</td>
<td style="width: 17%;">{displayPrice currency=$order->id_currency price=$footer.products_before_discounts_tax_incl}</td>
</tr>
{if $footer.product_discounts_tax_incl > 0}
<tr style="line-height:5px;">
<td style="text-align: right; font-weight: bold">{l s='Total Discounts (Tax Incl.)' pdf='true'}</td>
<td style="width: 17%;">-{displayPrice currency=$order->id_currency price=$footer.product_discounts_tax_incl}</td>
</tr>
{/if}
<tr style="line-height:5px;">
<td style="text-align: right; font-weight: bold">{l s='Shipping Cost (Tax Incl.)' pdf='true'}</td>
<td style="width: 17%;">
{if $footer.shipping_tax_excl > 0}
{displayPrice currency=$order->id_currency price=$footer.shipping_tax_incl}
{else}
{l s='Free Shipping' pdf=true}
{/if}
</td>
</tr>
{if $footer.wrapping_tax_incl > 0}
<tr style="line-height:5px;">
<td style="text-align: right; font-weight: bold">{l s='Wrapping Cost (Tax Incl.)' pdf='true'}</td>
<td style="width: 17%;">{displayPrice currency=$order->id_currency price=$footer.wrapping_tax_incl}</td>
</tr>
{/if}
<tr style="line-height:5px;">
<td style="text-align: right; font-weight: bold">{l s='Total' pdf='true'}</td>
<td style="width: 17%;">{displayPrice currency=$order->id_currency price=$footer.total_paid_tax_incl}</td>
</tr>
</table>
{/if}
</td>
</tr>
</table>
<!-- / PRODUCTS TAB -->
<div style="line-height: 1pt"> </div>
{$tax_tab}
{if isset($order_invoice->note) && $order_invoice->note}
<div style="line-height: 1pt"> </div>
<table style="width: 100%">
<tr>
<td style="width: 17%"></td>
<td style="width: 83%">{$order_invoice->note|nl2br}</td>
</tr>
</table>
{/if}
{if isset($HOOK_DISPLAY_PDF)}
<div style="line-height: 1pt"> </div>
<table style="width: 100%">
<tr>
<td style="width: 17%"></td>
<td style="width: 83%">{$HOOK_DISPLAY_PDF}</td>
</tr>
</table>
{/if}
</div>