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

This commit is contained in:
Carlos Satorres 2023-04-05 14:39:51 +02:00
parent 1e71f7487a
commit 014998952e
3 changed files with 15 additions and 17 deletions

View File

@ -1,5 +1,3 @@
<!DOCTYPE html>
<html v-bind:lang="$i18n.locale">
<div>
<div class="footer">
<div class="page">
@ -8,10 +6,10 @@
<div class="pageCount" v-html="$t('numPages')"></div>
</div>
<p
v-if="companyI18n && companyI18n.footnotes"
v-bind="`${companyI18n.footnotes}`">
v-if="company?.footnotes"
v-html="company.footnotes">
</p>
</div>
</div>
</html>

View File

@ -1,19 +1,17 @@
/* eslint-disable no-tabs */
const db = require('../../database');
module.exports = {
name: 'report-footer',
async serverPrefetch() {
const company = await db.findOne(`
SELECT
ci.footnotes,
c.code
FROM company c
JOIN companyI18n ci ON ci.companyFk = c.id AND ci.lang = (SELECT lang FROM account.user LIMIT 1)
JOIN companyGroup cg ON cg.id = c.companyGroupFk
JOIN supplier s ON s.id = c.id
WHERE c.code = ?`, [this.companyCode]);
this.company = company;
this.company = await db.findOne(
`SELECT
ci.footnotes
FROM companyI18n ci
JOIN company c ON c.id = ci.companyFk
WHERE c.code = ? AND ci.lang = (SELECT lang FROM account.user WHERE id = ?)`,
[this.companyCode, this.recipientId]);
},
props: ['leftText', 'companyCode', 'centerText']
props: ['leftText', 'companyCode', 'recipientId', 'centerText']
};

View File

@ -259,7 +259,9 @@
v-bind:company-code="invoice.companyCode"
v-bind:left-text="$t('invoiceRef', [invoice.ref])"
v-bind:center-text="client.socialName"
v-bind:recipient-id="client.id"
v-bind="$props"
>
</report-footer>
</template>