refs #5525 new sql
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2023-09-06 17:23:31 +02:00
parent 2ff346ec25
commit 8678d2b1e0
2 changed files with 5 additions and 6 deletions

View File

@ -45,4 +45,4 @@
</attachment>
</div>
</div>
</email-body>
</email-body>

View File

@ -7,11 +7,10 @@ module.exports = {
name: 'letter-debtor-st',
async serverPrefetch() {
this.debtor = await db.findOne(`
SELECT sa.iban, be.name bankName
FROM supplierAccount sa
LEFT JOIN bankEntity be ON sa.bankEntityFk = be.id
LEFT JOIN client c ON c.countryFk = sa.countryFk
WHERE c.id = ? OR (c.id IS NULL AND c.countryFk = sa.countryFk)`,
SELECT sa.iban FROM client c
LEFT JOIN supplierAccount sa ON c.countryFk = sa.countryFk
WHERE c.id = ?
OR (c.id IS NULL AND c.countryFk = sa.countryFk)`,
[this.id]);
},
data() {