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

13 lines
322 B
MySQL
Raw Normal View History

2021-02-24 06:51:05 +00:00
SELECT
t.id,
t.shipped,
t.nickname,
tto.description
FROM invoiceOut io
JOIN ticket t ON t.refFk = io.REF
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