fix: refs #7748 solicitud de domiciliación bancaria
gitea/salix/pipeline/pr-master This commit looks good Details

This commit is contained in:
Carlos Andrés 2024-07-18 19:48:35 +02:00
parent 9003f2db91
commit 9d17a9e827
3 changed files with 6 additions and 15 deletions

View File

@ -1,13 +1,12 @@
const vnReport = require('../../../core/mixins/vn-report.js');
const db = require('../../../core/database');
module.exports = {
name: 'sepa-core',
mixins: [vnReport],
async serverPrefetch() {
this.client = await this.findOneFromDef('client', [this.companyId, this.companyId, this.id]);
this.client = await this.findOneFromDef('client', [this.id]);
this.checkMainEntity(this.client);
const suppliers = await this.rawSqlFromDef('supplier', [this.companyId, this.companyId, this.id]);
const suppliers = await this.rawSqlFromDef('supplier', [this.companyId, this.id]);
this.supplier = {
...suppliers[0],
accountDetailValue: suppliers.map(val => val?.accountDetailValue)

View File

@ -1,5 +1,4 @@
SELECT c.id,
m.code mandateCode,
c.socialName,
c.street,
c.postcode,
@ -11,11 +10,5 @@ SELECT c.id,
ct.ibanLength ibanLength
FROM client c
JOIN country ct ON ct.id = c.countryFk
LEFT JOIN province p ON p.id = c.provinceFk
LEFT JOIN mandate m ON m.clientFk = c.id
AND m.companyFk = ?
AND m.finished IS NULL
WHERE (m.companyFk = ? OR m.companyFk IS NULL)
AND c.id = ?
ORDER BY m.created DESC
LIMIT 1
JOIN province p ON p.id = c.provinceFk
WHERE c.id = ?

View File

@ -20,6 +20,5 @@ SELECT m.code mandateCode,
AND c.id = ?
AND mt.name = 'CORE'
AND adt.description = 'Referencia Remesas'
GROUP BY m.id
ORDER BY m.created DESC
LIMIT 1;
GROUP BY m.id, ad.value
ORDER BY m.created DESC