fix: refs#7748 solicitud de domiciliación bancaria #2752
|
@ -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)
|
||||
|
|
|
@ -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 = ?
|
|
@ -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
|
Loading…
Reference in New Issue