4 [%- USE JavaScript %][%- USE P -%]
7 <script type="text/javascript">
9 warehouses = new Array();
10 [%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH warehouse = WAREHOUSES_it %]
11 warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
12 warehouses[[% WAREHOUSES_it.count - 1 %]]['id'] = [% warehouse.id %];
13 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'] = new Array();
14 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0] = new Array();
15 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0]['description'] = "---";
16 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0]['id'] = "";
17 [% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
18 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]] = new Array();
19 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]]['description'] = "[% JavaScript.escape(bin.description) %]";
20 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]]['id'] = [% bin.id %];
24 function warehouse_selected(warehouse_id, bin_id) {
25 var control = document.getElementById("bin_id");
27 for (var i = control.options.length - 1; i >= 0; i--) {
28 control.options[i] = null;
31 var warehouse_index = 0;
33 for (i = 0; i < warehouses.length; i++)
34 if (warehouses[i]['id'] == warehouse_id) {
39 var warehouse = warehouses[warehouse_index];
42 for (i = 0; i < warehouse['bins'].length; i++)
43 if (warehouse['bins'][i]['id'] == bin_id) {
48 for (i = 0; i < warehouse['bins'].length; i++) {
49 control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
53 control.options[bin_index].selected = true;
57 warehouse_selected(0, 0);
58 document.Form.part_id_name.focus();
63 <form name="Form" method="post" action="wh.pl" id="form">
65 [% IF saved_message %]
66 <p>[% saved_message %]</p>
70 [% 'If you enter values for the part number and / or part description then only those bins containing parts whose part number or part description match your input will be shown.' | $T8 %]
76 <th align="right" nowrap>[% 'Transfer from warehouse' | $T8 %]:</th>
78 <select name="warehouse_id" id="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
79 [%- FOREACH warehouse = WAREHOUSES %]
80 <option value="[% HTML.escape(warehouse.id) %]">[% warehouse.description %]</option>
87 <th align="right" nowrap>[% 'Bin' | $T8 %]:</th>
88 <td><select id="bin_id" name="bin_id"></select></td>
92 <th align="right" nowrap>[% 'Limit part selection' | $T8 %]:</th>
97 <th align="right" nowrap>[% 'Part' | $T8 %]</th>
99 [% P.part.picker("part_id", parts_id, size="30", part_type="part,assembly") %]
104 <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
105 <td><input name="chargenumber" size="30"></td>
108 [% IF INSTANCE_CONF.get_show_bestbefore %]
110 <th align="right" nowrap>[% 'Best Before' | $T8 %]</th>
112 [% L.date_tag('bestbefore') %]
118 <th align="right" nowrap>[% 'EAN' | $T8 %]</th>
119 <td><input name="ean" size="30"></td>