Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / part / _shop.html
1 [%- USE HTML %][%- USE L -%][%- USE P -%][%- USE LxERP -%]
2 [%- USE Dumper %]
3 [%- USE JavaScript -%]
4 <div id="shop_variables">
5  <h2>[% LxERP.t8("Active shops:") %]</h2>
6  <table width="100%">
7   <thead>
8   <tr class="listheading">
9    <th>[% LxERP.t8("Shop") %]</th>
10    <th>[% LxERP.t8("Active") %]</th>
11    <th>[% LxERP.t8("Shop part") %]</th>
12    <th>[% LxERP.t8("Price source") %]</th>
13    <th>[% LxERP.t8("Price") %]</th>
14    <th>[% LxERP.t8("Stock Local/Shop") %]</th>
15    <th>[% LxERP.t8("Last update") %]</th>
16    <th>[% LxERP.t8("Action") %]</th>
17    <th>[% LxERP.t8("Action") %]</th>
18    <th>[% LxERP.t8("Action") %]</th>
19   </tr>
20   </thead>
21   [%#  L.dump(SELF.part) %]
22   [%- FOREACH shop_part = SELF.part.shop_parts %]
23   [% IF !shop_part.shop.obsolete %]
24
25   <tr class="listrow">
26    <td>[% HTML.escape( shop_part.shop.description ) %]</td>
27    <td>[% L.html_tag('span', shop_part.active, id => 'shop_part_active_' _ shop_part.id ) %]</td>
28    <td>
29     [% IF shop_part.shop.use_part_longdescription %]
30       [% L.html_tag('span', shop_part.part.notes, id => 'shop_part_description_' _ shop_part.id ) %]
31     [% ELSE %]
32       [% L.html_tag('span', shop_part.shop_description, id => 'shop_part_description_' _ shop_part.id ) %]
33     [% END %]
34   </td>
35    <td>[% L.html_tag('span',LxERP.t8(), id => 'active_price_source_' _ shop_part.id) %] </td>
36    <td>[% L.html_tag('span','Price', id => 'price_' _ shop_part.id) %]</td>
37    <td>[% L.html_tag('span','Stock', id => 'stock_' _ shop_part.id) %]</td>
38    <td>[% L.html_tag('span', shop_part.last_update.to_kivitendo('precision' => 'minute'), id => 'shop_part_last_update_' _ shop_part.id ) %]</td>
39    <td>[% L.button_tag("kivi.ShopPart.edit_shop_part(" _ shop_part.id _ ")", LxERP.t8("Edit"))  %]</td>
40    <td>[% L.button_tag("kivi.ShopPart.update_shop_part(" _ shop_part.id _ ")", LxERP.t8("Upload"))  %]</td>
41    <td>[% L.button_tag("kivi.ShopPart.get_all_categories(" _ shop_part.id _ ")", LxERP.t8("Shopcategories"))  %]<br>
42     [% IF shop_part.shop_category %]
43       [% IF shop_part.shop_category.1.size > 1%]
44         [% FOREACH cat = shop_part.shop_category %]
45           [% HTML.escape(cat.1) %]<br>
46         [% END %]
47       [% ELSE %]
48         [% HTML.escape(shop_part.shop_category.1) %]<br>
49       [% END %]
50     [% END %]
51    </td>
52   </tr>
53   <script type="text/javascript">
54     $(function() {
55       kivi.ShopPart.update_price_n_price_source([% shop_part.id %],'[% shop_part.active_price_source %]');
56       kivi.ShopPart.update_stock([% shop_part.id %]);
57     });
58   </script>
59   [% END %]
60   [%- END %]
61   [%- FOREACH shop = SELF.shops_not_assigned %]
62   <tr>
63    <td>[% HTML.escape( shop.description ) %]</td>
64    <td></td>
65    <td></td>
66    <td></td>
67    <td></td>
68    <td></td>
69    <td>[% L.button_tag("kivi.ShopPart.create_shop_part(" _ id _ ", " _ shop.id _ ")", LxERP.t8("Add"))  %]</td>
70   </tr>
71   </thead>
72   [%- END %]
73 </table>
74
75
76 [% # L.dump(shop_part) %]
77 <h2>[% LxERP.t8("Shopimages - valid for all shops") %]</h2>
78   [%- IF shop_part.part_id %]
79     <script type="text/javascript">
80       $(function() {
81         kivi.ShopPart.show_images([% shop_part.part_id %]);
82       });
83     </script>
84     <div id="shop_images" border=1 ></div>
85   [%- ELSE %]
86     <div id="shop_images" border=1 >[% LxERP.t8('To upload images: Please create shoppart first') %]</div>
87   [%- END %]
88 </div>
89