2021-12-13 07:23:44 +00:00
|
|
|
const Component = require(`${appPath}/core/component`);
|
|
|
|
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-06-13 09:03:11 +00:00
|
|
|
this.client = await this.findOneFromDef('client', [this.recipientId]);
|
|
|
|
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-06-13 09:03:11 +00:00
|
|
|
recipientId: {
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|