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