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