36 lines
1011 B
JavaScript
36 lines
1011 B
JavaScript
|
const config = require(`vn-print/core/config`);
|
||
|
const Component = require(`vn-print/core/component`);
|
||
|
const reportHeader = new Component('report-header');
|
||
|
const reportFooter = new Component('report-footer');
|
||
|
const md5 = require('md5');
|
||
|
const fs = require('fs-extra');
|
||
|
|
||
|
module.exports = {
|
||
|
name: 'deb-balances-comp',
|
||
|
async serverPrefetch() {
|
||
|
this.client = await this.fetchClient(this.id);
|
||
|
},
|
||
|
methods: {
|
||
|
fetchClient(id) {
|
||
|
return this.findOneFromDef('client', [id]);
|
||
|
},
|
||
|
|
||
|
currentDate() {
|
||
|
const current = new Date();
|
||
|
const date = `${current.getDate()}/${current.getMonth()+1}/${current.getFullYear()}`;
|
||
|
return date;
|
||
|
}
|
||
|
},
|
||
|
components: {
|
||
|
'report-header': reportHeader.build(),
|
||
|
'report-footer': reportFooter.build()
|
||
|
},
|
||
|
props: {
|
||
|
id: {
|
||
|
type: [Number, String],
|
||
|
required: true,
|
||
|
description: 'The receipt id'
|
||
|
}
|
||
|
}
|
||
|
};
|