refs #5525 mod yml y sql #1491

Merged
carlossa merged 41 commits from 5525-ibanSEPA-CORE into dev 2024-01-16 13:14:39 +00:00
2 changed files with 9 additions and 4 deletions
Showing only changes of commit d26a73bdd9 - Show all commits

View File

@ -1,3 +1,7 @@
ALTER TABLE `vn`.`supplierAccount` ADD COLUMN `countryFk` mediumint(8) unsigned NULL;
ALTER TABLE `vn`.`supplierAccount` ADD CONSTRAINT `supplierAccount_fk_country` FOREIGN KEY (`countryFk`) REFERENCES `country` (`id`);
ALTER TABLE `vn`.`company` MODIFY COLUMN `supplierAccountFk` mediumint(8) unsigned DEFAULT NULL NULL COMMENT 'Cuenta por defecto para ingresos desde este pais';
d

View File

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