23 lines
544 B
JavaScript
Executable File
23 lines
544 B
JavaScript
Executable File
const Component = require(`vn-print/core/component`);
|
|
const emailBody = new Component('email-body');
|
|
module.exports = {
|
|
name: 'invoice',
|
|
async serverPrefetch() {
|
|
this.invoice = await this.fetchInvoice(this.reference);
|
|
},
|
|
methods: {
|
|
fetchInvoice(reference) {
|
|
return this.findOneFromDef('invoice', [reference]);
|
|
},
|
|
},
|
|
components: {
|
|
'email-body': emailBody.build(),
|
|
},
|
|
props: {
|
|
reference: {
|
|
type: Number,
|
|
required: true
|
|
}
|
|
}
|
|
};
|