11dfbf609c8747551a1b83ca60418ebf5cfd20b5
[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     <th>[% LxERP.t8('Other Matches') %]</th>
16     <th>[% LxERP.t8('Price') %]</th>
17     [%- IF IS_PURCHASE %]
18      <th>[% LxERP.t8('ROP') %]</th>
19     [%- END %]
20     <th>[% LxERP.t8('Qty') %]</th>
21     <th>[% LxERP.t8('Unit') %]</th>
22    </tr>
23
24    [%- FOREACH item = ITEM_LIST %]
25    <tr class="listrow[% loop.count % 2 %]">
26     [%- IF myconfig_item_multiselect %]
27       <td>[% L.input_tag('select_qty_' _ HTML.escape(item.id), '', size => 5) %]</td>
28     [%- ELSE %]
29       <td><input name="select_item_id" class="radio" type="radio" value="[% HTML.escape(item.id) %]"[% IF loop.first %] checked[% END %]></td>
30     [%- END %]
31     <td>[% HTML.escape(item.partnumber) %]</td>
32     <td>[% HTML.escape(item.description) %]</td>
33     <td>[% HTML.escape(item.matches).join('<br>') %]</td>
34     <td align="right">[% LxERP.format_amount(item.display_sellprice, 2) %]</td>
35     [%- IF IS_PURCHASE %]
36      <td align="right">[% LxERP.format_amount(item.rop, '') %]</td>
37     [%- END %]
38     <td align="right">[% LxERP.format_amount(item.onhand, '') %]</td>
39     <td>[% HTML.escape(item.unit) %]</td>
40    </tr>
41    [%- END %]
42
43    <tr><td colspan="8"><hr size="3" noshade></td></tr>
44   </table>
45
46   [% L.hidden_tag('select_item_mode', MODE) %]
47   [% L.hidden_tag('select_item_previous_form', PREVIOUS_FORM) %]
48   [% L.hidden_tag('nextsub', 'item_selected') %]
49
50   [% L.submit_tag('action', LxERP.t8('Continue')) %]
51  </form>
52
53 [%- IF myconfig_item_multiselect %]
54  <script type='text/javascript'>
55    var first_click = 1;;
56    [%- FOREACH item = ITEM_LIST %]
57      [% SET THIS_ID = 'select_qty_' _ HTML.escape(item.id) %]
58      $('#[% THIS_ID %]').click(function(){
59        var qty = '1';
60        if (first_click) {
61          qty = '[% LxERP.format_amount(PRE_ENTERED_QTY, 5) %]';
62        }
63        first_click = 0;
64        if ($('#[% THIS_ID %]').attr('value') == '') {
65          $('#[% THIS_ID %]').attr('value', qty); $('#[% THIS_ID %]').select();
66        }
67      });
68    [%- END %]
69  </script>
70 [%- END %]