1 [% USE HTML %][% USE JavaScript %][% USE LxERP %]<body onload="on_load(); [% onload %]">
3 <script type="text/javascript" src="js/common.js"></script>
4 <script type="text/javascript" src="js/part_selection.js"></script>
5 <script type="text/javascript">
7 warehouses = new Array();
8 [%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH warehouse = WAREHOUSES_it %]
9 warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
10 warehouses[[% WAREHOUSES_it.count - 1 %]]['id'] = [% warehouse.id %];
11 warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'] = new Array();
12 [% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
13 warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]] = new Array();
14 warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['description'] = "[% JavaScript.escape(bin.description) %]";
15 warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['id'] = [% bin.id %];
19 function warehouse_selected(warehouse_id, bin_id) {
20 var control = document.getElementById("bin_id");
22 for (var i = control.options.length - 1; i >= 0; i--) {
23 control.options[i] = null;
26 var warehouse_index = 0;
28 for (i = 0; i < warehouses.length; i++)
29 if (warehouses[i]['id'] == warehouse_id) {
34 var warehouse = warehouses[warehouse_index];
37 for (i = 0; i < warehouse['bins'].length; i++)
38 if (warehouse['bins'][i]['id'] == bin_id) {
43 for (i = 0; i < warehouse['bins'].length; i++) {
44 control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
48 control.options[bin_index].selected = true;
52 warehouse_selected([% warehouse_id %], [% bin_id %]);
57 <form name="Form" method="post" action="wh.pl">
59 <input type="hidden" name="nextsub" value="transfer_assembly">
60 <input type="hidden" name="update_nextsub" value="transfer_assembly_update_part">
62 [% IF saved_message %]
63 <p>[% saved_message %]</p>
66 <div class="listtop">[% title %]</div>
71 <th align="right" nowrap><translate>Destination warehouse</translate></th>
73 <select name="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
74 [%- FOREACH warehouse = WAREHOUSES %]
75 <option value="[% HTML.escape(warehouse.id) %]"[% IF warehouse_id == warehouse.id %] selected[% END %]>[% warehouse.description %]</option>
82 <th align="right" nowrap><translate>Destination bin</translate>:</th>
83 <td><select id="bin_id" name="bin_id"></select></td>
87 <th align="right" nowrap><translate>Assembly Number</translate></th>
89 <input type="hidden" name="parts_id" id="parts_id" value="[% HTML.escape(parts_id) %]">
90 <input type="hidden" name="old_partnumber" id="old_partnumber" value="[% HTML.escape(partnumber) %]">
91 <input name="partnumber" size="30" value="[% HTML.escape(partnumber) %]">
96 <th align="right" nowrap><translate>Assembly Description</translate></th>
98 <input name="description" size="30" value="[% HTML.escape(description) %]">
99 <input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', 'assemblies:click_button=update_button')" value="?">
104 <th align="right" nowrap><translate>Charge number</translate></th>
105 <td><input name="chargenumber" size="30" value="[% HTML.escape(chargenumber) %]"></td>
109 <th align="right" nowrap><translate>Quantity</translate></th>
111 <input name="qty" size="10" value="[% HTML.escape(LxERP.format_amount(qty)) %]">
113 [%- FOREACH unit = UNITS %]<option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option>[% END %]
119 <th align="right" nowrap><translate>Optional comment</translate></th>
120 <td><input name="comment" size="30" value="[% HTML.escape(comment) %]"></td>
127 <input type="submit" class="submit" name="action" id="update_button" value="<translate>Update</translate>">
129 <input type="submit" class="submit" name="action" value="<translate>Create Assembly</translate>">