salix/print/templates/reports/extra-community/extra-community.js

51 lines
1.4 KiB
JavaScript
Raw Normal View History

2023-01-23 12:15:30 +00:00
const vnReport = require('../../../core/mixins/vn-report.js');
const app = require('vn-loopback/server/server');
2021-01-18 07:33:20 +00:00
module.exports = {
name: 'extra-community',
2023-01-23 12:15:30 +00:00
mixins: [vnReport],
2021-01-18 07:33:20 +00:00
async serverPrefetch() {
const args = {
search: this.search,
2021-01-18 07:33:20 +00:00
landedTo: this.landedEnd,
shippedFrom: this.shippedStart,
2022-03-28 09:57:19 +00:00
continent: this.continent,
2022-03-28 11:24:26 +00:00
id: this.id,
2022-07-14 05:33:32 +00:00
agencyModeFk: this.agencyModeFk,
2022-03-28 11:24:26 +00:00
warehouseInFk: this.warehouseInFk,
warehouseOutFk: this.warehouseOutFk,
totalEntries: this.totalEntries,
ref: this.ref,
cargoSupplierFk: this.cargoSupplierFk
2021-01-18 07:33:20 +00:00
};
const ctx = {args: args};
this.travels = await app.models.Travel.extraCommunityFilter(ctx, this.filter);
2021-01-18 07:33:20 +00:00
},
computed: {
landedEnd: function() {
if (!this.landedTo) return;
return this.formatDate(this.landedTo, '%Y-%m-%d');
2021-01-18 07:33:20 +00:00
},
shippedStart: function() {
if (!this.shippedFrom) return;
return this.formatDate(this.shippedFrom, '%Y-%m-%d');
2021-01-18 07:33:20 +00:00
}
},
methods: {
},
props: [
'filter',
'search',
2021-01-18 07:33:20 +00:00
'landedTo',
'shippedFrom',
2022-03-28 09:57:19 +00:00
'continent',
2022-09-29 05:35:20 +00:00
'reference',
2022-03-28 11:24:26 +00:00
'id',
2022-07-14 05:33:32 +00:00
'agencyModeFk',
2022-03-28 11:24:26 +00:00
'warehouseOutFk',
'warehouseInFk',
'totalEntries',
'cargoSupplierFk'
2021-01-18 07:33:20 +00:00
]
};