6745-2404_testToMaster #1950
|
@ -27,7 +27,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{$t('supplier.identifier')}}</td>
|
<td>{{$t('supplier.identifier')}}</td>
|
||||||
<th>
|
<th>
|
||||||
<div>{{$t('supplier.iban')}}</div>
|
<div>{{supplier.iban}}</div>
|
||||||
<div>{{supplier.nif}}</div>
|
<div>{{supplier.nif}}</div>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -1,17 +1,24 @@
|
||||||
SELECT
|
SELECT
|
||||||
m.code mandateCode,
|
m.code AS mandateCode,
|
||||||
s.name,
|
s.name,
|
||||||
s.street,
|
s.street,
|
||||||
sc.country,
|
sc.country,
|
||||||
s.postCode,
|
s.postCode,
|
||||||
s.city,
|
s.city,
|
||||||
sp.name province
|
sp.name AS province,
|
||||||
FROM client c
|
s.nif,
|
||||||
LEFT JOIN mandate m ON m.clientFk = c.id
|
sa.iban,
|
||||||
AND m.companyFk = ? AND m.finished IS NULL
|
be.name AS bankName
|
||||||
|
FROM
|
||||||
|
client c
|
||||||
|
LEFT JOIN mandate m ON m.clientFk = c.id AND m.companyFk = ? AND m.finished IS NULL
|
||||||
LEFT JOIN supplier s ON s.id = m.companyFk
|
LEFT JOIN supplier s ON s.id = m.companyFk
|
||||||
LEFT JOIN country sc ON sc.id = s.countryFk
|
LEFT JOIN country sc ON sc.id = s.countryFk
|
||||||
LEFT JOIN province sp ON sp.id = s.provinceFk
|
LEFT JOIN province sp ON sp.id = s.provinceFk
|
||||||
LEFT JOIN province p ON p.id = c.provinceFk
|
LEFT JOIN province p ON p.id = c.provinceFk
|
||||||
WHERE (m.companyFk = ? OR m.companyFk IS NULL) AND c.id = ?
|
LEFT JOIN bankEntity be ON sa.supplierFk = s.id
|
||||||
ORDER BY m.created DESC LIMIT 1
|
LEFT JOIN supplierAccount sa ON sa.bankEntityFk = be.id
|
||||||
|
WHERE (m.companyFk = ? OR m.companyFk IS NULL) AND c.id = ? OR (c.id IS NULL AND c.countryFk = sa.countryFk)
|
||||||
|
ORDER BY
|
||||||
|
m.created DESC
|
||||||
|
LIMIT 1;
|
||||||
|
|
Loading…
Reference in New Issue