2021-03-01 10:25:37 +00:00
|
|
|
SELECT IF(incotermsFk IS NULL, FALSE, TRUE) AS hasIncoterms
|
|
|
|
FROM ticket t
|
|
|
|
JOIN invoiceOut io ON io.ref = t.refFk
|
|
|
|
JOIN client c ON c.id = t.clientFk
|
|
|
|
JOIN address a ON a.id = t.addressFk
|
2022-07-21 08:05:37 +00:00
|
|
|
WHERE t.refFk = ?
|
2021-03-01 10:25:37 +00:00
|
|
|
AND IF(c.hasToinvoiceByAddress = FALSE, c.defaultAddressFk, TRUE)
|
|
|
|
LIMIT 1
|