3 [% USE HTML %][% USE JavaScript %][% USE LxERP %]<body onload="on_load(); [% onload %]">
5 <script type="text/javascript" src="js/common.js"></script>
6 <script type="text/javascript" src="js/part_selection.js"></script>
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 [% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
15 warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]] = new Array();
16 warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['description'] = "[% JavaScript.escape(bin.description) %]";
17 warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['id'] = [% bin.id %];
21 function warehouse_selected(warehouse_id, bin_id) {
22 var control = document.getElementById("bin_id");
24 for (var i = control.options.length - 1; i >= 0; i--) {
25 control.options[i] = null;
28 var warehouse_index = 0;
30 for (i = 0; i < warehouses.length; i++)
31 if (warehouses[i]['id'] == warehouse_id) {
36 var warehouse = warehouses[warehouse_index];
39 for (i = 0; i < warehouse['bins'].length; i++)
40 if (warehouse['bins'][i]['id'] == bin_id) {
45 for (i = 0; i < warehouse['bins'].length; i++) {
46 control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
50 control.options[bin_index].selected = true;
54 warehouse_selected([% warehouse_id %], [% bin_id %]);
59 <form name="Form" method="post" action="wh.pl">
61 <input type="hidden" name="nextsub" value="transfer_stock">
62 <input type="hidden" name="update_nextsub" value="transfer_stock_update_part">
64 [% IF saved_message %]
65 <p>[% saved_message %]</p>
68 <div class="listtop">[% title %]</div>
73 <th align="right" nowrap>[% 'Destination warehouse' | $T8 %]</th>
75 <select name="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
76 [%- FOREACH warehouse = WAREHOUSES %]
77 <option value="[% HTML.escape(warehouse.id) %]"[% IF warehouse_id == warehouse.id %] selected[% END %]>[% warehouse.description %]</option>
84 <th align="right" nowrap>[% 'Destination bin' | $T8 %]:</th>
85 <td><select id="bin_id" name="bin_id"></select></td>
89 <th align="right" nowrap>[% 'Part Number' | $T8 %]</th>
91 <input type="hidden" name="parts_id" id="parts_id" value="[% HTML.escape(parts_id) %]">
92 <input type="hidden" name="old_partnumber" id="old_partnumber" value="[% HTML.escape(partnumber) %]">
93 <input name="partnumber" size="30" value="[% HTML.escape(partnumber) %]">
98 <th align="right" nowrap>[% 'Part Description' | $T8 %]</th>
100 <input name="description" size="30" value="[% HTML.escape(description) %]">
101 <input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', 'click_button=update_button')" value="?">
106 <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
107 <td><input name="chargenumber" size="30" value="[% HTML.escape(chargenumber) %]"></td>
110 [% IF conf_show_best_before %]
112 <th align="right" nowrap>[% 'Best Before' | $T8 %]</th>
114 [% L.date_tag('bestbefore', bestbefore) %]
120 <th align="right" nowrap>[% 'EAN' | $T8 %]</th>
121 <td><input name="ean" size="30" value="[% HTML.escape(ean) %]"></td>
125 <th align="right" nowrap>[% 'Quantity' | $T8 %]</th>
127 <input name="qty" size="10" value="[% HTML.escape(LxERP.format_amount(qty)) %]">
129 [%- FOREACH unit = UNITS %]<option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option>[% END %]
135 <th align="right" nowrap>[% 'Optional comment' | $T8 %]</th>
136 <td><input name="comment" size="60" value="[% HTML.escape(comment) %]"></td>
143 <input type="submit" class="submit" name="action" id="update_button" value="[% 'Update' | $T8 %]">
145 <input type="submit" class="submit" name="action" value="[% 'Stock' | $T8 %]">