Revision 3c380c2d
Von Sven Schöling vor mehr als 15 Jahren hinzugefügt
templates/webpages/wh/warehouse_selection_stock_master.html | ||
---|---|---|
1 |
[% USE HTML %][% USE JavaScript %][% USE LxERP %]<body onload="on_load(); [% onload %]"> |
|
2 |
|
|
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"> |
|
6 |
<!-- |
|
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 %]; |
|
16 |
[% END %] |
|
17 |
[% END %] |
|
18 |
|
|
19 |
function warehouse_selected(warehouse_id, bin_id) { |
|
20 |
var control = document.getElementById("bin_id"); |
|
21 |
|
|
22 |
for (var i = control.options.length - 1; i >= 0; i--) { |
|
23 |
control.options[i] = null; |
|
24 |
} |
|
25 |
|
|
26 |
var warehouse_index = 0; |
|
27 |
|
|
28 |
for (i = 0; i < warehouses.length; i++) |
|
29 |
if (warehouses[i]['id'] == warehouse_id) { |
|
30 |
warehouse_index = i; |
|
31 |
break; |
|
32 |
} |
|
33 |
|
|
34 |
var warehouse = warehouses[warehouse_index]; |
|
35 |
var bin_index = 0; |
|
36 |
|
|
37 |
for (i = 0; i < warehouse['bins'].length; i++) |
|
38 |
if (warehouse['bins'][i]['id'] == bin_id) { |
|
39 |
bin_index = i; |
|
40 |
break; |
|
41 |
} |
|
42 |
|
|
43 |
for (i = 0; i < warehouse['bins'].length; i++) { |
|
44 |
control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']); |
|
45 |
} |
|
46 |
|
|
47 |
|
|
48 |
control.options[bin_index].selected = true; |
|
49 |
} |
|
50 |
|
|
51 |
function on_load() { |
|
52 |
warehouse_selected([% warehouse_id %], [% bin_id %]); |
|
53 |
} |
|
54 |
--> |
|
55 |
</script> |
|
56 |
|
|
57 |
<form name="Form" method="post" action="wh.pl"> |
|
58 |
|
|
59 |
<input type="hidden" name="nextsub" value="transfer_stock"> |
|
60 |
<input type="hidden" name="update_nextsub" value="transfer_stock_update_part"> |
|
61 |
|
|
62 |
[% IF saved_message %] |
|
63 |
<p>[% saved_message %]</p> |
|
64 |
[% END %] |
|
65 |
|
|
66 |
<div class="listtop">[% title %]</div> |
|
67 |
|
|
68 |
<p> |
|
69 |
<table> |
|
70 |
<tr> |
|
71 |
<th align="right" nowrap><translate>Destination warehouse</translate></th> |
|
72 |
<td> |
|
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> |
|
76 |
[%- END %] |
|
77 |
</select> |
|
78 |
</td> |
|
79 |
</tr> |
|
80 |
|
|
81 |
<tr> |
|
82 |
<th align="right" nowrap><translate>Destination bin</translate>:</th> |
|
83 |
<td><select id="bin_id" name="bin_id"></select></td> |
|
84 |
</tr> |
|
85 |
|
|
86 |
<tr> |
|
87 |
<th align="right" nowrap><translate>Part Number</translate></th> |
|
88 |
<td> |
|
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) %]"> |
|
92 |
</td> |
|
93 |
</tr> |
|
94 |
|
|
95 |
<tr> |
|
96 |
<th align="right" nowrap><translate>Part Description</translate></th> |
|
97 |
<td> |
|
98 |
<input name="description" size="30" value="[% HTML.escape(description) %]"> |
|
99 |
<input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', 'no_services:click_button=update_button')" value="?"> |
|
100 |
</td> |
|
101 |
</tr> |
|
102 |
|
|
103 |
<tr> |
|
104 |
<th align="right" nowrap><translate>Charge number</translate></th> |
|
105 |
<td><input name="chargenumber" size="30" value="[% HTML.escape(chargenumber) %]"></td> |
|
106 |
</tr> |
|
107 |
|
|
108 |
<tr> |
|
109 |
<th align="right" nowrap><translate>Quantity</translate></th> |
|
110 |
<td> |
|
111 |
<input name="qty" size="10" value="[% HTML.escape(LxERP.format_amount(qty)) %]"> |
|
112 |
<select name="unit"> |
|
113 |
[%- FOREACH unit = UNITS %]<option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option>[% END %] |
|
114 |
</select> |
|
115 |
</td> |
|
116 |
</tr> |
|
117 |
|
|
118 |
<tr> |
|
119 |
<th align="right" nowrap><translate>Optional comment</translate></th> |
|
120 |
<td><input name="comment" size="30" value="[% HTML.escape(comment) %]"></td> |
|
121 |
</tr> |
|
122 |
|
|
123 |
</table> |
|
124 |
</p> |
|
125 |
|
|
126 |
<p> |
|
127 |
<input type="submit" class="submit" name="action" id="update_button" value="<translate>Update</translate>"> |
|
128 |
[%- IF parts_id %] |
|
129 |
<input type="submit" class="submit" name="action" value="<translate>Stock</translate>"> |
|
130 |
[%- END %] |
|
131 |
</p> |
|
132 |
</form> |
|
133 |
|
|
134 |
</body> |
|
135 |
</html> |
Auch abrufbar als: Unified diff
Gelöschte Datei aus 4003 wiederhergestellt.