Revision 9f5bccd8
Von Jan Büren vor fast 12 Jahren hinzugefügt
SL/DB/MetaSetup/Default.pm | ||
---|---|---|
warehouse => {
|
||
class => 'SL::DB::Warehouse',
|
||
key_columns => { warehouse_id => 'id' },
|
||
|
||
},
|
||
currency => {
|
||
class => 'SL::DB::Currency',
|
||
key_columns => { currency_id => 'id' },
|
templates/webpages/common/select_warehouse_bin.html | ||
---|---|---|
[%- USE T8 %]
|
||
[%- USE HTML %]
|
||
[%- USE LxERP %]
|
||
[%- USE JavaScript -%]
|
||
<script type="text/javascript" src="js/common.js"></script>
|
||
<script type="text/javascript" src="js/parts_language_selection.js"></script>
|
||
<script type="text/javascript">
|
||
<!--
|
||
warehouses = new Array();
|
||
[%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH warehouse = WAREHOUSES_it %]
|
||
warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
|
||
warehouses[[% WAREHOUSES_it.count - 1 %]]['id'] = [% warehouse.id %];
|
||
warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'] = new Array();
|
||
[% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
|
||
warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count - 1 %]] = new Array();
|
||
warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count - 1 %]]['description'] = "[% JavaScript.escape(bin.description) %]";
|
||
warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count - 1 %]]['id'] = [% bin.id %];
|
||
[% END %]
|
||
[% END %]
|
||
|
||
function warehouse_selected(warehouse_id, bin_id) {
|
||
var control = document.getElementById("bin_id");
|
||
|
||
for (var i = control.options.length - 1; i >= 0; i--) {
|
||
control.options[i] = null;
|
||
}
|
||
|
||
var warehouse_index = 0;
|
||
|
||
for (i = 0; i < warehouses.length; i++)
|
||
if (warehouses[i]['id'] == warehouse_id) {
|
||
warehouse_index = i;
|
||
break;
|
||
}
|
||
|
||
var warehouse = warehouses[warehouse_index];
|
||
var bin_index = 0;
|
||
|
||
for (i = 0; i < warehouse['bins'].length; i++)
|
||
if (warehouse['bins'][i]['id'] == bin_id) {
|
||
bin_index = i;
|
||
break;
|
||
}
|
||
|
||
for (i = 0; i < warehouse['bins'].length; i++) {
|
||
control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
|
||
}
|
||
|
||
|
||
control.options[bin_index].selected = true;
|
||
}
|
||
|
||
$(function() {
|
||
warehouse_selected([% warehouse_id %], [% bin_id %]);
|
||
})
|
||
-->
|
||
</script>
|
templates/webpages/ic/form_header.html | ||
---|---|---|
[[%- USE T8 %]
|
||
[%- USE T8 %]
|
||
[%- USE HTML %]
|
||
[%- USE LxERP %]
|
||
[% PROCESS 'common/select_warehouse_bin.html' %]
|
Auch abrufbar als: Unified diff
Nachtrag zum Commit von eben zu für 2284
Copy / Paste Fehler in form_header.html
Copy / Paste Fehler in Default.pm
Vergessene ausgelagerte common select_warehouse_bin.html
hinzugefügt.