2015-09-22 07:20:47 +00:00
|
|
|
|
2022-05-24 21:11:12 +00:00
|
|
|
Hedera.Shelves = new Class({
|
2016-09-26 09:28:47 +00:00
|
|
|
Extends: Hedera.Form
|
2016-10-04 15:27:49 +00:00
|
|
|
|
2022-05-24 21:11:12 +00:00
|
|
|
,activate: function() {
|
2022-05-28 01:18:06 +00:00
|
|
|
this.$.date.value = new Date();
|
|
|
|
this.$.useIds.value = false;
|
2015-10-23 23:23:19 +00:00
|
|
|
}
|
2016-10-04 15:27:49 +00:00
|
|
|
|
2022-05-24 21:11:12 +00:00
|
|
|
,onConfigChange: function() {
|
2022-05-28 15:49:46 +00:00
|
|
|
const fields = [
|
2016-10-04 15:27:49 +00:00
|
|
|
'realm'
|
|
|
|
,'family'
|
|
|
|
,'warehouse'
|
|
|
|
,'shelf'
|
|
|
|
,'namePrefix'
|
|
|
|
,'maxAmount'
|
|
|
|
,'reportTitle'
|
|
|
|
,'showPacking'
|
|
|
|
,'stack'
|
|
|
|
];
|
2022-05-28 15:49:46 +00:00
|
|
|
const config = this.$.config.$;
|
2016-10-04 15:27:49 +00:00
|
|
|
|
2022-05-28 15:49:46 +00:00
|
|
|
if (config)
|
|
|
|
for (const field of fields)
|
|
|
|
this.$[field].value = config[field];
|
2015-09-22 07:20:47 +00:00
|
|
|
}
|
|
|
|
|
2022-05-24 21:11:12 +00:00
|
|
|
,onPreviewClick: function() {
|
2016-10-04 15:27:49 +00:00
|
|
|
var fields = [
|
|
|
|
'family'
|
|
|
|
,'warehouse'
|
|
|
|
,'shelf'
|
|
|
|
,'namePrefix'
|
|
|
|
,'maxAmount'
|
|
|
|
,'reportTitle'
|
|
|
|
,'showPacking'
|
|
|
|
,'stack'
|
|
|
|
,'useIds'
|
|
|
|
,'date'
|
|
|
|
];
|
|
|
|
|
2022-05-24 21:11:12 +00:00
|
|
|
var batch = new Sql.Batch();
|
2016-10-04 15:27:49 +00:00
|
|
|
|
2022-05-28 15:49:46 +00:00
|
|
|
for (const field of fields)
|
|
|
|
batch.addValue(field, this.$[field].value);
|
2016-10-04 15:27:49 +00:00
|
|
|
|
2022-05-24 21:11:12 +00:00
|
|
|
this.gui.openReport('shelves-report', batch);
|
2015-10-21 23:42:52 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|