refs #084200 findOne
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Carlos Satorres 2023-03-27 15:15:15 +02:00
parent aad8fb0a66
commit 14f8f98fe9
1 changed files with 10 additions and 14 deletions

View File

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