6745-2404_testToMaster #1950

Merged
alexm merged 191 commits from 6745-2404_testToMaster into master 2024-01-25 07:39:13 +00:00
2 changed files with 8 additions and 4 deletions
Showing only changes of commit 5b5191a6a5 - Show all commits
db/changes/233001
print/templates/email/letter-debtor-st

View File

@ -1,14 +1,18 @@
const Component = require(`vn-print/core/component`);
const emailBody = new Component('email-body');
const attachment = new Component('attachment');
const db = require('../../../core/database');
module.exports = {
name: 'letter-debtor-st',
async serverPrefetch() {
this.debtor = await this.fetchDebtor(this.id, this.companyId);
if (!this.debtor)
throw new Error('Something went wrong');
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)`,
[this.id]);
},
data() {
return {