Part Picker
[kivitendo-erp.git] / templates / webpages / part / _part_picker_result.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE L %]
4 [%- USE LxERP %]
5
6 [%# L.dump(SELF.parts) %]
7
8 [% FOREACH part = SELF.parts %]
9   [% PROCESS part_block %]
10 [% END %]
11
12 [%- BLOCK part_block %]
13 <div class='part_picker_part'>
14   <input type='hidden' class='part_picker_id' value='[% part.id %]'>
15   <input type='hidden' class='part_picker_partnumber' value='[% part.partnumber %]'>
16   <input type='hidden' class='part_picker_description' value='[% part.description %]'>
17   <span style='float:left'>[% part.partnumber | html %]</span>
18   <span style='float:right; font-weight:bold'>[% part.description | html %]</span>
19   <div style='clear:both;'></div>
20   [% 'Sellprice' | $T8 %]: [% part.sellprice_as_number | html %]
21 </div>
22 [%- END %]
23
24 <div style='clear:both'></div>
25
26 [% L.paginate_controls(target='#part_picker_result', selector='#part_picker_result') %]
27
28 <script type='text/javascript'>
29   $('div.part_picker_part').each(function(){
30     $(this).click(function(){
31       var real_id = $('#part_picker_real_id').val();
32       var $dummy  = $('#' + real_id + '_name');
33       var $real   = $('#' + real_id);
34
35       $dummy.val($(this).children('input.part_picker_description').val());
36       $real.val($(this).children('input.part_picker_id').val());
37
38       $('#part_selection').jqmClose();
39
40       return true;
41     });
42   });
43 </script>