9 <script type="text/javascript"><!--
10 warehouses = new Array();
11 [% USE WAREHOUSES_it = Iterator(WAREHOUSES) %]
12 [% FOREACH warehouse = WAREHOUSES_it %]
13 warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
14 warehouses[[% WAREHOUSES_it.count - 1 %]]['id'] = [% warehouse.id %];
15 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'] = new Array();
16 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0] = new Array();
17 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0]['description'] = "---";
18 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0]['id'] = "";
19 [% USE BINS_it = Iterator(warehouse.BINS) %]
20 [% FOREACH bin = BINS_it %]
21 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]] = new Array();
22 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]]['description'] = "[% JavaScript.escape(bin.description) %]";
23 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]]['id'] = [% bin.id %];
27 function warehouse_selected(warehouse_id, bin_id) {
28 var control = document.getElementById("bin_id");
30 for (var i = control.options.length - 1; i >= 0; i--) {
31 control.options[i] = null;
34 var warehouse_index = 0;
36 for (i = 0; i < warehouses.length; i++)
37 if (warehouses[i]['id'] == warehouse_id) {
42 var warehouse = warehouses[warehouse_index];
45 for (i = 0; i < warehouse['bins'].length; i++)
46 if (warehouse['bins'][i]['id'] == bin_id) {
51 for (i = 0; i < warehouse['bins'].length; i++) {
52 control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
56 control.options[bin_index].selected = true;
60 warehouse_selected(0, 0);
61 document.Form.part_id_name.focus();
66 <form name="Form" method="post" action="wh.pl" id="form">
69 [% IF saved_message %]
70 <p>[% saved_message %]</p>
73 <p>[% '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 %]</p>
75 <table class="tbl-horizontal">
78 <th>[% 'Transfer from warehouse' | $T8 %]</th>
80 <select name="warehouse_id" id="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)" class="wi-lightwide">
81 [% FOREACH warehouse = WAREHOUSES %]
82 <option value="[% HTML.escape(warehouse.id) %]">[% warehouse.description %]</option>
88 <th>[% 'Bin' | $T8 %]</th>
90 <select id="bin_id" name="bin_id" class="wi-lightwide"></select>
94 <th>[% 'Limit part selection' | $T8 %]</th>
95 <td><span class="plain-data"> </span></td>
98 <th>[% 'Part' | $T8 %]</th>
99 <td>[% P.part.picker("part_id", parts_id, part_type="part,assembly", class="wi-lightwide") %]</td>
102 <th>[% 'Charge number' | $T8 %]</th>
103 <td><input type="text" name="chargenumber" class="wi-lightwide"></td>
105 [% IF INSTANCE_CONF.get_show_bestbefore %]
107 <th>[% 'Best Before' | $T8 %]</th>
108 <td><span class="wi-date">[% L.date_tag('bestbefore') %]</span></td>
112 <th>[% 'EAN' | $T8 %]</th>
113 <td><input type="text" name="ean" class="wi-lightwide"></td>
118 </div><!-- /.wrapper -->