2021-02-17 12:00:06 +00:00
|
|
|
SELECT
|
2021-02-18 12:01:01 +00:00
|
|
|
c.id,
|
|
|
|
c.socialName,
|
|
|
|
c.street AS postalAddress,
|
|
|
|
IF (ios.taxAreaFk IS NOT NULL, CONCAT(cty.code, c.fi), c.fi) fi,
|
|
|
|
CONCAT(c.postcode, ' - ', c.city) postcodeCity
|
|
|
|
FROM vn.invoiceOut io
|
|
|
|
JOIN vn.client c ON c.id = io.clientFk
|
|
|
|
JOIN vn.country cty ON cty.id = c.countryFk
|
|
|
|
LEFT JOIN vn.invoiceOutSerial ios ON ios.code = io.serial
|
|
|
|
AND ios.taxAreaFk = 'CEE'
|
|
|
|
WHERE io.id = ?
|