8bcfa9202cbf725710dc248c42b3ecb06557b98a
[kivitendo-erp.git] / templates / webpages / order_items_search / order_items.html
1 [% USE HTML %]
2 [%- USE LxERP %]
3 [%- USE T8 %]
4 [%- USE L %]
5
6 [% SET size=50 %]
7 [% SET show_images=0 %]
8
9 <h1>[% title %]</h1>
10 <div style="padding-bottom: 15px">
11 [% 'Filter' | $T8 %]:
12 <form id="filter" name="filter" method="post" action="controller.pl">
13  <table>
14   </tr>
15     <td>[% 'Customer' | $T8 %]</td>
16     <td>[% L.customer_vendor_picker('filter.order.customer.id', FORM.customer_id, type='customer', class="filter", size=size) %]</td>
17   </tr>
18   <tr>
19     <td>[% 'Part' | $T8 %]</td>
20     <td>[% L.input_tag('filter.part.all:substr:multi::ilike', FORM.part, size = size, class="filter") %]</td>
21   </tr>
22   <tr>
23     <td>[% 'Order Number' | $T8 %]</td>
24     <td>[% L.input_tag('filter.order.ordnumber:substr::ilike', FORM.ordnumber, size = 10, class="filter") %]</td>
25   <tr>
26   <tr>
27     <td>[% 'Order Date' | $T8 %]</td>
28     <td>[% 'From' | $T8 %] [% L.date_tag("filter.order.transdate:date::ge", filter.order.transdate_date___ge, class="filter") %] [% 'Until' | $T8 %] [% L.date_tag('filter.order.transdate:date::le', filter.order.transdate_date__le, class="filter") %]</td>
29   <tr>
30   <tr>
31     <td>[% 'Description' | $T8 %]</td>
32     <td>[% L.input_tag('filter.description:substr::ilike', filter.description_substr__ilike, size = size, class="filter") %]</td>
33   </tr>
34   <tr>
35     <td>[% 'Long Description' | $T8 %]</td>
36     <td>[% L.input_tag('filter.longdescription:substr::ilike', filter.longdescription_substr__ilike, size = size, class="filter") %]  </tr>
37   <tr>
38     <td>[% 'Show images' | $T8 %]</td>
39     <td>[% L.checkbox_tag('show_images', checked=show_images) %]  </tr>
40   </tr>
41 </table>
42 [% L.button_tag("this.form.reset(); refresh_plot();", LxERP.t8("Reset")) %]
43 </form>
44
45 <div id="orderitems" style="padding-top: 20px">
46 [% PROCESS 'order_items_search/_order_item_list.html' %]
47 </div>
48
49
50 <script type="text/javascript">
51   $(function() {
52     [% IF FORM.customer_id %]
53       $( "#filter_part_all_substr_multi_ilike" ).focus();
54     [% ELSE %]
55       $( "#filter_order_customer_id_name" ).focus();
56     [% END %]
57
58     addInputCallback($(".filter"), refresh_plot , 300 );
59
60     $('#show_images').change(function(){
61       refresh_plot();
62     });
63   });
64
65
66   function refresh_plot() {
67     var filterdata = $('#filter').serialize()
68     var url = './controller.pl?action=OrderItem/order_item_list_dynamic_table&' + filterdata;
69     $.ajax({
70         url : url,
71         type: 'POST',
72         success: function(data){
73             $('#orderitems').html(data);
74         }
75     })
76
77   };
78
79 function addInputCallback(inputfield, callback, delay) {
80     var timer = null;
81     inputfield.on('keyup', function() {
82         if (timer) {
83             window.clearTimeout(timer);
84         }
85         timer = window.setTimeout( function() {
86             timer = null;
87             callback();
88         }, delay );
89     });
90     inputfield = null;
91 }
92 </script>