salix/print/templates/reports/invoice/sql/tickets.sql

16 lines
396 B
MySQL
Raw Normal View History

2021-02-24 06:51:05 +00:00
SELECT
t.id,
t.shipped,
t.nickname,
2023-12-07 12:47:07 +00:00
tto.description,
t.addressFk,
a.street
FROM invoiceOut io
JOIN ticket t ON t.refFk = io.REF
2023-12-07 12:47:07 +00:00
JOIN `address` a ON a.id = t.addressFk
LEFT JOIN observationType ot ON ot.code = 'invoiceOut'
LEFT JOIN ticketObservation tto ON tto.ticketFk = t.id
AND tto.observationTypeFk = ot.id
2022-07-21 08:05:37 +00:00
WHERE t.refFk = ?
ORDER BY t.shipped