2022-09-26 06:07:45 +00:00
|
|
|
const Component = require(`vn-print/core/component`);
|
2021-12-13 07:23:44 +00:00
|
|
|
const reportHeader = new Component('report-header');
|
|
|
|
const reportFooter = new Component('report-footer');
|
|
|
|
|
|
|
|
module.exports = {
|
2022-05-26 14:14:10 +00:00
|
|
|
name: 'incoterms-authorization',
|
2021-12-13 07:23:44 +00:00
|
|
|
async serverPrefetch() {
|
2022-09-26 06:07:45 +00:00
|
|
|
this.client = await this.findOneFromDef('client', [this.id]);
|
2022-06-13 09:03:11 +00:00
|
|
|
this.company = await this.findOneFromDef('company', [this.companyId]);
|
|
|
|
if (!this.client)
|
2021-12-13 07:23:44 +00:00
|
|
|
throw new Error('Something went wrong');
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
issued: function() {
|
|
|
|
return new Date();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
'report-header': reportHeader.build(),
|
|
|
|
'report-footer': reportFooter.build()
|
|
|
|
},
|
|
|
|
props: {
|
2022-09-26 06:07:45 +00:00
|
|
|
id: {
|
2022-06-13 09:03:11 +00:00
|
|
|
type: [Number, String],
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
companyId: {
|
2022-01-17 11:44:43 +00:00
|
|
|
type: [Number, String],
|
2021-12-13 07:23:44 +00:00
|
|
|
required: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|