1 |
198 |
ahitrov |
<style> |
2 |
|
|
|
3 |
|
|
.number { text-align:right; padding-right:5px; } |
4 |
|
|
.blue { color:blue; } |
5 |
|
|
input.text { border:1px solid gray; } |
6 |
|
|
|
7 |
|
|
</style> |
8 |
777 |
ahitrov |
% if ( @$basket ) { |
9 |
198 |
ahitrov |
<form action="recount.html" method="post"> |
10 |
|
|
<table width="100%" border="0" cellpadding="4" cellspacing="0" class="tlistdocs" bgcolor="white"> |
11 |
|
|
<tr bgcolor="#efefef"> |
12 |
|
|
<th><% $context ? ' ' : '<img src="/contenido/i/actions/delete.gif">' %></th> |
13 |
|
|
<th>Артикул</th> |
14 |
776 |
ahitrov |
<th>1С</th> |
15 |
198 |
ahitrov |
<th>Название</th> |
16 |
|
|
<th>Цвет</th> |
17 |
256 |
ahitrov |
<th>Размер</th> |
18 |
198 |
ahitrov |
<th>Цена</th> |
19 |
|
|
<th>Кол-во</th> |
20 |
|
|
<th>Сумма</th> |
21 |
|
|
</tr> |
22 |
|
|
|
23 |
777 |
ahitrov |
% foreach my $obj ( @$basket ) { |
24 |
198 |
ahitrov |
% $total_num += $obj->number; |
25 |
|
|
% $total_sum += $obj->number * $obj->price; |
26 |
|
|
<tr><td>\ |
27 |
|
|
% if ( $context ) { |
28 |
|
|
\ |
29 |
|
|
% } else { |
30 |
|
|
<input type="checkbox" name="delete" value="<% $obj->id %>">\ |
31 |
|
|
% } |
32 |
|
|
</td> |
33 |
|
|
<td><% $obj->articul %></td> |
34 |
777 |
ahitrov |
<td><% exists $obj->{item} ? $obj->{item}->ext_id : '' %></td> |
35 |
256 |
ahitrov |
<td><a href="/contenido/document.html?class=<% $obj->class %>&id=<% $obj->id %>" target="_blank"><% $obj->name %></a></td> |
36 |
|
|
<td><% $obj->colour || ' ' %></td> |
37 |
|
|
<td><% $obj->size || ' ' %></td> |
38 |
198 |
ahitrov |
% if ( $context ) { |
39 |
|
|
<td class="number"><% $obj->price %></td> |
40 |
|
|
<td class="number"><% $obj->number %></td> |
41 |
|
|
% } else { |
42 |
|
|
<td class="number"><input type="text" class="text number" size="8" name="item_<% $obj->id %>.price" value="<% $obj->price %>"></td> |
43 |
|
|
<td class="number"><input type="text" class="text number" size="5" name="item_<% $obj->id %>.num" value="<% $obj->number %>"></td> |
44 |
|
|
% } |
45 |
|
|
<td class="number"><% $obj->number * $obj->price %></td> |
46 |
|
|
</tr> |
47 |
|
|
% } |
48 |
|
|
|
49 |
|
|
<tr> |
50 |
664 |
ahitrov |
<td colspan="6" align="right"><b>Итого товаров</b></td> |
51 |
198 |
ahitrov |
<td class="number"><b class="blue"><% $total_num %></b></td> |
52 |
|
|
<td class="number"><b class="blue"><% $total_sum %></b></td> |
53 |
|
|
</tr> |
54 |
|
|
<tr> |
55 |
664 |
ahitrov |
<td colspan="6" align="right"><b>Доставка</b></td> |
56 |
198 |
ahitrov |
<td class="number" colspan="2"><b class="blue"><% $order->sum_delivery %></b></td> |
57 |
|
|
</tr> |
58 |
|
|
<tr> |
59 |
664 |
ahitrov |
<td colspan="6" align="right"><b>Скидка</b></td> |
60 |
270 |
ahitrov |
<td class="number" colspan="2"><b class="blue"><% $order->sum_discount || 0 %></b></td> |
61 |
|
|
</tr> |
62 |
|
|
<tr> |
63 |
664 |
ahitrov |
<td colspan="6" align="right"><b>Итого с доставкой</b></td> |
64 |
270 |
ahitrov |
<td class="number" colspan="2"><b class="blue"><% $order->sum_total %></b></td> |
65 |
198 |
ahitrov |
</tr> |
66 |
|
|
|
67 |
|
|
</table> |
68 |
|
|
% unless ( $context ) { |
69 |
|
|
<div class="number"><input type="submit" name="update" value="Пересчитать" class="input_btn"></div> |
70 |
|
|
% } |
71 |
|
|
% if ( ref $filter_params eq 'HASH' ) { |
72 |
|
|
% while ( my ($key, $value) = each %$filter_params ) { |
73 |
|
|
% next if grep { $_->{attr} eq $key } $order->structure(); |
74 |
|
|
<input type="hidden" name="<% $key %>" value="<% $value %>"> |
75 |
|
|
% } |
76 |
|
|
% } |
77 |
|
|
<input type="hidden" name="id" value="<% $order->id %>"> |
78 |
270 |
ahitrov |
</form> |
79 |
198 |
ahitrov |
|
80 |
270 |
ahitrov |
% if ( @coupons ) { |
81 |
|
|
<table width="100%" border="0" cellpadding="4" cellspacing="0" class="tlistdocs" bgcolor="white"> |
82 |
|
|
<tr bgcolor="#efefef"> |
83 |
|
|
<th>Использованные купоны</th> |
84 |
|
|
<th>Скидка</th> |
85 |
|
|
</tr> |
86 |
198 |
ahitrov |
|
87 |
270 |
ahitrov |
% foreach my $coupon ( @coupons ) { |
88 |
|
|
<tr> |
89 |
|
|
<td><% $coupon->code %></td> |
90 |
|
|
<td class="number" colspan="2"><b class="blue"><% $coupon->discount %></b></td> |
91 |
|
|
</tr> |
92 |
|
|
% } |
93 |
|
|
|
94 |
|
|
</table> |
95 |
|
|
% } |
96 |
|
|
|
97 |
198 |
ahitrov |
% } else { |
98 |
|
|
<div style="color:red; font-size:110%; margin:20px 0;">Заказ пустой</div> |
99 |
|
|
% } |
100 |
|
|
<%args> |
101 |
|
|
|
102 |
|
|
$order => undef |
103 |
|
|
$filter_params => undef |
104 |
|
|
$context => undef |
105 |
|
|
|
106 |
|
|
</%args> |
107 |
|
|
<%init> |
108 |
|
|
|
109 |
|
|
return unless ref $order; |
110 |
777 |
ahitrov |
my $basket = $keeper->{webshop}->get_basket( |
111 |
|
|
order_id => $order->id, |
112 |
|
|
status => 1, |
113 |
|
|
with_products => 1, |
114 |
|
|
) // []; |
115 |
198 |
ahitrov |
my $total_sum = 0; |
116 |
|
|
my $total_num = 0; |
117 |
|
|
|
118 |
270 |
ahitrov |
my @coupons = $keeper->get_documents ( |
119 |
|
|
class => 'webshop::Coupon', |
120 |
|
|
lclass => 'webshop::OrderCouponLink', |
121 |
|
|
lsource => $order->id, |
122 |
|
|
) if $order->sum_discount; |
123 |
|
|
|
124 |
198 |
ahitrov |
</%init> |