salix/print/templates/reports/incoterms-authorization/incoterms-authorization.js

34 lines
910 B
JavaScript
Raw Normal View History

2022-09-26 06:07:45 +00:00
const Component = require(`vn-print/core/component`);
2022-11-10 07:57:42 +00:00
const reportBody = new Component('report-body');
2021-12-13 07:23:44 +00:00
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: {
2022-11-10 07:57:42 +00:00
'report-body': reportBody.build(),
2021-12-13 07:23:44 +00:00
'report-footer': reportFooter.build()
},
props: {
2022-09-26 06:07:45 +00:00
id: {
2022-10-28 13:53:57 +00:00
type: Number,
2022-09-26 11:33:27 +00:00
required: true,
description: 'The client id'
2022-06-13 09:03:11 +00:00
},
companyId: {
2022-10-28 13:53:57 +00:00
type: Number,
2021-12-13 07:23:44 +00:00
required: true
}
}
};