salix/print/templates/reports/deb-balances-comp/deb-balances-comp.js

36 lines
1011 B
JavaScript
Raw Normal View History

2022-10-28 12:49:22 +00:00
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'
}
}
};