2022-10-28 12:49:22 +00:00
|
|
|
const Component = require(`vn-print/core/component`);
|
2022-11-10 08:51:28 +00:00
|
|
|
const emailBody = new Component('email-body');
|
2022-10-28 12:49:22 +00:00
|
|
|
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: {
|
2022-11-10 08:51:28 +00:00
|
|
|
'email-body': emailBody.build(),
|
2022-10-28 12:49:22 +00:00
|
|
|
'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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|