hedera-web/forms/reports/shelves/shelves.js

50 lines
837 B
JavaScript
Raw Normal View History

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() {
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() {
2016-10-04 15:27:49 +00:00
var fields = [
'realm'
,'family'
,'warehouse'
,'shelf'
,'namePrefix'
,'maxAmount'
,'reportTitle'
,'showPacking'
,'stack'
];
for (var i = 0; i < fields.length; i++)
2022-05-24 21:11:12 +00:00
this.$(fields[i]).value = this.$('config').get(fields[i]);
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
for (var i = 0; i < fields.length; i++)
2022-05-24 21:11:12 +00:00
batch.addValue(fields[i], this.$(fields[i]).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
}
});