8 lines
325 B
MySQL
8 lines
325 B
MySQL
|
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
|
||
|
WHERE io.id = ?
|
||
|
AND IF(c.hasToinvoiceByAddress = FALSE, c.defaultAddressFk, TRUE)
|
||
|
LIMIT 1
|