Merge branch 'b-3.6.1' into mebil
[kivitendo-erp.git] / templates / webpages / wh / report_filter.html
1 [%- USE T8 %]
2 [%- USE L %]
3 [%- USE P %]
4 [%- USE LxERP %]
5 [%- USE HTML %][%- USE JavaScript %]
6 <h1>[% 'Report about warehouse contents' | $T8 %]</h1>
7
8  <script type="text/javascript">
9    <!--
10       warehouses = new Array();
11       warehouses[0] = new Array();
12       warehouses[0]['id'] = "0";
13       warehouses[0]['bins'] = new Array();
14       warehouses[0]['bins'][0] = new Array();
15       warehouses[0]['bins'][0]['description'] = "---";
16       warehouses[0]['bins'][0]['id'] = "";
17       [%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH warehouse = WAREHOUSES_it %]
18       warehouses[[% WAREHOUSES_it.count %]] = new Array();
19       warehouses[[% WAREHOUSES_it.count %]]['id'] = [% warehouse.id %];
20       warehouses[[% WAREHOUSES_it.count %]]['bins'] = new Array();
21       warehouses[[% WAREHOUSES_it.count %]]['bins'][0] = new Array();
22       warehouses[[% WAREHOUSES_it.count %]]['bins'][0]['description'] = "---";
23       warehouses[[% WAREHOUSES_it.count %]]['bins'][0]['id'] = "";
24       [% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
25       warehouses[[% WAREHOUSES_it.count %]]['bins'][[% BINS_it.count %]] = new Array();
26       warehouses[[% WAREHOUSES_it.count %]]['bins'][[% BINS_it.count %]]['description'] = "[% JavaScript.escape(bin.description) %]";
27       warehouses[[% WAREHOUSES_it.count %]]['bins'][[% BINS_it.count %]]['id'] = [% bin.id %];
28       [% END %]
29       [% END %]
30
31       function warehouse_selected(warehouse_id, bin_id) {
32         var control = document.getElementById("bin_id");
33
34         for (var i = control.options.length - 1; i >= 0; i--) {
35           control.options[i] = null;
36         }
37
38         var warehouse_index = 0;
39
40         for (i = 0; i < warehouses.length; i++)
41           if (warehouses[i]['id'] == warehouse_id) {
42             warehouse_index = i;
43             break;
44           }
45
46         var warehouse = warehouses[warehouse_index];
47         var bin_index = 0;
48
49         for (i = 0; i < warehouse['bins'].length; i++)
50           if (warehouse['bins'][i]['id'] == bin_id) {
51             bin_index = i;
52             break;
53           }
54
55         for (i = 0; i < warehouse['bins'].length; i++) {
56           control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
57         }
58
59
60         control.options[bin_index].selected = true;
61       }
62
63       $(function () {
64         warehouse_selected(0, 0);
65         document.Form.partnumber.focus();
66       });
67      -->
68  </script>
69
70  <form method="post" name="Form" action="wh.pl" id="form">
71
72   <input type="hidden" name="nextsub" value="generate_report">
73
74    <table>
75     <tr>
76      <th class="listheading" align="left" valign="top" colspan="6" nowrap>[% 'Filter' | $T8 %]</th>
77     </tr>
78
79     <tr>
80      <td>
81       <table>
82        <tr>
83         <th align="right" nowrap>[% 'Warehouse' | $T8 %]:</th>
84         <td>
85          <select name="warehouse_id" id="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
86           <option value="">---</option>
87           [%- FOREACH warehouse = WAREHOUSES %]
88           <option value="[% HTML.escape(warehouse.id) %]">[% warehouse.description %]</option>
89           [%- END %]
90          </select>
91         </td>
92        </tr>
93        <tr>
94         <th align="right" nowrap>[% 'Bin' | $T8 %]:</th>
95         <td><select name="bin_id" id="bin_id"></select></td>
96        </tr>
97        <tr>
98         <th align="right" nowrap>[% 'Part Number' | $T8 %]:</th>
99         <td><input name="partnumber" size=20 value="[% partnumber %]"></td>
100        </tr>
101        <tr>
102         <th align="right" nowrap>[% 'Parts Classification' | $T8 %]:</th>
103         <td>[% P.part.select_classification('classification_id') %]</td>
104        </tr>
105        <tr>
106         <th align="right" nowrap>[% 'Part Description' | $T8 %]:</th>
107         <td><input name="description" size=40></td>
108        </tr>
109        <tr>
110         <th align="right" nowrap>[% 'Partsgroup' | $T8 %]:</th>
111         <td>[% L.select_tag('partsgroup_id', PARTSGROUPS, value_key = 'id', title_key = 'partsgroup', with_empty = 1) %]</td>
112        </tr>
113        <tr>
114         <th align="right" nowrap>[% 'Charge Number' | $T8 %]:</th>
115         <td><input name="chargenumber" size=40></td>
116        </tr>
117        [% IF INSTANCE_CONF.get_show_bestbefore %]
118        <tr>
119         <th align="right" nowrap>[% 'Best Before' | $T8 %]:</th>
120         <td>
121           [% L.date_tag('bestbefore') %]
122         </td>
123        </tr>
124        [% END %]
125        <tr>
126         <th align="right" nowrap>[% 'Qty in stock' | $T8 %]:</th>
127         <td>
128          <select name="qty_op">
129           <option value="dontcare">---</option>
130           <option value="atleast">[% 'At least' | $T8 %]</option>
131           <option value="atmost">[% 'At most' | $T8 %]</option>
132           <option value="exact">[% 'Exact' | $T8 %]</option>
133          </select>
134          <input name="qty">
135          <select name="qty_unit">
136           [%- FOREACH unit = UNITS %]<option>[% unit.name %]</option>[% END %]
137          </select>
138         </td>
139        </tr>
140        <tr>
141         <th align="right" nowrap>[% 'Stock Qty for Date' | $T8 %]:</th>
142         <td>[% L.date_tag('date') %]</td>
143        </tr>
144         <tr>
145         <th align="right">
146           [% "basis for stock value" | $T8 %]:
147         </th>
148         <td align="left">
149          [% L.radio_button_tag("stock_value_basis", value='purchase_price', checked=1, label=LxERP.t8('Purchase price')) %]
150          [% L.radio_button_tag("stock_value_basis", value='list_price',     checked=0, label=LxERP.t8('List Price')) %]
151         </td>
152        </tr>
153        <tr>
154         <th align="right">
155           [% "List all rows" | $T8 %]:
156         </th>
157         <td align="left">
158          [% L.yes_no_tag("allrows", 1) %]
159         </td>
160        </tr>
161        <tr>
162         <th align="right">
163           [% "Results per page" | $T8 %]:
164         </th>
165         <td align="left">
166          [% L.input_number_tag("per_page", 20, size=4) %]
167         </td>
168        </tr>
169        [% CUSTOM_VARIABLES_FILTER_CODE %]
170       </table>
171      </td>
172     </tr>
173
174     <tr height="5"><td>&nbsp;</td></tr>
175
176     <tr>
177      <th class="listheading" align="left" valign="top" colspan="6" nowrap>[% 'Include in Report' | $T8 %]</th>
178     </tr>
179
180     <tr>
181      <td>
182       <input name="l_partdescription" type="hidden" value="Y">
183       <input name="l_qty" type="hidden" value="Y">
184
185       <table>
186        <tr>
187         <td align="right"><input name="l_warehousedescription" id="l_warehousedescription" class="checkbox" type="checkbox" value="Y" checked></td>
188         <td nowrap><label for="l_warehousedescription">[% 'Warehouse' | $T8 %]</label></td>
189         <td align="right"><input name="l_bindescription" id="l_bindescription" class="checkbox" type="checkbox" value="Y" checked></td>
190         <td nowrap><label for="l_bindescription">[% 'Bin' | $T8 %]</label></td>
191        </tr>
192
193        <tr>
194         <td align="right"><input name="l_partnumber" id="l_partnumber" class="checkbox" type="checkbox" value="Y" checked></td>
195         <td nowrap><label for="l_partnumber">[% 'Part Number' | $T8 %]</label></td>
196         <td align="right"><input name="l_chargenumber" id="l_chargenumber" class="checkbox" type="checkbox" value="Y" checked></td>
197         <td nowrap><label for="l_chargenumber">[% 'Charge Number' | $T8 %]</label></td>
198         [% IF INSTANCE_CONF.get_show_bestbefore %]
199         <td align="right"><input name="l_bestbefore" id="l_bestbefore" class="checkbox" type="checkbox" value="Y" checked></td>
200         <td nowrap><label for="l_bestbefore">[% 'Best Before' | $T8 %]</label></td>
201         [% END %]
202        </tr>
203
204        <tr><td colspan="6"><hr noshade height="1"></td></tr>
205
206        <tr>
207         <td align="right"><input name="subtotal" id="subtotal" class="checkbox" type="checkbox" value="Y"></td>
208         <td nowrap><label for="subtotal">[% 'Subtotal' | $T8 %]</label></td>
209         <td align="right"><input name="include_empty_bins" id="include_empty_bins" class="checkbox" type="checkbox" value="Y"></td>
210         <td nowrap><label for="include_empty_bins">[% 'Include empty bins' | $T8 %]</label></td>
211         <td align="right"><input name="include_invalid_warehouses" id="include_invalid_warehouses" class="checkbox" type="checkbox" value="Y"></td>
212         <td nowrap><label for="include_invalid_warehouses">[% 'Include invalid warehouses ' | $T8 %]</label></td>
213        </tr>
214
215        <tr>
216         <td align="right"><input name="l_stock_value" id="l_stock_value" class="checkbox" type="checkbox" value="Y"></td>
217         <td nowrap><label for="l_stock_value">[% 'Stock value' | $T8 %]</label></td>
218         <td align="right"><input name="l_purchase_price" id="l_purchase_price" class="checkbox" type="checkbox" value="Y"></td>
219         <td nowrap><label for="l_purchase_price">[% 'Purchase price' | $T8 %]</label></td>
220         <td align="right"><input name="l_list_price" id="l_list_price" class="checkbox" type="checkbox" value="Y"></td>
221         <td nowrap><label for="l_list_price">[% 'List Price' | $T8 %]</label></td>
222        </tr>
223       </table>
224       <table>
225        [% CUSTOM_VARIABLES_INCLUSION_CODE %]
226       </table>
227      </td>
228     </tr>
229    </table>
230  </form>