/
SaleReceipt_nl_NL.tpl
1608 lines (1431 loc) · 52 KB
/
SaleReceipt_nl_NL.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
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{#
***Begin Custom Options***
Toggle any of the options in this section between 'false' and 'true' in order to enable/disable them in the template
#}
{# Layout Adjustments #}
{% set print_layout = parameters.print_layout == "true" ? true : false %} {# Improves receipt layout for large display/paper size (A4/Letter/Email) #}
{% set chrome_right_margin_fix = false %} {# Fixes a potential issue where the right side of receipts are cut off in Chrome #}
{% set firefox_margin_fix = false %} {# Fixes issue with margins cutting off when printing on a letter printer on a Mac #}
{# Sale #}
{% set hide_register_name = false %} {# Hide the Register Name on Sales #}
{% set hide_employee_name = false %} {# Hide the Employee Name on Sales #}
{% set hide_shop_vat_number = false %} {# Hide the Shop VAT Number on Sales #}
{% set hide_shop_registration_number = false %} {# Hide the Shop Registration Number on Sales #}
{% set hide_customer_vat_number = false %} {# Hide the Customer VAT Number on Sales #}
{% set hide_customer_registration_number = false %} {# Hide the Customer Registration Number on Sales #}
{% set sale_id_instead_of_ticket_number = true %} {# Displays the Sale ID instead of the Ticket Number #}
{% set invoice_as_title = parameters.invoice_as_title == "true" ? true : false %} {# If print_layout is true, "Invoice" will be displayed instead of "Sales Receipt" on A4/Letter/Email formats #}
{% set workorders_as_title = false %} {# Changes the receipt title to "Work Orders" if there is no Salesline items and 1 or more workorders #}
{% set quote_id_prefix = "" %} {# Adds a string of text as a prefix for the Quote ID. Ex: "Q-". To be used when "sale_id_instead_of_ticket_number" is true #}
{% set sale_id_prefix = "" %} {# Adds a string of text as a prefix for the Sales ID. Ex: "S-". To be used when "sale_id_instead_of_ticket_number" is true #}
{% set hide_notes_in_sale_receipt = false %} {# Hide the printed note in the sale receipt, if any #}
{% set hide_notes_in_gift_receipt = false %} {# Hide the printed note in the gift receipt, if any #}
{# Item Lines #}
{% set per_line_discount = false %} {# Displays Discounts on each Sale Line #}
{% set per_line_subtotal = false %} {# Displays Subtotals for each Sale Line (ex: "1 x 5.00") #}
{% set discounted_line_items = false %} {# Strikes out the original price and displays the discounted price on each Sale Line #}
{% set per_line_employee = false %} {# Display Employee for each Sale line #}
{% set show_custom_sku = false %} {# Adds SKU column for Custom SKU, if available, on each Sale Line #}
{% set show_manufacturer_sku = false %} {# Adds SKU column for Manufacturer SKU, if available, on each Sale Line #}
{% set show_msrp = false %} {# Adds MSRP column for the items MSRP, if available, on each Sale Line #}
{# Misc. Adjustments #}
{% set show_shop_name_with_logo = false %} {# Displays the Shop Name under the Shop Logo #}
{% set show_thank_you = true %} {# Displays "Bedankt <Customer Name>!" above bottom barcode #}
{% set show_transaction_item_count = false %} {# Gives a total quantity of items sold near the bottom of the receipt #}
{% set show_sale_lines_on_store_copy = true %} {# Shows Sale Lines on Credit Card Store Copy receipts #}
{% set quote_to_invoice = false %} {# Changes Offerte wording to Factuur in Sales and in Sale Quotes (does not apply to Work Order Quotes) #}
{% set show_sale_lines_on_gift_receipt = true %} {# Displays Sale Lines on Gift Receipts #}
{% set show_barcode = true %} {# Displays barcode at bottom of receipts #}
{% set show_barcode_sku = true %} {# Displays the System ID at the bottom of barcodes #}
{% set show_workorders_barcode = false %} {# Displays workorders barcode #}
{% set show_workorders_barcode_sku = true %} {# Displays the System ID at the bottom of workorders barcodes #}
{% set hide_ticket_number_on_quote = false %} {# Hides the Ticket Number on Quotes #}
{% set hide_quote_id_on_sale = false %} {# Hides the Quote ID on Sales #}
{# Customer Information #}
{% set show_full_customer_address = false %} {# Displays Customers full address, if available #}
{% set show_customer_name_only = true %} {# Hides all Customer information except for their name #}
{% set show_customer_notes = false %} {# Displays Notes entered in the Customers profile #}
{% set company_name_override = false %} {# Does not display the Customer Name if Company Name is present #}
{# Customer Account #}
{% set show_credit_account_signature = false %} {# Prints Store Copy with signature line on accounts that use an Account Credit (not Deposit) #}
{% set show_customer_layaways = true %} {# Displays Customer Layaway information at the bottom of receipts #}
{% set show_customer_specialorders = true %} {# Displays Customer Special Order information at the bottom of receipts #}
{% set show_customer_workorders = true %} {# Displays Customer Work Order information at the bottom of receipts #}
{% set show_customer_credit_account = true %} {# Displays Customer Credit Account information at the bottom of receipts #}
{# Logos #}
{% set logo_width = '225px' %} {# Default width is 225px. #}
{% set logo_height = '' %} {# Default height is 55px. #}
{% set multi_shop_logos = false %} {# Allows multiple logos to be added for separate locations when used with options below #}
{#
Use the following shop_logo_array to enter all of your locations and the link to the logo image that you have uploaded to the internet.
Enter your EXACT shop name (Case Sensitive!) in the Quotes after the "name": entry and then enter the URL to your logo after the "logo": entry.
Be sure to set the multi_shop_logos setting above to true in order to have these logos take effect!
#}
{% set shop_logo_array =
{
0:{"name":"Example Shop", "logo_url":"http://logo.url.goes/here.jpg"},
1:{"name":"", "logo_url":""},
2:{"name":"", "logo_url":""},
3:{"name":"", "logo_url":""},
4:{"name":"", "logo_url":""},
5:{"name":"", "logo_url":""}
}
%}
{#
***End Custom Options***
#}
{% extends parameters.print ? "printbase" : "base" %}
{% block extrastyles %}
@page { margin: 0px; }
body {
font: normal 10pt 'Helvetica Neue', Helvetica, Arial, sans-serif;
width: {{parameters.page_width|pageWidthToCss}};
margin: 0 auto;
padding: 1px; <!-- You need this to make the printer behave -->
{% if chrome_right_margin_fix == true %}
margin-right: .13in;
{% endif %}
{% if firefox_margin_fix == true %}
margin: 25px;
{% endif %}
}
.store {
page-break-after: always;
}
.receipt {
font: normal 10pt “Helvetica Neue”, Helvetica, Arial, sans-serif;
}
h1 {
margin: .5em 0 0;
font-size: 12pt;
text-align: center;
}
p.date, p.copy {
font-size: 9pt;
margin: 0;
text-align: center;
}
p.details {
font-size: 10pt;
text-align: left;
}
h2 {
border-bottom: 1px solid black;
text-transform: uppercase;
font-size: 10pt;
margin: .5em 0 0;
}
.receiptHeader {
text-align: center;
}
.receiptHeader h3 {
font-size: 12pt;
margin: 0;
}
.shipping h4 {
margin-top: 0;
}
.receiptHeader img {
margin: 8px 0 4px;
}
.receiptShopContact {
margin: 0;
}
table {
margin: 0 0;
width: 100%;
border-collapse:collapse;
}
table th { text-align: left; }
table tbody th {
font-weight: normal;
text-align: left;
}
table td.amount, table th.amount { text-align: right; }
table td.quantity, table th.quantity { text-align: center; }
th.description {
width: 100%;
}
td.amount { white-space: nowrap; }
table.totals { text-align: right; }
table.payments { text-align: right; }
table.spacer { margin-top: 1em; }
table tr.total td { font-weight: bold; }
table td.amount { padding-left: 10px; }
table td.custom_field {
padding-right: 10px;
text-align: center;
}
table.sale { border-bottom: 1px solid black; }
table.sale th {
border-bottom: 1px solid black;
font-weight: bold;
}
table div.line_description {
text-align: left;
font-weight: bold;
}
table div.line_note {
text-align: left;
padding-left: 10px;
}
table div.line_extra {
text-align: left;
padding-left: 10px;
font-size: .8em;
}
table div.line_serial {
text-align: left;
font-weight: normal;
padding-left: 10px;
}
table div.line_description_item_fee {
padding-left: 10px;
}
.footerSectionTitle + table div.line_description_item_fee {
padding-left: 25px;
}
table.workorders div.line_description {
font-weight: normal;
padding-left: 10px;
}
table.workorders div.line_note {
font-weight: normal;
padding-left: 10px;
}
table.workorders div.line_serial {
font-weight: normal;
padding-left: 20px;
}
table.workorders td.workorder div.line_note {
font-weight: bold;
padding-left: 0px;
}
p.thankyou {
margin: 0;
text-align: center;
}
.note { text-align: center; }
.barcodeContainer {
margin-top: 15px;
text-align: center;
}
.workorders .barcodeContainer {
margin-left: 15px;
text-align: left;
}
dl {
overflow: hidden
}
dl dt {
font-weight: bold;
width: 80px;
float: left
}
dl dd {
border-top: 2px solid black;
padding-top: 2px;
margin: 1em 0 0;
float: left;
width: 180px
}
dl dd p { margin: 0; }
.strike { text-decoration: line-through; }
.receiptCompanyNameField,
.receiptCustomerNameField,
.receiptCustomerVatField,
.receiptCustomerCompanyVatField,
.receiptCustomerAddressField,
.receiptPhonesContainer,
.receiptCustomerNoteField {
display: block;
}
table.payments td.label {
font-weight: normal;
text-align: right;
width: 100%;
}
#receiptTransactionDetails table {
max-width: 245px;
margin: 0 auto;
}
#receiptTransactionDetails table td {
text-align: right;
}
#receiptTransactionDetails table td.top {
font-weight: bold;
}
#receiptTransactionDetails table td.label {
padding-right: 20px;
text-align: left;
}
{% if print_layout %}
/* Receipts only */
@media (max-width: 299px) {
.show-on-print {
display: none;
}
.hide-on-print {
display: block;
}
}
@media (min-width: 480px) {
/* Emails hacks, don't mind the optimisation */
table.saletotals {
Float: right;
Margin-top: 50px;
width: 50% !important;
}
table.payments {
width: 100%;
}
table.payments {
Float: left;
margin-top: 5px;
width: 50%;
text-align: left;
}
table.payments tr td.amount {
text-align: right;
width: auto;
}
table.payments tr td.amount {
text-align: left;
width: 100%;
}
table.payments td.label {
font-weight: bold;
text-align: left;
white-space: nowrap;
width: inherit;
}
}
/* Email, Letter, A4 only */
@media (min-width: 300px) {
.show-on-print {
display: block;
}
.hide-on-print {
display: none;
}
body {
padding: 15px;
position: relative;
}
.receiptHeader {
Float: left;
position: relative;
max-width: 50%;
text-align: left;
}
.receiptHeader img {
display: block;
margin: 0 0 10px;
max-width: 120px;
}
.receiptHeader h3.receiptShopName {
font-size: 14pt;
margin-bottom: 3px;
text-decoration: underline;
}
.receiptShopName,
.receiptShopContact {
text-align: left;
}
.receiptTypeTitle,
.receiptTypeTitle span {
font-size: 18pt;
Float: right;
clear: right;
text-align: center;
margin-top: 0;
}
.receiptTypeTitle span.hide-on-print {
font-size: 0;
display: none;
}
p.date,
p.copy {
Float: right;
clear: right;
}
#receiptInfo {
clear: both;
padding-top: 15px;
padding-left: 0px;
}
#receiptInfo:after {
content: "";
display: table;
clear: both;
}
.receiptQuoteIdField,
.receiptTicketIdField {
clear: right;
Float: right;
}
.receiptQuoteIdLabel,
.receiptTicketIdLabel {
display: none !important;
}
#receiptQuoteId,
#receiptTicketId {
font-size: 14pt;
font-weight: bold;
display: block;
Float: right;
}
.vatNumberField,
.companyRegistrationNumberField,
.receiptRegisterNameField,
.receiptEmployeeNameField {
clear: right;
Float: right;
text-align: right;
}
.vatNumberField span,
.companyRegistrationNumberField span,
.receiptRegisterNameField span,
.receiptEmployeeNameField span {
font-size: 8pt;
}
.receiptCustomerAddressLabel,
.receiptEmailLabel {
display: none !important;
}
.receiptCompanyNameField,
.receiptCustomerNameField,
.receiptCustomerVatField,
.receiptCustomerCompanyVatField {
margin-bottom: 3px;
margin-top: 3px;
}
.receiptCompanyNameLabel,
.receiptCustomerNameLabel,
.receiptCustomerVatLabel,
.receiptCustomerCompanyVatLabel {
font-size: 11pt;
font-weight: bold;
}
#receiptCompanyName,
#receiptCustomerName {
font-size: 12pt;
}
.receiptCompanyNameField,
.receiptCustomerNameField,
.receiptCustomerVatField,
.receiptCustomerCompanyVatField,
.receiptCustomerAddressField,
.receiptPhonesContainer,
.receiptCustomerNoteField {
display: block;
max-width: 40%;
}
table.sale {
clear: both;
padding-top: 30px;
}
table.sale tbody tr:first-child th,
table.sale tbody tr:first-child td {
padding-top: 10px;
}
table.sale tbody tr:last-child th,
table.sale tbody tr:last-child td {
padding-bottom: 10px;
}
table.sale tbody th,
table.sale tbody td {
padding-bottom: 5px;
padding-top: 5px;
}
.paymentTitle,
.notesTitle,
.footerSectionTitle {
font-size: 12pt;
padding-top: 15px;
text-transform: none;
}
.footerSectionTitle {
clear: both;
}
.notesTitle {
float: left;
width: 100%;
}
.thankyou {
clear: both;
padding-top: 30px;
}
img.barcode {
border: none;
height: 30px;
width: 150px;
}
}
{% endif %}
{% endblock extrastyles %}
{% block content %}
{% set page_loaded = false %}
{% for Sale in Sales %}
{% if not parameters.page or parameters.page == 1 %}
{% if Sale.Shop.ReceiptSetup.creditcardAgree|strlen > 0 and not parameters.gift_receipt and not parameters.email %}
{% for SalePayment in Sale.SalePayments.SalePayment %}
{% if parameters.force_cc_agree or parameters.print_workorder_agree %}
{{ _self.store_receipt(Sale,parameters,_context,SalePayment) }}
{% set page_loaded = true %}
{% else %}
{% if SalePayment.archived == 'false' and SalePayment.MetaData.ReceiptData.requires_receipt_signature|CompBool == true %}
{{ _self.store_receipt(Sale,parameters,_context,SalePayment) }}
{% set page_loaded = true %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% if not parameters.page or parameters.page == 2 or not page_loaded %}
<!-- replace.email_custom_header_msg -->
<div>
{{ _self.ship_to(Sale,_context) }}
{{ _self.header(Sale,_context) }}
{{ _self.title(Sale,parameters,_context) }}
{{ _self.date(Sale) }}
{{ _self.sale_details(Sale,_context) }}
{% if not parameters.gift_receipt or show_sale_lines_on_gift_receipt %}
{{ _self.receipt(Sale,parameters,false,_context) }}
{% endif %}
{# Item Count Loop #}
{% if show_transaction_item_count %}
{% set transaction_item_count = 0 %}
{% for Line in Sale.SaleLines.SaleLine %}
{% set transaction_item_count = transaction_item_count + Line.unitQuantity %}
{% endfor %}
<p>Totaal aantal items: {{ transaction_item_count }}</p>
{% endif %}
{% if Sale.quoteID and Sale.Quote.notes|strlen > 0 %}<p id="receiptQuoteNote" class="note quote">{{Sale.Quote.notes|noteformat|raw}}</p>{% endif %}
{% if Sale.Shop.ReceiptSetup.generalMsg|strlen > 0 %}<p id="receiptNote" class="note">{{ Sale.Shop.ReceiptSetup.generalMsg|noteformat|raw }}</p>{% endif %}
{{ _self.client_workorder_agreement(Sale,_context) }}
{% if not parameters.gift_receipt %}
{{ _self.no_tax_applied_text(Sale) }}
<p id="receiptThankYouNote" class="thankyou">
{% if show_thank_you %}
Bedankt{% if Sale.Customer %} {{Sale.Customer.firstName}} {{Sale.Customer.lastName}}{% endif %}!
{% endif %}
</p>
{% endif %}
{% if show_barcode %}
<p class="barcodeContainer">
<img id="barcodeImage" height="50" width="250" class="barcode" src="/barcode.php?type=receipt&number={{Sale.ticketNumber}}&hide_text={{ not show_barcode_sku }}">
</p>
{% endif %}
{% if Sale.completed == 'true' and Sale.SalePayments and not parameters.gift_receipt %}
{#
DO NOT CONSOLIDATE THESE IF STATEMENTS.
Twig doesnt play nice with these functions.
#}
{{ _self.transaction_details(Sale) }}
{% endif %}
</div>
<!-- replace.email_custom_footer_msg -->
{% endif %}
{% endfor %}
{% endblock content %}
{% macro no_tax_applied_text(Sale) %}
{% set has_non_taxed_item = 'false' %}
{% for Line in Sale.SaleLines.SaleLine %}
{# If line has no tax and is not a workorder line, unless it is the workorders Labor line #}
{% if ((Line.tax == 'false' or (Line.calcTax1 == 0 and Line.calcTax2 == 0)) and
(Line.isWorkorder == 'false' or Line.Note.note == 'Labor')) %}
{% set has_non_taxed_item = 'true' %}
{% endif %}
{% endfor %}
{% if(has_non_taxed_item == 'true') %}
<p id="noTaxApplied" class="thankyou">* Geen belasting toegepast</p>
{% endif %}
{% endmacro %}
{% macro store_receipt(Sale,parameters,options,Payment) %}
<div class="store">
{{ _self.header(Sale,options) }}
{{ _self.title(Sale,parameters,options) }}
<p class="copy">Winkelbon</p>
{{ _self.date(Sale) }}
{{ _self.sale_details(Sale,options) }}
{% if options.show_sale_lines_on_store_copy %}
{{ _self.receipt(Sale,parameters,true,options) }}
{% else %}
{% if isUnifiedReceipt(Sale.SalePayments) %}
{{ _self.single_transaction_details(Sale, Payment) }}
{% else %}
<h2 class="paymentTitle">Betalingen</h2>
<table class="payments">
{{ _self.cc_payment_info(Sale,Payment) }}
</table>
{% endif %}
{% endif %}
{% if Sale.quoteID and Sale.Quote.notes|strlen > 0 %}<p class="note quote">{{Sale.Quote.notes|noteformat|raw}}</p>{% endif %}
{{ _self.cc_agreement(Sale,Payment,options) }}
{{ _self.shop_workorder_agreement(Sale) }}
<p class="barcodeContainer">
<img height="50" width="250" class="barcode" src="/barcode.php?type=receipt&number={{Sale.ticketNumber}}">
</p>
{{ _self.ship_to(Sale,options) }}
</div>
{% endmacro %}
{% macro lineDescription(Line,options) %}
{% if Line.Item %}
<div class='line_description'>
{% autoescape true %}{{ Line.Item.description|nl2br }}{% if Line.tax == 'false' or (Line.calcTax1 == 0 and Line.calcTax2 == 0) %}*{% endif %}{% endautoescape %}
</div>
{% elseif Line.ItemFee and Line.itemFeeID and (Line.lineType == 'item_fee' or Line.lineType == 'item_fee_refund') %}
<div class="line_description_item_fee">
{{ Line.ItemFee.name|nl2br }}{% if Line.tax == 'false' or (Line.calcTax1 == 0 and Line.calcTax2 == 0) %}*{% endif %}
</div>
{% endif %}
{% if Line.Note %}
<div class='line_note'>
{% autoescape true %}
{{ Line.Note.note|noteformat|raw }}
<!-- If line has no tax and is not a workorder line, unless it is the workorder's "Labor" line -->
{% if (Line.tax == 'false' or (Line.calcTax1 == 0 and Line.calcTax2 == 0)) and
(Line.isWorkorder == 'false' or Line.Note.note == 'Labor') %}
*
{% endif %}
{% endautoescape %}
</div>
{% endif %}
{% if Line.Serialized %}
{% for Serialized in Line.Serialized.Serialized %}
<div class='line_serial'>
Serienr.: {{ Serialized.serial }} {{ Serialized.color }} {{ Serialized.size }}
</div>
{% endfor %}
{% endif %}
{% if options.per_line_employee and not options.hide_employee_name %}
<div class='line_note'>
Medewerker: {{ Line.Employee.firstName }}
</div>
{% endif %}
{% endmacro %}
{% macro title(Sale,parameters,options) %}
<h1 class="receiptTypeTitle">
{% if Sale.calcTotal >= 0 %}
{% if Sale.completed == 'true' %}
{% if options.invoice_as_title and options.print_layout %}
<span class="hide-on-print">
{% endif %}
{% if options.workorders_as_title and Sale.SaleLines is empty and Sale.Customer.Workorders is defined %}
Werkorders
{% else %}
{% if parameters.gift_receipt %}Cadeaubon{% else %}Kassabon{% endif %}
{% endif %}
{% if options.invoice_as_title and options.print_layout %}
</span>
<span class="show-on-print">
{% if options.workorders_as_title and Sale.SaleLines is empty and Sale.Customer.Workorders is defined %}
Werkorders
{% else %}
Factuur
{% endif %}
</span>
{% endif %}
{% elseif Sale.voided == 'true' %}
{% if options.invoice_as_title and options.print_layout %}
<span class="hide-on-print">
{% endif %}
Kassabon <large>GEANNULEERD</large>
{% if options.invoice_as_title and options.print_layout %}
</span>
<span class="show-on-print">Factuur GEANNULEERD</span>
{% endif %}
{% else %}
{% if options.quote_to_invoice %}
Factuur
{% else %}
Offerte
{% endif %}
{% if not Sale.quoteID %}
<large>(GEEN Kassabon)</large>
{% endif %}
{% endif %}
{% else %}
{% if options.invoice_as_title and options.print_layout %}
<span class="hide-on-print">
{% endif %}
Retour kassabon
{% if options.invoice_as_title and options.print_layout %}
</span>
<span class="show-on-print">Retour factuur</span>
{% endif %}
{% endif %}
</h1>
{% endmacro %}
{% macro date(Sale) %}
<p class="date" id="receiptDateTime">
{% if Sale.timeStamp %}
{{Sale.timeStamp|correcttimezone|date(getDateTimeFormat())}}
{% else %}
{{"now"|date(getDateTimeFormat())}}
{% endif %}
</p>
{% endmacro %}
{% macro sale_details(Sale,options) %}
<p id="receiptInfo" class="details">
{% if options.hide_quote_id_on_sale and Sale.completed == 'true' %}
{% else %}
{% if Sale.quoteID > 0 %}
<span class="receiptQuoteIdField">
<span class="receiptQuoteIdLabel">
{% if options.quote_to_invoice %}
Factuurnr #:
{% else %}
Offertenr.:
{% endif %}
</span>
<span id="receiptQuoteId">{{options.quote_id_prefix}}{{Sale.quoteID}}</span>
<br />
</span>
{% endif %}
{% endif %}
{% if options.hide_ticket_number_on_quote and Sale.completed != 'true' and Sale.quoteID > 0 %}
{% else %}
<span class="receiptTicketIdField">
<span class="receiptTicketIdLabel">
{% if options.sale_id_instead_of_ticket_number %}Verkoop: {% else %}Ticket: {% endif %}</span>
<span id="receiptTicketId">
{% if options.sale_id_instead_of_ticket_number %}
{{options.sale_id_prefix}}{{Sale.saleID}}
{% else %}
{{Sale.ticketNumber}}
{% endif %}
</span>
<br />
</span>
{% endif %}
{% if isVATAndRegistrationNumberOnReceipt() %}
{% if Sale.Shop.vatNumber|strlen and not options.hide_shop_vat_number %}
<span class="vatNumberField">
<span class="vatNumberLabel">BTW-nr: </span>
<span id="vatNumber">{{Sale.Shop.vatNumber}}</span>
<br />
</span>
{% endif %}
{% if Sale.Shop.companyRegistrationNumber|strlen and not options.hide_shop_registration_number %}
<span class="companyRegistrationNumberField">
<span class="companyRegistrationNumberLabel">KvK-nr: </span>
<span id="companyRegistrationNumber">{{Sale.Shop.companyRegistrationNumber}}</span>
<br />
</span>
{% endif %}
{% endif %}
{% if Sale.Register and not options.hide_register_name %}
<span class="receiptRegisterNameField"><span class="receiptRegisterNameLabel">Kassa: </span><span id="receiptRegisterName">{{Sale.Register.name}}</span><br /></span>
{% endif %}
{% if Sale.Employee and not options.hide_employee_name %}
<span class="receiptEmployeeNameField"><span class="receiptEmployeeNameLabel">Medewerker: </span><span id="receiptEmployeeName">{{Sale.Employee.firstName}}</span><br /></span>
{% endif %}
{% if Sale.Customer %}
{% if Sale.Customer.company|strlen > 0 %}
<span class="receiptCompanyNameField"><span class="receiptCompanyNameLabel">Bedrijf: </span><span id="receiptCompanyName">{{Sale.Customer.company}}</span><br /></span>
{% endif %}
{% if not options.company_name_override or not Sale.Customer.company|strlen > 0 %}
<span class="receiptCustomerNameField"><span class="receiptCustomerNameLabel">Klant: </span><span id="receiptCustomerName">{{Sale.Customer.firstName}} {{Sale.Customer.lastName}}</span><br /></span>
{% endif %}
{% if not options.show_customer_name_only %}
{% if options.show_full_customer_address %}
<span class="receiptCustomerAddressField">
<span class="receiptCustomerAddressLabel">Address:</span>
{{ _self.address(Sale.Customer.Contact,',',options) }}
</span>
{% endif %}
<span id="receiptPhonesContainer" class="indent">
{% for Phone in Sale.Customer.Contact.Phones.ContactPhone %}
<span data-automation="receiptPhoneNumber">{{Phone.useType}}: {{Phone.number}}</span><br />
{% endfor %}
{% for Email in Sale.Customer.Contact.Emails.ContactEmail %}
<span class="receiptEmailLabel">E-mailadres: </span><span id="receiptEmail">{{Email.address}} ({{Email.useType}})</span><br />
{% endfor %}
</span>
{% endif %}
{% if isVATAndRegistrationNumberOnReceipt() %}
{% if Sale.Customer.vatNumber|strlen and not options.hide_customer_vat_number %}
<span class="receiptCustomerVatField">
<span class="receiptCustomerVatLabel">Klant BTW-nr: </span>
<span id="customerVatNumber">{{Sale.Customer.vatNumber}}</span>
<br />
</span>
{% endif %}
{% if Sale.Customer.companyRegistrationNumber|strlen and not options.hide_customer_registration_number %}
<span class="receiptCustomerCompanyVatField">
<span class="receiptCustomerCompanyVatLabel">Klant handelsregisternr: </span>
<span id="customerCompanyVatNumber">{{Sale.Customer.companyRegistrationNumber}}</span>
<br />
</span>
{% endif %}
{% endif %}
{% if options.show_customer_notes %}
{% if Sale.Customer.Note.note|strlen > 0 %}
<span class="receiptCustomerNoteField"><span class="receiptCustomerNoteLabel">Opmerking: </span>{{ Sale.Customer.Note.note|noteformat|raw }}<br /></span>
{% endif %}
{% endif %}
{% endif %}
</p>
{% endmacro %}
{% macro line(isTaxInclusive,Line,parameters,options) %}
<tr>
<td data-automation="lineItemDescription" class="description">
{{ _self.lineDescription(Line,options) }}
{% if options.show_custom_sku and Line.Item.customSku|strlen > 0 %}
<div class="line_extra">Aangepaste artikelnummer: {{ Line.Item.customSku }}</div>
{% endif %}
{% if options.show_manufacturer_sku and Line.Item.manufacturerSku|strlen > 0 %}
<div class="line_extra">Artikelnummer fabr.: {{ Line.Item.manufacturerSku }}</div>
{% endif %}
{% if options.per_line_discount == true and not parameters.gift_receipt %}
{% if Line.calcLineDiscount > 0 %}
<small>Korting: '{{ Line.Discount.name }}' -{{Line.calcLineDiscount|money}}</small>
{% elseif Line.calcLineDiscount < 0 %}
<small>Korting: '{{ Line.Discount.name }}' {{Line.calcLineDiscount|getinverse|money}}</small>
{% endif %}
{% endif %}
</td>
{% if options.show_msrp == true and not parameters.gift_receipt %}
{% set msrp_printed = false %}
{% for price in Line.Item.Prices.ItemPrice if not msrp_printed %}
{% if price.useType == "MSRP" and price.amount != "0"%}
<td class="custom_field">{{ price.amount|money }}</td>
{% set msrp_printed = true %}
{% endif %}
{% endfor %}
{% if not msrp_printed %}
<td class="custom_field">N.v.t.</td>
{% endif %}
{% endif %}
<td data-automation="lineItemQuantity" class="quantity">
{% if options.per_line_subtotal and options.discounted_line_items and Line.calcLineDiscount != 0 and not parameters.gift_receipt %}
<span class="strike">{{Line.unitQuantity}} x {{Line.unitPrice|money}}</span>
{% endif %}
{{Line.unitQuantity}}
{% if options.per_line_subtotal and not parameters.gift_receipt %} x
{% if options.discounted_line_items %}
{{ divide(Line.displayableSubtotal, Line.unitQuantity)|money }}
{% else %}
{{Line.displayableUnitPrice|money}}
{% endif %}
{% endif %}
</td>
<td data-automation="lineItemPrice" class="amount">
{% if not parameters.gift_receipt %}
{% if options.discounted_line_items and not options.per_line_subtotal and Line.calcLineDiscount != 0 %}
{% if not isTaxInclusive or isTaxInclusive == 'false' %}
<span class="strike">{{ Line.calcSubtotal|money }}</span><br />
{% else %}
<span class="strike">{{ multiply(Line.unitPrice, Line.unitQuantity)|money }}</span><br />
{% endif %}
{% endif %}
{{ Line.displayableSubtotal|money }}
{% endif %}
</td>
</tr>
{% endmacro %}
{% macro receipt(Sale,parameters,store_copy,options) %}
{% if Sale.SaleLines %}
<table class="sale lines">
<tr>
<th class="description">Product</th>
{% if options.show_msrp and not parameters.gift_receipt %}
<th class="custom_field">Adviesprijs</th>
{% endif %}
<th class="quantity">Nr.</th>
{% if not parameters.gift_receipt %}
<th class="amount">Prijs</th>
{% endif %}
</tr>
<tbody>
{% for Line in Sale.SaleLines.SaleLine %}
{{ _self.line(Sale.isTaxInclusive,Line,parameters,options) }}
{% endfor %}
</tbody>
</table>
{% if not parameters.gift_receipt %}
<table class="saletotals totals">
<tbody id="receiptSaleTotals">
{% if Sale.MetaData.itemFeesSubtotal %}
<tr><td width="100%">Totaal kosten</td><td id="receiptSaleItemFeesTotal" class="amount">{{Sale.MetaData.itemFeesSubtotal|money}}</td></tr>
{% endif %}
<tr>
<td width="100%">
{% if options.discounted_line_items and Sale.calcDiscount != 0 %}
Subtotaal + kortingen
{% else %}
Subtotaal
{% endif %}
</td>
<td id="receiptSaleTotalsSubtotal" class="amount">