This commit is contained in:
parent
2f9979046d
commit
344b5d984a
|
@ -27,7 +27,7 @@
|
|||
<tr>
|
||||
<td>{{$t('supplier.identifier')}}</td>
|
||||
<th>
|
||||
<div>{{$t('supplier.iban')}}</div>
|
||||
<div>{{supplier.iban}}</div>
|
||||
<div>{{supplier.nif}}</div>
|
||||
</th>
|
||||
</tr>
|
||||
|
|
|
@ -1,17 +1,24 @@
|
|||
SELECT
|
||||
m.code mandateCode,
|
||||
s.name,
|
||||
s.street,
|
||||
sc.country,
|
||||
s.postCode,
|
||||
s.city,
|
||||
sp.name province
|
||||
FROM client c
|
||||
LEFT JOIN mandate m ON m.clientFk = c.id
|
||||
AND m.companyFk = ? AND m.finished IS NULL
|
||||
m.code AS mandateCode,
|
||||
s.name,
|
||||
s.street,
|
||||
sc.country,
|
||||
s.postCode,
|
||||
s.city,
|
||||
sp.name AS province,
|
||||
s.nif,
|
||||
sa.iban,
|
||||
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 country sc ON sc.id = s.countryFk
|
||||
LEFT JOIN province sp ON sp.id = s.provinceFk
|
||||
LEFT JOIN province p ON p.id = c.provinceFk
|
||||
WHERE (m.companyFk = ? OR m.companyFk IS NULL) AND c.id = ?
|
||||
ORDER BY m.created DESC LIMIT 1
|
||||
LEFT JOIN bankEntity be ON sa.supplierFk = s.id
|
||||
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