Revision b0be24b8
Von Hans P. Schlaepfer vor etwa 4 Jahren hinzugefügt
templates/webpages/do/stock_in_form.html | ||
---|---|---|
[% USE JavaScript %]
|
||
<h1>[% title %]</h1>
|
||
|
||
[%- UNLESS delivered %]
|
||
<script type="text/javascript">
|
||
<!--
|
||
warehouses = new Array();
|
||
[% USE WAREHOUSES_it = Iterator(WAREHOUSES) %][% FOREACH wh = WAREHOUSES_it %]
|
||
warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
|
||
[% 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) %]"];
|
||
[% UNLESS delivered %]
|
||
<script type="text/javascript"><!--
|
||
|
||
warehouses = new Array();
|
||
[% USE WAREHOUSES_it = Iterator(WAREHOUSES) %]
|
||
[% FOREACH wh = WAREHOUSES_it %]
|
||
warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
|
||
[% 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) %]"];
|
||
[% END %]
|
||
[% END %]
|
||
|
||
function warehouse_selected(row, index, initial_bin_index) {
|
||
var cname = "bin_id_" + row;
|
||
var control = document.getElementById(cname);
|
||
for (var i = control.options.length - 1; i >= 0; i--) {
|
||
control.options[i] = null;
|
||
}
|
||
for (i = 0; i < warehouses[index].length; i++) {
|
||
control.options[i] = new Option(warehouses[index][i][0], warehouses[index][i][1]);
|
||
}
|
||
if (!initial_bin_index)
|
||
initial_bin_index = 0;
|
||
control.options[initial_bin_index].selected = true;
|
||
}
|
||
|
||
$(function(){
|
||
var bin_id_index = 0;
|
||
var warehouse_id_index = 0;
|
||
[% USE STOCK_INFO_it = Iterator(STOCK_INFO) %][% FOREACH si = STOCK_INFO_it %]
|
||
// new si for wh [% si.warehouse_id %] bin [% si.bin_id %]
|
||
[% SET warehouse_selected = '0' %]
|
||
[% USE WAREHOUSES_it = Iterator(WAREHOUSES) %][% FOREACH wh = WAREHOUSES_it %]
|
||
// wh [% wh.id %]
|
||
[% IF HTML.escape(PART_INFO.warehouse_id) == wh.id %]
|
||
warehouse_id_index = [% WAREHOUSES_it.count - 1%];
|
||
[% END %]
|
||
[% USE BINS_it = Iterator(wh.BINS) %][% FOREACH bin = BINS_it %]
|
||
// bin [% bin.id %]
|
||
[% IF HTML.escape(PART_INFO.bin_id) == bin.id %]
|
||
bin_id_index = [% BINS_it.count - 1%];
|
||
[% END %]
|
||
[% IF bin.id == si.bin_id %]
|
||
warehouse_selected([% STOCK_INFO_it.count %], [% WAREHOUSES_it.count - 1 %], [% BINS_it.count - 1%]);
|
||
[% SET warehouse_selected = '1' %]
|
||
[% END %]
|
||
[% END %]
|
||
[% END %]
|
||
[% UNLESS warehouse_selected %]
|
||
warehouse_selected([% STOCK_INFO_it.count %], warehouse_id_index, bin_id_index);
|
||
[% END %]
|
||
[% END %]
|
||
});
|
||
|
||
function warehouse_selected(row, index, initial_bin_index) {
|
||
var cname = "bin_id_" + row;
|
||
var control = document.getElementById(cname);
|
||
--></script>
|
||
[% END %]
|
||
|
||
for (var i = control.options.length - 1; i >= 0; i--) {
|
||
control.options[i] = null;
|
||
}
|
||
<form method="post" action="do.pl" name="Form">
|
||
|
||
for (i = 0; i < warehouses[index].length; i++) {
|
||
control.options[i] = new Option(warehouses[index][i][0], warehouses[index][i][1]);
|
||
}
|
||
[% IF ERRORS && ERRORS.size %]
|
||
<div class="message message_error">[% ERRORS.join('<br>') %]</div>
|
||
[% END %]
|
||
|
||
if (!initial_bin_index)
|
||
initial_bin_index = 0;
|
||
control.options[initial_bin_index].selected = true;
|
||
}
|
||
|
||
$(function(){
|
||
var bin_id_index = 0;
|
||
var warehouse_id_index = 0;
|
||
[%- USE STOCK_INFO_it = Iterator(STOCK_INFO) %][%- FOREACH si = STOCK_INFO_it %]
|
||
// new si for wh [% si.warehouse_id %] bin [% si.bin_id %]
|
||
[%- SET warehouse_selected = '0' %]
|
||
[%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH wh = WAREHOUSES_it %]
|
||
// wh [% wh.id %]
|
||
[% IF HTML.escape(PART_INFO.warehouse_id) == wh.id %]
|
||
warehouse_id_index = [% WAREHOUSES_it.count - 1%];
|
||
[% END %]
|
||
[%- USE BINS_it = Iterator(wh.BINS) %][%- FOREACH bin = BINS_it %]
|
||
// bin [% bin.id %]
|
||
[% IF HTML.escape(PART_INFO.bin_id) == bin.id %]
|
||
bin_id_index = [% BINS_it.count - 1%];
|
||
[% END %]
|
||
[%- IF bin.id == si.bin_id %]
|
||
warehouse_selected([% STOCK_INFO_it.count %], [% WAREHOUSES_it.count - 1 %], [% BINS_it.count - 1%]);
|
||
[%- SET warehouse_selected = '1' %]
|
||
[%- END %]
|
||
[%- END %]
|
||
[%- END %]
|
||
[%- UNLESS warehouse_selected %]
|
||
warehouse_selected([% STOCK_INFO_it.count %], warehouse_id_index, bin_id_index);
|
||
[%- END %]
|
||
[%- END %]
|
||
});
|
||
-->
|
||
</script>
|
||
[%- END %]
|
||
|
||
<form method="post" action="do.pl" name="Form">
|
||
|
||
[%- IF ERRORS && ERRORS.size %]
|
||
<p><font color="#ff0000">[% ERRORS.join('<br>') %]</font></p>
|
||
[%- END %]
|
||
|
||
<p>
|
||
<table>
|
||
<table class="tbl-plain">
|
||
<tbody>
|
||
<tr>
|
||
<td>[% 'Part Number' | $T8 %]</td>
|
||
<td>[% HTML.escape(PART_INFO.partnumber) %]</td>
|
||
<td>[% 'Part Number' | $T8 %]</td>
|
||
<td>[% HTML.escape(PART_INFO.partnumber) %]</td>
|
||
</tr>
|
||
<tr>
|
||
<td>[% 'Description' | $T8 %]</td>
|
||
<td>[% HTML.escape(PART_INFO.description) %]</td>
|
||
<td>[% 'Description' | $T8 %]</td>
|
||
<td>[% HTML.escape(PART_INFO.description) %]</td>
|
||
</tr>
|
||
<tr>
|
||
<td>[% 'Qty according to delivery order' | $T8 %]</td>
|
||
<td>[% HTML.escape(do_qty) %] [% HTML.escape(do_unit) %]</td>
|
||
</tr>
|
||
</table>
|
||
</p>
|
||
|
||
<input type="hidden" name="nextsub" value="set_stock_in">
|
||
<input type="hidden" name="update_nextsub" value="update_stock_in">
|
||
<input type="hidden" name="rowcount" value="[% HTML.escape(STOCK_INFO.size) %]">
|
||
<input type="hidden" name="in_out" value="in">
|
||
<input type="hidden" name="parts_id" value="[% HTML.escape(parts_id) %]">
|
||
<input type="hidden" name="partunit" value="[% HTML.escape(PART_INFO.unit) %]">
|
||
<input type="hidden" name="do_qty" value="[% HTML.escape(do_qty) %]">
|
||
<input type="hidden" name="do_unit" value="[% HTML.escape(do_unit) %]">
|
||
<input type="hidden" name="row" value="[% HTML.escape(row) %]">
|
||
|
||
<p>
|
||
<table>
|
||
<tr class="listheading">
|
||
<th class="listheading"> </th>
|
||
<th class="listheading">[% 'Warehouse' | $T8 %]</th>
|
||
<th class="listheading">[% 'Bin' | $T8 %]</th>
|
||
<th class="listheading">[% 'Charge Number' | $T8 %]</th>
|
||
[% IF INSTANCE_CONF.get_show_bestbefore %]
|
||
<th class="listheading">[% 'Best Before' | $T8 %]</th>
|
||
[% END %]
|
||
<th align="right" class="listheading">[% 'Qty' | $T8 %]</th>
|
||
<th align="right" class="listheading">[% 'Unit' | $T8 %]</th>
|
||
<td>[% 'Qty according to delivery order' | $T8 %]</td>
|
||
<td>[% HTML.escape(do_qty) %] [% HTML.escape(do_unit) %]</td>
|
||
</tr>
|
||
|
||
[%- FOREACH row = STOCK_INFO %]
|
||
<tr [% IF row.stock_error %] class="tr_error"[% ELSE %]class="listrow[% loop.count % 2 %]"[% END %]>
|
||
<td>[% loop.count %]</td>
|
||
|
||
[%- IF delivered %]
|
||
|
||
<td>[% HTML.escape(row.warehouse_description) %]</td>
|
||
<td>[% HTML.escape(row.bin_description) %]</td>
|
||
<td>[% HTML.escape(row.chargenumber) %]</td>
|
||
[% IF INSTANCE_CONF.get_show_bestbefore %]
|
||
<td>[% HTML.escape(row.bestbefore) %]</td>
|
||
[% END %]
|
||
<td>[% HTML.escape(LxERP.format_amount(row.qty)) %]</td>
|
||
<td>[% HTML.escape(row.unit) %]</td>
|
||
|
||
[%- ELSE %]
|
||
|
||
<td>
|
||
<select name="warehouse_id_[% loop.count %]" onchange="warehouse_selected([% loop.count %], this.selectedIndex)">
|
||
[%- FOREACH wh = WAREHOUSES %]
|
||
<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>
|
||
[%- END %]
|
||
</select>
|
||
</td>
|
||
|
||
<td><select name="bin_id_[% loop.count %]" id="bin_id_[% loop.count %]"></select></td>
|
||
<td><input name="chargenumber_[% loop.count %]" value="[% HTML.escape(row.chargenumber) %]"></td>
|
||
[% IF INSTANCE_CONF.get_show_bestbefore %]
|
||
<td>
|
||
[% L.date_tag('bestbefore_'_ loop.count, row.bestbefore) %]
|
||
</td>
|
||
[% END %]
|
||
<td><input name="qty_[% loop.count %]" size="12" value="[% HTML.escape(LxERP.format_amount(row.qty)) %]"></td>
|
||
|
||
<td>
|
||
<select name="unit_[% loop.count %]">
|
||
[%- FOREACH unit = UNITS %]
|
||
<option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option>
|
||
[%- END %]
|
||
</select>
|
||
</td>
|
||
<input type="hidden" name="delivery_order_items_stock_id_[% loop.count %]" value="[% HTML.escape(row.delivery_order_items_stock_id) %]">
|
||
[%- END %]
|
||
</tbody>
|
||
</table>
|
||
|
||
|
||
<input type="hidden" name="nextsub" value="set_stock_in">
|
||
<input type="hidden" name="update_nextsub" value="update_stock_in">
|
||
<input type="hidden" name="rowcount" value="[% HTML.escape(STOCK_INFO.size) %]">
|
||
<input type="hidden" name="in_out" value="in">
|
||
<input type="hidden" name="parts_id" value="[% HTML.escape(parts_id) %]">
|
||
<input type="hidden" name="partunit" value="[% HTML.escape(PART_INFO.unit) %]">
|
||
<input type="hidden" name="do_qty" value="[% HTML.escape(do_qty) %]">
|
||
<input type="hidden" name="do_unit" value="[% HTML.escape(do_unit) %]">
|
||
<input type="hidden" name="row" value="[% HTML.escape(row) %]">
|
||
|
||
<table class="tbl-list">
|
||
<thead>
|
||
<tr>
|
||
<th> </th>
|
||
<th>[% 'Warehouse' | $T8 %]</th>
|
||
<th>[% 'Bin' | $T8 %]</th>
|
||
<th>[% 'Charge Number' | $T8 %]</th>
|
||
[% IF INSTANCE_CONF.get_show_bestbefore %]
|
||
<th>[% 'Best Before' | $T8 %]</th>
|
||
[% END %]
|
||
<th>[% 'Qty' | $T8 %]</th>
|
||
<th>[% 'Unit' | $T8 %]</th>
|
||
</tr>
|
||
|
||
[%- END %]
|
||
</table>
|
||
</p>
|
||
|
||
<hr size="3" noshade>
|
||
|
||
<p>
|
||
[%- IF delivered %]
|
||
<button type="button" class="submit" name="action" onclick="window.close()">[% 'Close Window' | $T8 %]</button>
|
||
[%- ELSE %]
|
||
<input class="submit" type="submit" name="action" value="[% 'Update' | $T8 %]">
|
||
<input class="submit" type="submit" name="action" value="[% 'Continue' | $T8 %]">
|
||
[%- END %]
|
||
</p>
|
||
</form>
|
||
|
||
</thead>
|
||
<tbody>
|
||
[% FOREACH row = STOCK_INFO %]
|
||
<tr [% IF row.stock_error %]class="tr_error"[% END %]>
|
||
<td>[% loop.count %]</td>
|
||
[% IF delivered %]
|
||
<td>[% HTML.escape(row.warehouse_description) %]</td>
|
||
<td>[% HTML.escape(row.bin_description) %]</td>
|
||
<td>[% HTML.escape(row.chargenumber) %]</td>
|
||
[% IF INSTANCE_CONF.get_show_bestbefore %]
|
||
<td>[% HTML.escape(row.bestbefore) %]</td>
|
||
[% END %]
|
||
<td>[% HTML.escape(LxERP.format_amount(row.qty)) %]</td>
|
||
<td>[% HTML.escape(row.unit) %]</td>
|
||
[% ELSE %]
|
||
<td>
|
||
<select name="warehouse_id_[% loop.count %]" onchange="warehouse_selected([% loop.count %], this.selectedIndex)">
|
||
[% FOREACH wh = WAREHOUSES %]
|
||
<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>
|
||
[% END %]
|
||
</select>
|
||
</td>
|
||
<td><select name="bin_id_[% loop.count %]" id="bin_id_[% loop.count %]"></select></td>
|
||
<td><input type="text" name="chargenumber_[% loop.count %]" value="[% HTML.escape(row.chargenumber) %]"></td>
|
||
[% IF INSTANCE_CONF.get_show_bestbefore %]
|
||
<td>[% L.date_tag('bestbefore_'_ loop.count, row.bestbefore) %]</td>
|
||
[% END %]
|
||
<td><input type="text" name="qty_[% loop.count %]" size="12" value="[% HTML.escape(LxERP.format_amount(row.qty)) %]"></td>
|
||
<td>
|
||
<select name="unit_[% loop.count %]">
|
||
[% FOREACH unit = UNITS %]
|
||
<option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option>
|
||
[% END %]
|
||
</select>
|
||
<input type="hidden" name="delivery_order_items_stock_id_[% loop.count %]" value="[% HTML.escape(row.delivery_order_items_stock_id) %]">
|
||
</td>
|
||
[% END %]
|
||
</tr>
|
||
[% END %]<!-- /FOREACH row = STOCK_INFO -->
|
||
</tbody>
|
||
</table>
|
||
|
||
|
||
<div class="buttons">
|
||
[% IF delivered %]
|
||
<button type="button" name="action" onclick="window.close()" class="neutral">[% 'Close Window' | $T8 %]</button>
|
||
[% ELSE %]
|
||
<input type="submit" name="action" value="[% 'Update' | $T8 %]">
|
||
<input type="submit" name="action" value="[% 'Continue' | $T8 %]">
|
||
[% END %]
|
||
</div>
|
||
|
||
</form>
|
Auch abrufbar als: Unified diff
Neues Design 2019 Standard-Code templates/webpages/do/stock_in_form.html