salix/print/templates/email/balance-compensation/balance-compensation.js

40 lines
1009 B
JavaScript
Raw Normal View History

2022-10-28 12:49:22 +00:00
const Component = require(`vn-print/core/component`);
const emailHeader = new Component('email-header');
const emailFooter = new Component('email-footer');
const attachment = new Component('attachment');
module.exports = {
2022-11-02 14:54:23 +00:00
name: 'balance-compensation',
2022-10-28 12:49:22 +00:00
async serverPrefetch() {
this.client = await this.fetchClient(this.id);
},
methods: {
fetchClient(id) {
return this.findOneFromDef('client', [id]);
},
},
components: {
'email-header': emailHeader.build(),
'email-footer': emailFooter.build(),
'attachment': attachment.build()
},
data() {
return {
attachments: [
{
2022-11-02 14:54:23 +00:00
filename: 'balance-compensation.pdf',
2022-10-28 12:49:22 +00:00
type: 'pdf',
2022-11-02 14:54:23 +00:00
path: `Receipts/${this.id}/balance-compensation-pdf`
2022-10-28 12:49:22 +00:00
}
]
};
},
props: {
id: {
type: Number,
required: true
}
}
};