4 [% USE JavaScript %]<body onload="on_load();">
6 <script type="text/javascript" src="js/common.js"></script>
7 <script type="text/javascript" src="js/part_selection.js"></script>
8 <script type="text/javascript">
10 warehouses = new Array();
11 [%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH warehouse = WAREHOUSES_it %]
12 warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
13 warehouses[[% WAREHOUSES_it.count - 1 %]]['id'] = [% warehouse.id %];
14 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'] = new Array();
15 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0] = new Array();
16 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0]['description'] = "---";
17 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0]['id'] = "";
18 [% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
19 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]] = new Array();
20 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]]['description'] = "[% JavaScript.escape(bin.description) %]";
21 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]]['id'] = [% bin.id %];
25 function warehouse_selected(warehouse_id, bin_id) {
26 var control = document.getElementById("bin_id");
28 for (var i = control.options.length - 1; i >= 0; i--) {
29 control.options[i] = null;
32 var warehouse_index = 0;
34 for (i = 0; i < warehouses.length; i++)
35 if (warehouses[i]['id'] == warehouse_id) {
40 var warehouse = warehouses[warehouse_index];
43 for (i = 0; i < warehouse['bins'].length; i++)
44 if (warehouse['bins'][i]['id'] == bin_id) {
49 for (i = 0; i < warehouse['bins'].length; i++) {
50 control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
54 control.options[bin_index].selected = true;
58 warehouse_selected(0, 0);
59 document.Form.partnumber.focus();
64 <form name="Form" method="post" action="wh.pl">
66 <input type="hidden" name="nextsub" value="[% HTML.escape(nextsub) %]">
68 [% IF saved_message %]
69 <p>[% saved_message %]</p>
72 <div class="listtop">[% title %]</div>
75 [% '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 %]
81 <th align="right" nowrap>[% 'Transfer from warehouse' | $T8 %]:</th>
83 <select name="warehouse_id" id="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
84 [%- FOREACH warehouse = WAREHOUSES %]
85 <option value="[% HTML.escape(warehouse.id) %]">[% warehouse.description %]</option>
92 <th align="right" nowrap>[% 'Bin' | $T8 %]:</th>
93 <td><select id="bin_id" name="bin_id"></select></td>
97 <th align="right" nowrap>[% 'Limit part selection' | $T8 %]:</th>
102 <th align="right" nowrap>[% 'Part Number' | $T8 %]</th>
104 <input type="hidden" name="parts_id" id="parts_id">
105 <input name="partnumber" id="partnumber" size="30">
110 <th align="right" nowrap>[% 'Part Description' | $T8 %]</th>
112 <input name="description" size="30">
113 <input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', '')" value="?">
118 <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
119 <td><input name="chargenumber" size="30"></td>
122 [% IF conf_show_best_before %]
124 <th align="right" nowrap>[% 'Best Before' | $T8 %]</th>
126 [% L.date_tag('bestbefore') %]
132 <th align="right" nowrap>[% 'EAN' | $T8 %]</th>
133 <td><input name="ean" size="30"></td>
139 <input type="submit" class="submit" name="action" value="[% 'Continue' | $T8 %]">