Revision 9447cebd
Von Hans P. Schlaepfer vor etwa 4 Jahren hinzugefügt
templates/webpages/do/stock_in_form.html | ||
---|---|---|
5 | 5 |
[% USE JavaScript %] |
6 | 6 |
<h1>[% title %]</h1> |
7 | 7 |
|
8 |
[%- UNLESS delivered %] |
|
9 |
<script type="text/javascript"> |
|
10 |
<!-- |
|
11 |
warehouses = new Array(); |
|
12 |
[% USE WAREHOUSES_it = Iterator(WAREHOUSES) %][% FOREACH wh = WAREHOUSES_it %] |
|
13 |
warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array(); |
|
14 |
[% USE BINS_it = Iterator(wh.BINS) %][% FOREACH bin = BINS_it %]warehouses[[% WAREHOUSES_it.count - 1 %]][[% BINS_it.count - 1 %]] = ["[% JavaScript.escape(bin.description) %]", "[% JavaScript.escape(bin.id) %]"]; |
|
8 |
[% UNLESS delivered %] |
|
9 |
<script type="text/javascript"><!-- |
|
10 |
|
|
11 |
warehouses = new Array(); |
|
12 |
[% USE WAREHOUSES_it = Iterator(WAREHOUSES) %] |
|
13 |
[% FOREACH wh = WAREHOUSES_it %] |
|
14 |
warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array(); |
|
15 |
[% USE BINS_it = Iterator(wh.BINS) %] |
|
16 |
[% FOREACH bin = BINS_it %] |
|
17 |
warehouses[[% WAREHOUSES_it.count - 1 %]][[% BINS_it.count - 1 %]] = ["[% JavaScript.escape(bin.description) %]", "[% JavaScript.escape(bin.id) %]"]; |
|
18 |
[% END %] |
|
19 |
[% END %] |
|
20 |
|
|
21 |
function warehouse_selected(row, index, initial_bin_index) { |
|
22 |
var cname = "bin_id_" + row; |
|
23 |
var control = document.getElementById(cname); |
|
24 |
for (var i = control.options.length - 1; i >= 0; i--) { |
|
25 |
control.options[i] = null; |
|
26 |
} |
|
27 |
for (i = 0; i < warehouses[index].length; i++) { |
|
28 |
control.options[i] = new Option(warehouses[index][i][0], warehouses[index][i][1]); |
|
29 |
} |
|
30 |
if (!initial_bin_index) |
|
31 |
initial_bin_index = 0; |
|
32 |
control.options[initial_bin_index].selected = true; |
|
33 |
} |
|
34 |
|
|
35 |
$(function(){ |
|
36 |
var bin_id_index = 0; |
|
37 |
var warehouse_id_index = 0; |
|
38 |
[% USE STOCK_INFO_it = Iterator(STOCK_INFO) %][% FOREACH si = STOCK_INFO_it %] |
|
39 |
// new si for wh [% si.warehouse_id %] bin [% si.bin_id %] |
|
40 |
[% SET warehouse_selected = '0' %] |
|
41 |
[% USE WAREHOUSES_it = Iterator(WAREHOUSES) %][% FOREACH wh = WAREHOUSES_it %] |
|
42 |
// wh [% wh.id %] |
|
43 |
[% IF HTML.escape(PART_INFO.warehouse_id) == wh.id %] |
|
44 |
warehouse_id_index = [% WAREHOUSES_it.count - 1%]; |
|
15 | 45 |
[% END %] |
46 |
[% USE BINS_it = Iterator(wh.BINS) %][% FOREACH bin = BINS_it %] |
|
47 |
// bin [% bin.id %] |
|
48 |
[% IF HTML.escape(PART_INFO.bin_id) == bin.id %] |
|
49 |
bin_id_index = [% BINS_it.count - 1%]; |
|
50 |
[% END %] |
|
51 |
[% IF bin.id == si.bin_id %] |
|
52 |
warehouse_selected([% STOCK_INFO_it.count %], [% WAREHOUSES_it.count - 1 %], [% BINS_it.count - 1%]); |
|
53 |
[% SET warehouse_selected = '1' %] |
|
54 |
[% END %] |
|
16 | 55 |
[% END %] |
56 |
[% END %] |
|
57 |
[% UNLESS warehouse_selected %] |
|
58 |
warehouse_selected([% STOCK_INFO_it.count %], warehouse_id_index, bin_id_index); |
|
59 |
[% END %] |
|
60 |
[% END %] |
|
61 |
}); |
|
17 | 62 |
|
18 |
function warehouse_selected(row, index, initial_bin_index) { |
|
19 |
var cname = "bin_id_" + row; |
|
20 |
var control = document.getElementById(cname); |
|
63 |
--></script> |
|
64 |
[% END %] |
|
21 | 65 |
|
22 |
for (var i = control.options.length - 1; i >= 0; i--) { |
|
23 |
control.options[i] = null; |
|
24 |
} |
|
66 |
<form method="post" action="do.pl" name="Form"> |
|
25 | 67 |
|
26 |
for (i = 0; i < warehouses[index].length; i++) {
|
|
27 |
control.options[i] = new Option(warehouses[index][i][0], warehouses[index][i][1]);
|
|
28 |
}
|
|
68 |
[% IF ERRORS && ERRORS.size %]
|
|
69 |
<div class="message message_error">[% ERRORS.join('<br>') %]</div>
|
|
70 |
[% END %]
|
|
29 | 71 |
|
30 |
if (!initial_bin_index) |
|
31 |
initial_bin_index = 0; |
|
32 |
control.options[initial_bin_index].selected = true; |
|
33 |
} |
|
34 |
|
|
35 |
$(function(){ |
|
36 |
var bin_id_index = 0; |
|
37 |
var warehouse_id_index = 0; |
|
38 |
[%- USE STOCK_INFO_it = Iterator(STOCK_INFO) %][%- FOREACH si = STOCK_INFO_it %] |
|
39 |
// new si for wh [% si.warehouse_id %] bin [% si.bin_id %] |
|
40 |
[%- SET warehouse_selected = '0' %] |
|
41 |
[%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH wh = WAREHOUSES_it %] |
|
42 |
// wh [% wh.id %] |
|
43 |
[% IF HTML.escape(PART_INFO.warehouse_id) == wh.id %] |
|
44 |
warehouse_id_index = [% WAREHOUSES_it.count - 1%]; |
|
45 |
[% END %] |
|
46 |
[%- USE BINS_it = Iterator(wh.BINS) %][%- FOREACH bin = BINS_it %] |
|
47 |
// bin [% bin.id %] |
|
48 |
[% IF HTML.escape(PART_INFO.bin_id) == bin.id %] |
|
49 |
bin_id_index = [% BINS_it.count - 1%]; |
|
50 |
[% END %] |
|
51 |
[%- IF bin.id == si.bin_id %] |
|
52 |
warehouse_selected([% STOCK_INFO_it.count %], [% WAREHOUSES_it.count - 1 %], [% BINS_it.count - 1%]); |
|
53 |
[%- SET warehouse_selected = '1' %] |
|
54 |
[%- END %] |
|
55 |
[%- END %] |
|
56 |
[%- END %] |
|
57 |
[%- UNLESS warehouse_selected %] |
|
58 |
warehouse_selected([% STOCK_INFO_it.count %], warehouse_id_index, bin_id_index); |
|
59 |
[%- END %] |
|
60 |
[%- END %] |
|
61 |
}); |
|
62 |
--> |
|
63 |
</script> |
|
64 |
[%- END %] |
|
65 |
|
|
66 |
<form method="post" action="do.pl" name="Form"> |
|
67 |
|
|
68 |
[%- IF ERRORS && ERRORS.size %] |
|
69 |
<p><font color="#ff0000">[% ERRORS.join('<br>') %]</font></p> |
|
70 |
[%- END %] |
|
71 |
|
|
72 |
<p> |
|
73 |
<table> |
|
72 |
<table class="tbl-plain"> |
|
73 |
<tbody> |
|
74 | 74 |
<tr> |
75 |
<td>[% 'Part Number' | $T8 %]</td> |
|
76 |
<td>[% HTML.escape(PART_INFO.partnumber) %]</td> |
|
75 |
<td>[% 'Part Number' | $T8 %]</td>
|
|
76 |
<td>[% HTML.escape(PART_INFO.partnumber) %]</td>
|
|
77 | 77 |
</tr> |
78 | 78 |
<tr> |
79 |
<td>[% 'Description' | $T8 %]</td> |
|
80 |
<td>[% HTML.escape(PART_INFO.description) %]</td> |
|
79 |
<td>[% 'Description' | $T8 %]</td>
|
|
80 |
<td>[% HTML.escape(PART_INFO.description) %]</td>
|
|
81 | 81 |
</tr> |
82 | 82 |
<tr> |
83 |
<td>[% 'Qty according to delivery order' | $T8 %]</td> |
|
84 |
<td>[% HTML.escape(do_qty) %] [% HTML.escape(do_unit) %]</td> |
|
85 |
</tr> |
|
86 |
</table> |
|
87 |
</p> |
|
88 |
|
|
89 |
<input type="hidden" name="nextsub" value="set_stock_in"> |
|
90 |
<input type="hidden" name="update_nextsub" value="update_stock_in"> |
|
91 |
<input type="hidden" name="rowcount" value="[% HTML.escape(STOCK_INFO.size) %]"> |
|
92 |
<input type="hidden" name="in_out" value="in"> |
|
93 |
<input type="hidden" name="parts_id" value="[% HTML.escape(parts_id) %]"> |
|
94 |
<input type="hidden" name="partunit" value="[% HTML.escape(PART_INFO.unit) %]"> |
|
95 |
<input type="hidden" name="do_qty" value="[% HTML.escape(do_qty) %]"> |
|
96 |
<input type="hidden" name="do_unit" value="[% HTML.escape(do_unit) %]"> |
|
97 |
<input type="hidden" name="row" value="[% HTML.escape(row) %]"> |
|
98 |
|
|
99 |
<p> |
|
100 |
<table> |
|
101 |
<tr class="listheading"> |
|
102 |
<th class="listheading"> </th> |
|
103 |
<th class="listheading">[% 'Warehouse' | $T8 %]</th> |
|
104 |
<th class="listheading">[% 'Bin' | $T8 %]</th> |
|
105 |
<th class="listheading">[% 'Charge Number' | $T8 %]</th> |
|
106 |
[% IF INSTANCE_CONF.get_show_bestbefore %] |
|
107 |
<th class="listheading">[% 'Best Before' | $T8 %]</th> |
|
108 |
[% END %] |
|
109 |
<th align="right" class="listheading">[% 'Qty' | $T8 %]</th> |
|
110 |
<th align="right" class="listheading">[% 'Unit' | $T8 %]</th> |
|
83 |
<td>[% 'Qty according to delivery order' | $T8 %]</td> |
|
84 |
<td>[% HTML.escape(do_qty) %] [% HTML.escape(do_unit) %]</td> |
|
111 | 85 |
</tr> |
112 |
|
|
113 |
[%- FOREACH row = STOCK_INFO %] |
|
114 |
<tr [% IF row.stock_error %] class="tr_error"[% ELSE %]class="listrow[% loop.count % 2 %]"[% END %]> |
|
115 |
<td>[% loop.count %]</td> |
|
116 |
|
|
117 |
[%- IF delivered %] |
|
118 |
|
|
119 |
<td>[% HTML.escape(row.warehouse_description) %]</td> |
|
120 |
<td>[% HTML.escape(row.bin_description) %]</td> |
|
121 |
<td>[% HTML.escape(row.chargenumber) %]</td> |
|
122 |
[% IF INSTANCE_CONF.get_show_bestbefore %] |
|
123 |
<td>[% HTML.escape(row.bestbefore) %]</td> |
|
124 |
[% END %] |
|
125 |
<td>[% HTML.escape(LxERP.format_amount(row.qty)) %]</td> |
|
126 |
<td>[% HTML.escape(row.unit) %]</td> |
|
127 |
|
|
128 |
[%- ELSE %] |
|
129 |
|
|
130 |
<td> |
|
131 |
<select name="warehouse_id_[% loop.count %]" onchange="warehouse_selected([% loop.count %], this.selectedIndex)"> |
|
132 |
[%- FOREACH wh = WAREHOUSES %] |
|
133 |
<option value="[% HTML.escape(wh.id) %]"[% IF wh.id == row.warehouse_id %] selected[% END %] [% IF wh.id == PART_INFO.warehouse_id && STOCK_INFO.size == 1 %] selected[% END %]>[% HTML.escape(wh.description) %]</option> |
|
134 |
[%- END %] |
|
135 |
</select> |
|
136 |
</td> |
|
137 |
|
|
138 |
<td><select name="bin_id_[% loop.count %]" id="bin_id_[% loop.count %]"></select></td> |
|
139 |
<td><input name="chargenumber_[% loop.count %]" value="[% HTML.escape(row.chargenumber) %]"></td> |
|
140 |
[% IF INSTANCE_CONF.get_show_bestbefore %] |
|
141 |
<td> |
|
142 |
[% L.date_tag('bestbefore_'_ loop.count, row.bestbefore) %] |
|
143 |
</td> |
|
144 |
[% END %] |
|
145 |
<td><input name="qty_[% loop.count %]" size="12" value="[% HTML.escape(LxERP.format_amount(row.qty)) %]"></td> |
|
146 |
|
|
147 |
<td> |
|
148 |
<select name="unit_[% loop.count %]"> |
|
149 |
[%- FOREACH unit = UNITS %] |
|
150 |
<option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option> |
|
151 |
[%- END %] |
|
152 |
</select> |
|
153 |
</td> |
|
154 |
<input type="hidden" name="delivery_order_items_stock_id_[% loop.count %]" value="[% HTML.escape(row.delivery_order_items_stock_id) %]"> |
|
155 |
[%- END %] |
|
86 |
</tbody> |
|
87 |
</table> |
|
88 |
|
|
89 |
|
|
90 |
<input type="hidden" name="nextsub" value="set_stock_in"> |
|
91 |
<input type="hidden" name="update_nextsub" value="update_stock_in"> |
|
92 |
<input type="hidden" name="rowcount" value="[% HTML.escape(STOCK_INFO.size) %]"> |
|
93 |
<input type="hidden" name="in_out" value="in"> |
|
94 |
<input type="hidden" name="parts_id" value="[% HTML.escape(parts_id) %]"> |
|
95 |
<input type="hidden" name="partunit" value="[% HTML.escape(PART_INFO.unit) %]"> |
|
96 |
<input type="hidden" name="do_qty" value="[% HTML.escape(do_qty) %]"> |
|
97 |
<input type="hidden" name="do_unit" value="[% HTML.escape(do_unit) %]"> |
|
98 |
<input type="hidden" name="row" value="[% HTML.escape(row) %]"> |
|
99 |
|
|
100 |
<table class="tbl-list"> |
|
101 |
<thead> |
|
102 |
<tr> |
|
103 |
<th> </th> |
|
104 |
<th>[% 'Warehouse' | $T8 %]</th> |
|
105 |
<th>[% 'Bin' | $T8 %]</th> |
|
106 |
<th>[% 'Charge Number' | $T8 %]</th> |
|
107 |
[% IF INSTANCE_CONF.get_show_bestbefore %] |
|
108 |
<th>[% 'Best Before' | $T8 %]</th> |
|
109 |
[% END %] |
|
110 |
<th>[% 'Qty' | $T8 %]</th> |
|
111 |
<th>[% 'Unit' | $T8 %]</th> |
|
156 | 112 |
</tr> |
157 |
|
|
158 |
[%- END %] |
|
159 |
</table> |
|
160 |
</p> |
|
161 |
|
|
162 |
<hr size="3" noshade> |
|
163 |
|
|
164 |
<p> |
|
165 |
[%- IF delivered %] |
|
166 |
<button type="button" class="submit" name="action" onclick="window.close()">[% 'Close Window' | $T8 %]</button> |
|
167 |
[%- ELSE %] |
|
168 |
<input class="submit" type="submit" name="action" value="[% 'Update' | $T8 %]"> |
|
169 |
<input class="submit" type="submit" name="action" value="[% 'Continue' | $T8 %]"> |
|
170 |
[%- END %] |
|
171 |
</p> |
|
172 |
</form> |
|
173 |
|
|
113 |
</thead> |
|
114 |
<tbody> |
|
115 |
[% FOREACH row = STOCK_INFO %] |
|
116 |
<tr [% IF row.stock_error %]class="tr_error"[% END %]> |
|
117 |
<td>[% loop.count %]</td> |
|
118 |
[% IF delivered %] |
|
119 |
<td>[% HTML.escape(row.warehouse_description) %]</td> |
|
120 |
<td>[% HTML.escape(row.bin_description) %]</td> |
|
121 |
<td>[% HTML.escape(row.chargenumber) %]</td> |
|
122 |
[% IF INSTANCE_CONF.get_show_bestbefore %] |
|
123 |
<td>[% HTML.escape(row.bestbefore) %]</td> |
|
124 |
[% END %] |
|
125 |
<td>[% HTML.escape(LxERP.format_amount(row.qty)) %]</td> |
|
126 |
<td>[% HTML.escape(row.unit) %]</td> |
|
127 |
[% ELSE %] |
|
128 |
<td> |
|
129 |
<select name="warehouse_id_[% loop.count %]" onchange="warehouse_selected([% loop.count %], this.selectedIndex)"> |
|
130 |
[% FOREACH wh = WAREHOUSES %] |
|
131 |
<option value="[% HTML.escape(wh.id) %]"[% IF wh.id == row.warehouse_id %] selected[% END %] [% IF wh.id == PART_INFO.warehouse_id && STOCK_INFO.size == 1 %] selected[% END %]>[% HTML.escape(wh.description) %]</option> |
|
132 |
[% END %] |
|
133 |
</select> |
|
134 |
</td> |
|
135 |
<td><select name="bin_id_[% loop.count %]" id="bin_id_[% loop.count %]"></select></td> |
|
136 |
<td><input type="text" name="chargenumber_[% loop.count %]" value="[% HTML.escape(row.chargenumber) %]"></td> |
|
137 |
[% IF INSTANCE_CONF.get_show_bestbefore %] |
|
138 |
<td>[% L.date_tag('bestbefore_'_ loop.count, row.bestbefore) %]</td> |
|
139 |
[% END %] |
|
140 |
<td><input type="text" name="qty_[% loop.count %]" size="12" value="[% HTML.escape(LxERP.format_amount(row.qty)) %]"></td> |
|
141 |
<td> |
|
142 |
<select name="unit_[% loop.count %]"> |
|
143 |
[% FOREACH unit = UNITS %] |
|
144 |
<option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option> |
|
145 |
[% END %] |
|
146 |
</select> |
|
147 |
<input type="hidden" name="delivery_order_items_stock_id_[% loop.count %]" value="[% HTML.escape(row.delivery_order_items_stock_id) %]"> |
|
148 |
</td> |
|
149 |
[% END %] |
|
150 |
</tr> |
|
151 |
[% END %]<!-- /FOREACH row = STOCK_INFO --> |
|
152 |
</tbody> |
|
153 |
</table> |
|
154 |
|
|
155 |
|
|
156 |
<div class="buttons"> |
|
157 |
[% IF delivered %] |
|
158 |
<button type="button" name="action" onclick="window.close()" class="neutral">[% 'Close Window' | $T8 %]</button> |
|
159 |
[% ELSE %] |
|
160 |
<input type="submit" name="action" value="[% 'Update' | $T8 %]"> |
|
161 |
<input type="submit" name="action" value="[% 'Continue' | $T8 %]"> |
|
162 |
[% END %] |
|
163 |
</div> |
|
164 |
|
|
165 |
</form> |
Auch abrufbar als: Unified diff
Neues Design 2019 Standard-Code templates/webpages/do/stock_in_form.html