This commit is contained in:
parent
aad8fb0a66
commit
14f8f98fe9
|
@ -3,20 +3,16 @@ const db = require('../../database');
|
|||
module.exports = {
|
||||
name: 'report-footer',
|
||||
async serverPrefetch() {
|
||||
this.company = await this.getCompany(this.companyCode);
|
||||
},
|
||||
methods: {
|
||||
getCompany(code) {
|
||||
return db.findOne(`
|
||||
const company = await db.findOne(`
|
||||
SELECT
|
||||
(SELECT ci.footnotes FROM companyI18n ci WHERE ci.companyFk = c.id) AS footnotes,
|
||||
c.code
|
||||
FROM company c
|
||||
JOIN companyGroup cg ON cg.id = c.companyGroupFk
|
||||
JOIN supplier s ON s.id = c.id
|
||||
WHERE c.code = ?`);
|
||||
}
|
||||
WHERE c.code = ?`, [this.companyCode]);
|
||||
|
||||
this.company = company;
|
||||
},
|
||||
props: ['leftText', 'companyCode', 'centerText']
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue