Revert "Artikel-Klassifizierung"
[kivitendo-erp.git] / templates / webpages / io / select_item.html
1 [% USE LxERP %][% USE HTML %][% USE L %][% USE P %]
2 [% SET COLS = 8 %]
3 <h1>[% title %]</h1>
4
5  <form method="post" action="[% HTML.escape(script) %]">
6
7   <table width="100%">
8    <tr class="listheading">
9     [%- IF MYCONFIG.item_multiselect %]
10       <th>[% LxERP.t8('Qty') %]</th>
11     [%- ELSE %]
12       <th>&nbsp;</th>
13     [%- END %]
14     <th>[% LxERP.t8('Number') %]</th>
15     <th>[% LxERP.t8('Part Description') %]</th>
16     [%- IF INSTANCE_CONF.get_show_longdescription_select_item %]
17       [% SET COLS = COLS + 1 %]
18       <th>[% LxERP.t8('Long Description') %]</th>
19     [%- END %]
20     <th>[% LxERP.t8('Other Matches') %]</th>
21     <th>[% LxERP.t8('Price') %]</th>
22     [%- IF IS_PURCHASE %]
23       [% SET COLS = COLS + 1 %]
24      <th>[% LxERP.t8('ROP') %]</th>
25     [%- END %]
26     <th>[% LxERP.t8('Qty') %]</th>
27     <th>[% LxERP.t8('Unit') %]</th>
28    </tr>
29
30    [%- FOREACH item = ITEM_LIST %]
31    <tr class="listrow[% loop.count % 2 %]">
32     [%- IF MYCONFIG.item_multiselect %]
33       <td>[% L.input_tag('select_qty_' _ HTML.escape(item.id), '', size => 5) %]</td>
34     [%- ELSE %]
35       <td><input name="select_item_id" class="radio" type="radio" value="[% HTML.escape(item.id) %]"[% IF loop.first %] checked[% END %]></td>
36     [%- END %]
37     <td>[% HTML.escape(item.partnumber) %]</td>
38     <td>[% HTML.escape(item.description) %]</td>
39     [%- IF INSTANCE_CONF.get_show_longdescription_select_item %]
40       <td>[% P.restricted_html(item.longdescription) %]</td>
41     [%- END %]
42     <td>[% HTML.escape(item.matches).join('<br>') %]</td>
43     <td align="right">[% LxERP.format_amount(item.display_sellprice, 2) %]</td>
44     [%- IF IS_PURCHASE %]
45      <td align="right">[% LxERP.format_amount(item.rop, '') %]</td>
46     [%- END %]
47     <td align="right">[% LxERP.format_amount(item.onhand, '') %]</td>
48     <td>[% HTML.escape(item.unit) %]</td>
49    </tr>
50    [%- END %]
51
52    <tr><td colspan="[% COLS %]"><hr size="3" noshade></td></tr>
53   </table>
54
55   [% L.hidden_tag('select_item_mode', MODE) %]
56   [% L.hidden_tag('select_item_previous_form', PREVIOUS_FORM) %]
57   [% L.hidden_tag('nextsub', 'item_selected') %]
58
59   [% L.submit_tag('action', LxERP.t8('Continue')) %]
60  </form>
61
62 [%- IF MYCONFIG.item_multiselect %]
63  <script type='text/javascript'>
64    var first_click = 1;;
65    [%- FOREACH item = ITEM_LIST %]
66      [% SET THIS_ID = 'select_qty_' _ HTML.escape(item.id) %]
67      $('#[% THIS_ID %]').click(function(){
68        var qty = '1';
69        if (first_click) {
70          qty = '[% LxERP.format_amount(PRE_ENTERED_QTY, 5) %]';
71        }
72        first_click = 0;
73        if ($('#[% THIS_ID %]').attr('value') == '') {
74          $('#[% THIS_ID %]').attr('value', qty); $('#[% THIS_ID %]').select();
75        }
76      });
77    [%- END %]
78  </script>
79 [%- END %]