3 [%- USE HTML %][%- USE JavaScript %][%- USE LxERP %]
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 [% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
16 warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]] = new Array();
17 warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['description'] = "[% JavaScript.escape(bin.description) %]";
18 warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['id'] = [% bin.id %];
22 function warehouse_selected(warehouse_id, bin_id) {
23 var control = document.getElementById("bin_id");
25 for (var i = control.options.length - 1; i >= 0; i--) {
26 control.options[i] = null;
29 var warehouse_index = 0;
31 for (i = 0; i < warehouses.length; i++)
32 if (warehouses[i]['id'] == warehouse_id) {
37 var warehouse = warehouses[warehouse_index];
40 for (i = 0; i < warehouse['bins'].length; i++)
41 if (warehouse['bins'][i]['id'] == bin_id) {
46 for (i = 0; i < warehouse['bins'].length; i++) {
47 control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
51 control.options[bin_index].selected = true;
55 warehouse_selected([% warehouse_id %], [% bin_id %]);
60 <form name="Form" method="post" action="wh.pl">
62 <input type="hidden" name="nextsub" value="transfer_assembly">
63 <input type="hidden" name="update_nextsub" value="transfer_assembly_update_part">
65 [% IF saved_message %]
66 <p>[% saved_message %]</p>
72 <th align="right" nowrap>[% 'Destination warehouse' | $T8 %]</th>
74 <select name="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
75 [%- FOREACH warehouse = WAREHOUSES %]
76 <option value="[% HTML.escape(warehouse.id) %]"[% IF warehouse_id == warehouse.id %] selected[% END %]>[% warehouse.description %]</option>
83 <th align="right" nowrap>[% 'Destination bin' | $T8 %]:</th>
84 <td><select id="bin_id" name="bin_id"></select></td>
88 <th align="right" nowrap>[% 'Assembly Number' | $T8 %]</th>
90 <input type="hidden" name="parts_id" id="parts_id" value="[% HTML.escape(parts_id) %]">
91 <input type="hidden" name="old_partnumber" id="old_partnumber" value="[% HTML.escape(partnumber) %]">
92 <input name="partnumber" size="30" value="[% HTML.escape(partnumber) %]">
97 <th align="right" nowrap>[% 'Assembly Description' | $T8 %]</th>
99 <input name="description" size="30" value="[% HTML.escape(description) %]">
100 <input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', 'assemblies:click_button=update_button')" value="?">
105 <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
106 <td><input name="chargenumber" size="30" value="[% HTML.escape(chargenumber) %]"></td>
109 [% IF INSTANCE_CONF.get_show_bestbefore %]
111 <th align="right" nowrap>[% 'Best Before' | $T8 %]</th>
113 [% L.date_tag('bestbefore', bestbefore) %]
119 <th align="right" nowrap>[% 'Quantity' | $T8 %]</th>
121 <input name="qty" size="10" value="[% HTML.escape(LxERP.format_amount(qty)) %]">
123 [%- FOREACH unit = UNITS %]<option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option>[% END %]
129 <th align="right" nowrap>[% 'Optional comment' | $T8 %]</th>
130 <td><input name="comment" size="30" value="[% HTML.escape(comment) %]"></td>
137 <input type="submit" class="submit" name="action" id="update_button" value="[% 'Update' | $T8 %]">
139 <input type="submit" class="submit" name="action" value="[% 'Create Assembly' | $T8 %]">