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