forked from Qloapps/QloApps
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathview.tpl
2283 lines (2191 loc) · 104 KB
/
view.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
{*
* 2007-2017 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-2017 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helpers/view/view.tpl"}
{block name="override_tpl"}
<script type="text/javascript">
var admin_order_tab_link = "{$link->getAdminLink('AdminOrders')|addslashes}";
var id_order = {$order->id};
var id_lang = {$current_id_lang};
var id_currency = {$order->id_currency};
var id_customer = {$order->id_customer|intval};
{assign var=PS_TAX_ADDRESS_TYPE value=Configuration::get('PS_TAX_ADDRESS_TYPE')}
var id_address = {$order->$PS_TAX_ADDRESS_TYPE};
var currency_sign = "{$currency->sign}";
var currency_format = "{$currency->format}";
var currency_blank = "{$currency->blank}";
var priceDisplayPrecision = {$smarty.const._PS_PRICE_DISPLAY_PRECISION_|intval};
var use_taxes = {if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_INC}true{else}false{/if};
var stock_management = {$stock_management|intval};
var txt_add_product_stock_issue = "{l s='Are you sure you want to add this quantity?' js=1}";
var txt_add_product_new_invoice = "{l s='Are you sure you want to create a new invoice?' js=1}";
var txt_add_product_no_product = "{l s='Error: No product has been selected' js=1}";
var txt_add_product_no_product_quantity = "{l s='Error: Quantity of products must be set' js=1}";
var txt_add_product_no_product_price = "{l s='Error: Product price must be set' js=1}";
var txt_confirm = "{l s='Are you sure?' js=1}";
var statesShipped = new Array();
var has_voucher = {if count($discounts)}1{else}0{/if};
{foreach from=$states item=state}
{if (isset($currentState->shipped) && !$currentState->shipped && $state['shipped'])}
statesShipped.push({$state['id_order_state']});
{/if}
{/foreach}
var order_discount_price = {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
{$order->total_discounts_tax_excl}
{else}
{$order->total_discounts_tax_incl}
{/if};
var errorRefund = "{l s='Error. You cannot refund a negative amount.'}";
</script>
{assign var="hook_invoice" value={hook h="displayInvoice" id_order=$order->id}}
{if ($hook_invoice)}
<div>{$hook_invoice}</div>
{/if}
<div class="panel kpi-container">
<div class="row">
<div class="col-xs-6 col-sm-3 box-stats color3" >
<div class="kpi-content">
<i class="icon-calendar-empty"></i>
<span class="title">{l s='Date'}</span>
<span class="value">{dateFormat date=$order->date_add full=false}</span>
</div>
</div>
<div class="col-xs-6 col-sm-3 box-stats color4" >
<div class="kpi-content">
<i class="icon-money"></i>
<span class="title">{l s='Total'}</span>
<span class="value">{displayPrice price=$order->total_paid_tax_incl currency=$currency->id}</span>
</div>
</div>
<div class="col-xs-6 col-sm-3 box-stats color2" >
<div class="kpi-content">
<i class="icon-comments"></i>
<span class="title">{l s='Messages'}</span>
<span class="value"><a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'html':'UTF-8'}&id_order={$order->id|intval}">{sizeof($customer_thread_message)}</a></span>
</div>
</div>
<div class="col-xs-6 col-sm-3 box-stats color1" >
<a href="#start_products">
<div class="kpi-content">
<i class="icon icon-home"></i>
<!-- Original -->
<!-- <span class="title">{l s='Total'}</span>
<span class="value">{sizeof($products)}</span> -->
<span class="title">{l s='Total Rooms'}</span>
<span class="value">{$order_detail_data|@count}</span>
</div>
</a>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-7">
<div class="panel">
<div class="panel-heading">
<i class="icon-credit-card"></i>
{l s='Order'}
<span class="badge">{$order->reference}</span>
<span class="badge">{l s="#"}{$order->id}</span>
<div class="panel-heading-action">
<div class="btn-group">
<a class="btn btn-default{if !$previousOrder} disabled{/if}" href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&vieworder&id_order={$previousOrder|intval}">
<i class="icon-backward"></i>
</a>
<a class="btn btn-default{if !$nextOrder} disabled{/if}" href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&vieworder&id_order={$nextOrder|intval}">
<i class="icon-forward"></i>
</a>
</div>
</div>
</div>
<!-- Orders Actions -->
<div class="well hidden-print">
<a class="btn btn-default" href="javascript:window.print()">
<i class="icon-print"></i>
{l s='Print order'}
</a>
{if Configuration::get('PS_INVOICE') && count($invoices_collection) && $order->invoice_number}
<a data-selenium-id="view_invoice" class="btn btn-default _blank" href="{$link->getAdminLink('AdminPdf')|escape:'html':'UTF-8'}&submitAction=generateInvoicePDF&id_order={$order->id|intval}">
<i class="icon-file"></i>
{l s='View invoice'}
</a>
{else}
<span class="span label label-inactive">
<i class="icon-remove"></i>
{l s='No invoice'}
</span>
{/if}
<!-- By webkul to hide unneccessary data on order detail page -->
<!-- {if $order->delivery_number}
<a class="btn btn-default _blank" href="{$link->getAdminLink('AdminPdf')|escape:'html':'UTF-8'}&submitAction=generateDeliverySlipPDF&id_order={$order->id|intval}">
<i class="icon-truck"></i>
{l s='View delivery slip'}
</a>
{else}
<span class="span label label-inactive">
<i class="icon-remove"></i>
{l s='No delivery slip'}
</span>
{/if} -->
<!-- End -->
<!-- Check if refund is allowed and all bookings are not requested for refund -->
{if $refund_allowed && !$completeRefundRequestOrCancel}
<a id="desc-order-standard_refund" class="btn btn-default" href="#refundForm">
<i class="icon-exchange"></i>
{if $order->getTotalPaid()|floatval}
{l s='Initiate refund'}
{else}
{l s='Cancel bookings'}
{/if}
</a>
{/if}
</div>
<!-- Tab nav -->
<ul class="nav nav-tabs" id="tabOrder">
{$HOOK_TAB_ORDER}
<li class="active">
<a href="#status">
<i class="icon-time"></i>
{l s='Status'} <span class="badge">{$history|@count}</span>
</a>
</li>
<li>
<a href="#documents">
<i class="icon-file-text"></i>
{l s='Documents'} <span class="badge">{$order->getDocuments()|@count}</span>
</a>
</li>
</ul>
<!-- Tab content -->
<div class="tab-content panel">
{$HOOK_CONTENT_ORDER}
<!-- Tab status -->
<div class="tab-pane active" id="status">
<h4 class="visible-print">{l s='Status'} <span class="badge">({$history|@count})</span></h4>
<!-- History of status -->
<div class="table-responsive">
<table class="table history-status row-margin-bottom">
<tbody>
{foreach from=$history item=row key=key}
{if ($key == 0)}
<tr>
<td style="background-color:{$row['color']}"><img src="{$link->getMediaLink("`$img_dir`os/`$row['id_order_state']|intval`.gif")}" width="16" height="16" alt="{$row['ostate_name']|stripslashes}" /></td> {* by webkul to get media link *}
<td style="background-color:{$row['color']};color:{$row['text-color']}">{$row['ostate_name']|stripslashes}</td>
<td style="background-color:{$row['color']};color:{$row['text-color']}">{if $row['employee_lastname']}{$row['employee_firstname']|stripslashes} {$row['employee_lastname']|stripslashes}{/if}</td>
<td style="background-color:{$row['color']};color:{$row['text-color']}">{dateFormat date=$row['date_add'] full=true}</td>
<td style="background-color:{$row['color']};color:{$row['text-color']}" class="text-right">
{if $row['send_email']|intval}
<a class="btn btn-default" href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&vieworder&id_order={$order->id|intval}&sendStateEmail={$row['id_order_state']|intval}&id_order_history={$row['id_order_history']|intval}" title="{l s='Resend this email to the customer'}">
<i class="icon-mail-reply"></i>
{l s='Resend email'}
</a>
{/if}
</td>
</tr>
{else}
<tr>
<td><img src="{$link->getMediaLink("`$img_dir`os/`$row['id_order_state']|intval`.gif")}" width="16" height="16" /></td>
<td>{$row['ostate_name']|stripslashes}</td>
<td>{if $row['employee_lastname']}{$row['employee_firstname']|stripslashes} {$row['employee_lastname']|stripslashes}{else} {/if}</td>
<td>{dateFormat date=$row['date_add'] full=true}</td>
<td class="text-right">
{if $row['send_email']|intval}
<a class="btn btn-default" href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&vieworder&id_order={$order->id|intval}&sendStateEmail={$row['id_order_state']|intval}&id_order_history={$row['id_order_history']|intval}" title="{l s='Resend this email to the customer'}">
<i class="icon-mail-reply"></i>
{l s='Resend email'}
</a>
{/if}
</td>
</tr>
{/if}
{/foreach}
</tbody>
</table>
</div>
<!-- Change status form -->
{* If current state is refunded or cancelled the further order status changes are not allowed *}
{if !isset($currentState) || (isset($currentState) && ($currentState->id != Configuration::get('PS_OS_REFUND') && $currentState->id != Configuration::get('PS_OS_CANCELED')))}
<form action="{$currentIndex|escape:'html':'UTF-8'}&vieworder&id_order={$order->id|intval}&token={$smarty.get.token}" method="post" class="form-horizontal well hidden-print">
<div class="row">
<div class="col-lg-9">
<select id="id_order_state" class="chosen form-control" name="id_order_state">
{foreach from=$states item=state}
<option value="{$state['id_order_state']|intval}"{if isset($currentState) && $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{elseif ($state['id_order_state'] == Configuration::get('PS_OS_REFUND') && !$allBookingsRefunded)} disabled="disabled"{elseif ($state['id_order_state'] == Configuration::get('PS_OS_CANCELED') && !$allBookingsCancelled)} disabled="disabled"{elseif ($state['id_order_state'] == Configuration::get('PS_OS_OVERBOOKING_PAID') || $state['id_order_state'] == Configuration::get('PS_OS_OVERBOOKING_UNPAID') || $state['id_order_state'] == Configuration::get('PS_OS_OVERBOOKING_PARTIAL_PAID')) && (!isset($orderOverBookings) || !$orderOverBookings)} disabled="disabled"{/if}>{$state['name']|escape}</option>
{/foreach}
</select>
<input type="hidden" name="id_order" value="{$order->id}" />
</div>
<div class="col-lg-3">
<button type="submit" name="submitState" class="btn btn-primary">
{l s='Update status'}
</button>
</div>
</div>
</form>
{/if}
</div>
<!-- Tab documents -->
<div class="tab-pane" id="documents">
<h4 class="visible-print">{l s='Documents'} <span class="badge">({$order->getDocuments()|@count})</span></h4>
{* Include document template *}
{include file='controllers/orders/_documents.tpl'}
</div>
</div>
{if $returns}
<div class="alert alert-warning">
{l s='Booking cancellation requests has raised from this order. To see booking cancelation requests'} <a target="_blank" href="{$link->getAdminLink('AdminOrderRefundRequests')}&id_order={$order->id}&vieworder_return">{l s='Click here'}</a>.
</div>
{/if}
<div class="row">
<div class="panel">
<div class="panel-heading order_status_heading">
<i class="icon-credit-card"></i>
{l s='Rooms Status'}
</div>
<div class="panel-content">
<div class="row">
<div class="col-lg-12" id="room_status_info_wrapper">
<table class="table table-responsive">
<tr>
<th>{l s='Room No.'}</th>
<th>{l s='Hotel Name'}</th>
<th>{l s='Duration'}</th>
<th>{l s='Documents'}</th>
<th>{l s='Room Status'}</th>
</tr>
{if isset($htl_booking_order_data) && $htl_booking_order_data}
{foreach from=$htl_booking_order_data item=data}
<tr>
<td>
{$data['room_num']}
</td>
<td>
<a href="{$link->getAdminLink('AdminAddHotel')}&id={$data['id_hotel']}&updatehtl_branch_info" target="_blank">
<span>{$data['hotel_name']}</span>
</a>
</td>
<td>
{dateFormat date=$data['date_from']} - {dateFormat date=$data['date_to']}
</td>
<td>
<a class="btn btn-default" onclick="BookingDocumentsModal.init({$data.id|intval}, this); return false;">
<i class="icon icon-file-text"></i>
{l s='Documents'} <span class="badge badge-info count-documents">{$data.num_checkin_documents}</span>
</a>
</td>
<td>
<form action="" method="post" class="form-horizontal row room_status_info_form">
<div class="col-sm-7">
{if $data.is_refunded || $data.is_cancelled}
{if $data['id_status'] == $hotel_order_status['STATUS_ALLOTED']['id_status']}
<p><span class="room_status badge badge-infomation">{l s='Room alloted'}</span></p>
{/if}
{else}
<select name="booking_order_status" class="form-control booking_order_status margin-bottom-5">
{foreach from=$hotel_order_status item=state}
<option value="{$state['id_status']|intval}" {if isset($data.id_status) && $state.id_status == $data.id_status} selected="selected" disabled="disabled"{/if}>{$state.name|escape}</option>
{/foreach}
</select>
{/if}
{if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']}
<p><span class="room_status badge badge-success">{l s='Checked in on'} {dateFormat date=$data['check_in']}</span></p>
{elseif $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']}
<p><span class="room_status badge badge-success">{l s='Checked out on'} {dateFormat date=$data['check_out']}</span></p>
{/if}
{* field for the current date *}
<input class="room_status_date wk-input-date" type="text" name="status_date" value="{if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']}{$data['date_to']|date_format:"%d-%m-%Y"}{else}{$data['date_from']|date_format:"%d-%m-%Y"}{/if}" readonly/>
<input type="hidden" name="date_from" value="{$data['date_from']|date_format:"%Y-%m-%d"}" />
<input type="hidden" name="date_to" value="{$data['date_to']|date_format:"%Y-%m-%d"}" />
<input type="hidden" name="id_room" value="{$data['id_room']}" />
<input type="hidden" name="id_order" value="{$order->id}" />
</div>
<div class="col-sm-5 text-right">
{if $data.is_refunded || $data.is_cancelled}
<span class="badge badge-danger">{if $data.is_cancelled}{l s='Cancelled'}{else}{l s='Refunded'}{/if}</span>
{else}
<button type="submit" name="submitbookingOrderStatus" class="btn btn-primary">
{l s='Update Status'}
</button>
{/if}
</div>
</form>
</td>
</tr>
{/foreach}
{else}
<tr>
<td>{l s='No data found.'}</td>
</tr>
{/if}
</table>
</div>
</div>
</div>
</div>
</div>
<script>
$('#tabOrder a').click(function (e) {
e.preventDefault()
$(this).tab('show')
})
</script>
<hr />
<!-- Tab nav -->
{* <!-- commented by qlo -->
<ul class="nav nav-tabs" id="myTab" style="display:none">
{$HOOK_TAB_SHIP}
<li class="active">
<a href="#shipping">
<i class="icon-truck "></i>
{l s='Shipping'} <span class="badge">{$order->getShipping()|@count}</span>
</a>
</li>
<li>
<a href="#returns">
<i class="icon-undo"></i>
{l s='Merchandise Returns'} <span class="badge">{$order->getReturn()|@count}</span>
</a>
</li>
</ul>
<!-- Tab content -->
<div class="tab-content panel" style="display:none">
{$HOOK_CONTENT_SHIP}
<!-- Tab shipping -->
<div class="tab-pane active" id="shipping">
<h4 class="visible-print">{l s='Shipping'} <span class="badge">({$order->getShipping()|@count})</span></h4>
<!-- Shipping block -->
{if !$order->isVirtual()}
<div class="form-horizontal">
{if $order->gift_message}
<div class="form-group">
<label class="control-label col-lg-3">{l s='Message'}</label>
<div class="col-lg-9">
<p class="form-control-static">{$order->gift_message|nl2br}</p>
</div>
</div>
{/if}
{include file='controllers/orders/_shipping.tpl'}
{if $carrierModuleCall}
{$carrierModuleCall}
{/if}
<hr />
{if $order->recyclable}
<span class="label label-success"><i class="icon-check"></i> {l s='Recycled packaging'}</span>
{else}
<span class="label label-inactive"><i class="icon-remove"></i> {l s='Recycled packaging'}</span>
{/if}
{if $order->gift}
<span class="label label-success"><i class="icon-check"></i> {l s='Gift wrapping'}</span>
{else}
<span class="label label-inactive"><i class="icon-remove"></i> {l s='Gift wrapping'}</span>
{/if}
</div>
{/if}
</div>
<!-- Tab returns -->
<div class="tab-pane" id="returns">
<h4 class="visible-print">{l s='Merchandise Returns'} <span class="badge">({$order->getReturn()|@count})</span></h4>
{if !$order->isVirtual()}
<!-- Return block -->
{if $order->getReturn()|count > 0}
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th><span class="title_box ">{l s='Date'}</span></th>
<th><span class="title_box ">{l s='Type'}</span></th>
<th><span class="title_box ">{l s='Carrier'}</span></th>
<th><span class="title_box ">{l s='Tracking number'}</span></th>
</tr>
</thead>
<tbody>
{foreach from=$order->getReturn() item=line}
<tr>
<td>{$line.date_add}</td>
<td>{l s=$line.type}</td>
<td>{$line.state_name}</td>
<td class="actions">
<span class="shipping_number_show">{if isset($line.url) && isset($line.tracking_number)}<a href="{$line.url|replace:'@':$line.tracking_number|escape:'html':'UTF-8'}">{$line.tracking_number}</a>{elseif isset($line.tracking_number)}{$line.tracking_number}{/if}</span>
{if $line.can_edit}
<form method="post" action="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&vieworder&id_order={$order->id|intval}&id_order_invoice={if $line.id_order_invoice}{$line.id_order_invoice|intval}{else}0{/if}&id_carrier={if $line.id_carrier}{$line.id_carrier|escape:'html':'UTF-8'}{else}0{/if}">
<span class="shipping_number_edit" style="display:none;">
<button type="button" name="tracking_number">
{$line.tracking_number|htmlentities}
</button>
<button type="submit" class="btn btn-default" name="submitShippingNumber">
{l s='Update'}
</button>
</span>
<button href="#" class="edit_shipping_number_link">
<i class="icon-pencil"></i>
{l s='Edit'}
</button>
<button href="#" class="cancel_shipping_number_link" style="display: none;">
<i class="icon-remove"></i>
{l s='Cancel'}
</button>
</form>
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{else}
<div class="list-empty hidden-print">
<div class="list-empty-msg">
<i class="icon-warning-sign list-empty-icon"></i>
{l s='No merchandise returned yet'}
</div>
</div>
{/if}
{if $carrierModuleCall}
{$carrierModuleCall}
{/if}
{/if}
</div>
</div>
*}
<script>
$('#myTab a').click(function (e) {
e.preventDefault()
$(this).tab('show')
})
</script>
</div>
<!-- Payments block -->
<div id="form_add_payment_panel" class="panel">
<div class="panel-heading">
<i class="icon-money"></i>
{l s="Payment"} <span class="badge">{$order->getOrderPayments()|@count}</span>
</div>
{if count($order->getOrderPayments()) > 0}
<p class="alert alert-danger"{if round($order->total_paid_tax_incl, 2) == round($total_paid, 2) || (isset($currentState) && $currentState->id == 6)} style="display: none;"{/if}>
{l s='Warning'}
<strong>{displayPrice price=$total_paid currency=$currency->id}</strong>
{l s='paid instead of'}
<strong class="total_paid">{displayPrice price=$order->total_paid_tax_incl currency=$currency->id}</strong>
{* {foreach $order->getBrother() as $brother_order}
{if $brother_order@first}
{if count($order->getBrother()) == 1}
<br />{l s='This warning also concerns order '}
{else}
<br />{l s='This warning also concerns the next orders:'}
{/if}
{/if}
<a href="{$current_index}&vieworder&id_order={$brother_order->id}&token={$smarty.get.token|escape:'html':'UTF-8'}">
#{'%06d'|sprintf:$brother_order->id}
</a>
{/foreach} *}
</p>
{/if}
<div class="form-group">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th><span class="title_box ">{l s='Date'}</span></th>
<th><span class="title_box ">{l s='Payment method'}</span></th>
<th><span class="title_box ">{l s='Payment source'}</span></th>
<th><span class="title_box ">{l s='Transaction ID'}</span></th>
<th><span class="title_box ">{l s='Amount'}</span></th>
<th><span class="title_box ">{l s='Invoice'}</span></th>
<th></th>
</tr>
</thead>
<tbody>
{foreach from=$order_payment_detail item=payment}
<tr>
<td>{dateFormat date=$payment['date_add'] full=true}</td>
<td>{$payment['payment_method']|escape:'html':'UTF-8'}</td>
<td>{$payment_types[$payment['payment_type']]['name']|escape:'html':'UTF-8'}</td>
<td>{$payment['transaction_id']|escape:'html':'UTF-8'}</td>
<td>{displayPrice price=$payment['real_paid_amount'] currency=$payment['id_currency']}</td>
<td>{if isset($payment['invoice_number'])}{$payment['invoice_number']}{else}--{/if}</td>
<td class="actions">
<button class="btn btn-default open_payment_information">
<i class="icon-search"></i>
{l s='Details'}
</button>
</td>
</tr>
<tr class="payment_information" style="display: none;">
<td colspan="5">
<p>
<b>{l s='Card Number'}</b>
{if $payment['card_number']}
{$payment['card_number']}
{else}
<i>{l s='Not defined'}</i>
{/if}
</p>
<p>
<b>{l s='Card Brand'}</b>
{if $payment['card_brand']}
{$payment['card_brand']}
{else}
<i>{l s='Not defined'}</i>
{/if}
</p>
<p>
<b>{l s='Card Expiration'}</b>
{if $payment['card_expiration']}
{$payment['card_expiration']}
{else}
<i>{l s='Not defined'}</i>
{/if}
</p>
<p>
<b>{l s='Card Holder'}</b>
{if $payment['card_holder']}
{$payment['card_holder']}
{else}
<i>{l s='Not defined'}</i>
{/if}
</p>
</td>
</tr>
{foreachelse}
<tr>
<td class="list-empty hidden-print" colspan="6">
<div class="list-empty-msg">
<i class="icon-warning-sign list-empty-icon"></i>
{l s='No payment records'}
</div>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
<div class="form-group">
<button class="btn btn-primary add_new_payment" id="add_new_payment">
{l s='Add new payment'}
</button>
</div>
<form id="form_add_payment" class="well" method="post" action="{$current_index}&vieworder&id_order={$order->id}&token={$smarty.get.token|escape:'html':'UTF-8'}" style="display:none">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">{l s='Date'}</label>
<div class="col-sm-10">
<div class="input-group fixed-width-xl">
<input type="text" name="payment_date" class="datepicker" value="{date('Y-m-d')}" />
<div class="input-group-addon">
<i class="icon-calendar-o"></i>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">{l s='Payment method'}</label>
<div class="col-sm-10">
<input name="payment_method" list="payment_method" class="form-control payment_method fixed-width-xl">
<datalist id="payment_method">
{foreach from=$payment_methods item=payment_method}
<option value="{$payment_method}">
{/foreach}
</datalist>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">{l s='Payment source'}</label>
<div class="col-sm-10">
<select name="payment_type" class="payment_type form-control fixed-width-xl">
{foreach from=$payment_types item=payment_type}
<option value="{$payment_type['value']}">{$payment_type['name']}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">{l s='Transaction ID'}</label>
<div class="col-sm-10">
<input type="text" name="payment_transaction_id" value="" class="form-control fixed-width-xl"/>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">{l s='Amount'}</label>
<div class="col-sm-10">
<input type="text" name="payment_amount" value="" class="form-control fixed-width-xl pull-left" />
<select name="payment_currency" class="payment_currency form-control fixed-width-xs pull-left">
{foreach from=$currencies item=current_currency}
<option value="{$current_currency['id_currency']}"{if $current_currency['id_currency'] == $currency->id} selected="selected"{/if}>{$current_currency['sign']}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
{if count($invoices_collection) > 0}
<label class="control-label col-sm-2">{l s='Invoice'}</label>
<div class="col-sm-10">
<select name="payment_invoice" id="payment_invoice">
{foreach from=$invoices_collection item=invoice}
<option value="{$invoice->id}" selected="selected">{$invoice->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}</option>
{/foreach}
</select>
</div>
{/if}
</div>
<button class="btn btn-primary pull-right" type="submit" name="submitAddPayment">
{l s='Add payment'}
</button>
<button class="btn btn-default" id="cancle_add_payment">
{l s='Cancel'}
</button>
</div>
</form>
{if (!$order->valid && sizeof($currencies) > 1)}
<form class="form-horizontal well" method="post" action="{$currentIndex|escape:'html':'UTF-8'}&vieworder&id_order={$order->id}&token={$smarty.get.token|escape:'html':'UTF-8'}">
<div class="row">
<label class="control-label col-lg-3">{l s='Change currency'}</label>
<div class="col-lg-6">
<select name="new_currency">
{foreach from=$currencies item=currency_change}
{if $currency_change['id_currency'] != $order->id_currency}
<option value="{$currency_change['id_currency']}">{$currency_change['name']} - {$currency_change['sign']}</option>
{/if}
{/foreach}
</select>
<p class="help-block">{l s='Do not forget to update your exchange rate before making this change.'}</p>
</div>
<div class="col-lg-3">
<button type="submit" class="btn btn-default" name="submitChangeCurrency"><i class="icon-refresh"></i> {l s='Change'}</button>
</div>
</div>
</form>
{/if}
</div>
{hook h="displayAdminOrderLeft" id_order=$order->id}
</div>
<div class="col-lg-5">
<!-- Customer informations -->
<div class="panel">
{if $customer->id}
<div class="panel-heading">
<i class="icon-user"></i>
{l s='Customer'}
<span class="badge">
<a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={getAdminToken tab='AdminCustomers'}">
{if Configuration::get('PS_B2B_ENABLE')}{$customer->company} - {/if}
{$gender->name|escape:'html':'UTF-8'}
{$customer->firstname}
{$customer->lastname}
</a>
</span>
<span class="badge">
{l s='#'}{$customer->id}
</span>
</div>
<div class="row">
<div class="col-xs-6">
{if ($customer->isGuest())}
<p>{l s='This booking has been created by a guest.'}</p>
{if (!Customer::customerExists($customer->email))}
<form method="post" action="index.php?tab=AdminCustomers&id_customer={$customer->id}&id_order={$order->id|intval}&token={getAdminToken tab='AdminCustomers'}">
<input type="hidden" name="id_lang" value="{$order->id_lang}" />
<input class="btn btn-default" type="submit" name="submitGuestToCustomer" value="{l s='Transform this guest into a customer'}" />
<p class="help-block">{l s='This feature will generate a random password and send an email to the customer.'}</p>
</form>
<dl class="panel list-detail">
<dt>{l s='Email'}</dt>
<dd><a href="mailto:{$customer->email}"><i class="icon-envelope-o"></i> {$customer->email}</a></dd>
{if $addresses.invoice->phone_mobile || $addresses.invoice->phone}
<dt>{l s='Phone'}</dt>
<dd><a href="tel:{if $addresses.invoice->phone_mobile}{$addresses.invoice->phone_mobile}{else}{$addresses.invoice->phone}{/if}"><i class="icon-envelope-o"></i> {if $addresses.invoice->phone_mobile}{$addresses.invoice->phone_mobile}{else}{$addresses.invoice->phone}{/if}</a></dd><br>
{/if}
</dl>
{else}
<div class="alert alert-warning">
{l s='A registered customer account has already claimed this email address'}
</div>
{/if}
{else}
<dl class="panel list-detail">
<dt>{l s='Email'}</dt>
<dd><a href="mailto:{$customer->email}"><i class="icon-envelope-o"></i> {$customer->email}</a></dd><br>
{if $addresses.invoice->phone_mobile || $addresses.invoice->phone}
<dt>{l s='Phone'}</dt>
<dd><a href="tel:{if $addresses.invoice->phone_mobile}{$addresses.invoice->phone_mobile}{else}{$addresses.invoice->phone}{/if}"><i class="icon-envelope-o"></i> {if $addresses.invoice->phone_mobile}{$addresses.invoice->phone_mobile}{else}{$addresses.invoice->phone}{/if}</a></dd><br>
{/if}
<dt>{l s='Account registered'}</dt>
<dd class="text-muted"><i class="icon-calendar-o"></i> {dateFormat date=$customer->date_add full=true}</dd>
<!-- <dt>{l s='Valid orders placed'}</dt>
<dd><span class="badge">{$customerStats['nb_orders']|intval}</span></dd>
<dt>{l s='Total spent since registration'}</dt>
<dd><span class="badge badge-success">{displayPrice price=Tools::ps_round(Tools::convertPrice($customerStats['total_orders'], $currency), 2) currency=$currency->id}</span></dd>
{if Configuration::get('PS_B2B_ENABLE')}
<dt>{l s='Siret'}</dt>
<dd>{$customer->siret}</dd>
<dt>{l s='APE'}</dt>
<dd>{$customer->ape}</dd>
{/if} -->
</dl>
{if $customerGuestDetail}
<div class="panel">
<div class="panel-heading">
{l s='Traveller detail'}
</div>
<dl id="customer-guest-details">
<dt>{l s='Name'}</dt>
<dd class="guest_name">{$customerGuestDetail->gender->name} {$customerGuestDetail->firstname} {$customerGuestDetail->lastname}</dd>
<br>
<dt>{l s='Email'}</dt>
<dd class="guest_email"><a href="mailto:{$customerGuestDetail->email}"><i class="icon-envelope-o"></i> {$customerGuestDetail->email}</a></dd><br>
<dt>{l s='Phone'}</dt>
<dd class="guest_phone"><a href="tel:{$customerGuestDetail->phone}"><i class="icon-envelope-o"></i> {$customerGuestDetail->phone}</a></dd>
<div class="text-right">
<button id="edit_guest_details" class="btn btn-default">
<i class="icon-pencil"></i>
{l s='Edit'}
</button>
</div>
</dl>
<form id="customer-guest-details-form" style="display:none">
<dl>
<dt>{l s='Social title'}</dt>
<dd>
<select name="id_gender">
{foreach from=$genders key=k item=gender}
<option value="{$gender->id_gender}"{if $customerGuestDetail->id_gender == $gender->id_gender} selected="selected"{/if}>{$gender->name}</option>
{/foreach}
</select>
</dd><br>
<dt>{l s='First name'}</dt>
<dd>
<input type="text" value="{$customerGuestDetail->firstname}" name="firstname">
</dd><br>
<dt>{l s='Last name'}</dt>
<dd>
<input type="text" value="{$customerGuestDetail->lastname}" name="lastname">
</dd><br>
<dt>{l s='Email'}</dt>
<dd>
<input type="text" value="{$customerGuestDetail->email}" name="email">
</dd><br>
<dt>{l s='Phone'}</dt>
<dd>
<input type="text" value="{$customerGuestDetail->phone}" name="phone">
</dd>
</dl>
<div class="text-right">
<button id="cancle_edit_guest_details" class="btn btn-default">
<i class="icon-remove"></i>
{l s='cancel'}
</button>
<button id="submit_guest_details" class="btn btn-default">
<i class="icon-save"></i>
{l s='Save'}
</button>
</div>
</form>
</div>
{/if}
{/if}
</div>
<div class="col-xs-6">
<div class="form-group hidden-print">
<a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={getAdminToken tab='AdminCustomers'}" class="btn btn-default btn-block">{l s='View full details...'}</a>
</div>
<div class="panel panel-sm">
<div class="panel-heading">
<i class="icon-eye-slash"></i>
{l s='Private note'}
</div>
<form id="customer_note" class="form-horizontal" action="ajax.php" method="post" onsubmit="saveCustomerNote({$customer->id});return false;" >
<div class="form-group">
<div class="col-lg-12">
<textarea name="note" id="noteContent" class="textarea-autosize" onkeyup="$(this).val().length > 0 ? $('#submitCustomerNote').removeAttr('disabled') : $('#submitCustomerNote').attr('disabled', 'disabled')">{$customer->note}</textarea>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<button type="submit" id="submitCustomerNote" class="btn btn-default pull-right" disabled="disabled">
<i class="icon-save"></i>
{l s='Save'}
</button>
</div>
</div>
<span id="note_feedback"></span>
</form>
</div>
</div>
</div>
{/if}
<!-- Tab nav -->
<div class="row" style="display:none">
<ul class="nav nav-tabs" id="tabAddresses">
<li class="active">
<a href="#addressShipping">
<i class="icon-truck"></i>
{l s='Shipping address'}
</a>
</li>
<li>
<a href="#addressInvoice">
<i class="icon-file-text"></i>
{l s='Invoice address'}
</a>
</li>
</ul>
<!-- Tab content -->
<div class="tab-content panel">
<!-- Tab status -->
<div class="tab-pane in active" id="addressShipping">
<!-- Addresses -->
<h4 class="visible-print">{l s='Shipping address'}</h4>
{if !$order->isVirtual()}
<!-- Shipping address -->
{if $can_edit}
<form class="form-horizontal hidden-print" method="post" action="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&vieworder&id_order={$order->id|intval}">
<div class="form-group">
<div class="col-lg-9">
<select name="id_address">
{foreach from=$customer_addresses item=address}
<option value="{$address['id_address']}"
{if $address['id_address'] == $order->id_address_delivery}
selected="selected"
{/if}>
{$address['alias']} -
{$address['address1']}
{$address['postcode']}
{$address['city']}
{if !empty($address['state'])}
{$address['state']}
{/if},
{$address['country']}
</option>
{/foreach}
</select>
</div>
<div class="col-lg-3">
<button class="btn btn-default" type="submit" name="submitAddressShipping"><i class="icon-refresh"></i> {l s='Change'}</button>
</div>
</div>
</form>
{/if}
<div class="well">
<div class="row">
<div class="col-sm-6">
<a class="btn btn-default pull-right" href="?tab=AdminAddresses&id_address={$addresses.delivery->id}&addaddress&realedit=1&id_order={$order->id}&address_type=1&token={getAdminToken tab='AdminAddresses'}&back={$smarty.server.REQUEST_URI|urlencode}">
<i class="icon-pencil"></i>
{l s='Edit'}
</a>
{displayAddressDetail address=$addresses.delivery newLine='<br />'}
{if $addresses.delivery->other}
<hr />{$addresses.delivery->other}<br />
{/if}
</div>
</div>
</div>
{/if}
</div>
<div class="tab-pane " id="addressInvoice">
<!-- Invoice address -->
<h4 class="visible-print">{l s='Invoice address'}</h4>
{if $can_edit}
<form class="form-horizontal hidden-print" method="post" action="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&vieworder&id_order={$order->id|intval}">
<div class="form-group">
<div class="col-lg-9">
<select name="id_address">
{foreach from=$customer_addresses item=address}
<option value="{$address['id_address']}"
{if $address['id_address'] == $order->id_address_invoice}
selected="selected"
{/if}>
{$address['alias']} -
{$address['address1']}
{$address['postcode']}
{$address['city']}
{if !empty($address['state'])}
{$address['state']}
{/if},
{$address['country']}
</option>
{/foreach}
</select>
</div>
<div class="col-lg-3">
<button class="btn btn-default" type="submit" name="submitAddressInvoice"><i class="icon-refresh"></i> {l s='Change'}</button>
</div>
</div>
</form>
{/if}
<div class="well">
<div class="row">
<div class="col-sm-6">
<a class="btn btn-default pull-right" href="?tab=AdminAddresses&id_address={$addresses.invoice->id}&addaddress&realedit=1&id_order={$order->id}&address_type=2&back={$smarty.server.REQUEST_URI|urlencode}&token={getAdminToken tab='AdminAddresses'}">
<i class="icon-pencil"></i>
{l s='Edit'}
</a>
{displayAddressDetail address=$addresses.invoice newLine='<br />'}
{if $addresses.invoice->other}
<hr />{$addresses.invoice->other}<br />
{/if}
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$('#tabAddresses a').click(function (e) {
e.preventDefault()
$(this).tab('show')
})
</script>
</div>
<div class="panel">
<div class="panel-heading">
<i class="icon-envelope"></i> {l s='Messages'} <span class="badge">{sizeof($customer_thread_message)}</span>
</div>
{if (sizeof($messages))}
<div class="panel panel-highlighted">
<div class="message-item">
{foreach from=$messages item=message}
<div class="message-avatar">
<div class="avatar-md">
<i class="icon-user icon-2x"></i>
</div>
</div>
<div class="message-body">
<span class="message-date"> <i class="icon-calendar"></i>
{dateFormat date=$message['date_add']} -
</span>
<h4 class="message-item-heading">
{if ($message['elastname']|escape:'html':'UTF-8')}{$message['efirstname']|escape:'html':'UTF-8'}
{$message['elastname']|escape:'html':'UTF-8'}{else}{$message['cfirstname']|escape:'html':'UTF-8'} {$message['clastname']|escape:'html':'UTF-8'}
{/if}
{if ($message['private'] == 1)}
<span class="badge badge-info">{l s='Private'}</span>
{/if}