salix/print/methods/csv/delivery-note/sql/ticket.sql

9 lines
219 B
MySQL
Raw Normal View History

SELECT
t.id,
t.clientFk,
c.email recipient,
eu.email salesPersonEmail
FROM ticket t
JOIN client c ON c.id = t.clientFk
LEFT JOIN account.emailUser eu ON eu.userFk = c.salesPersonFk
WHERE t.id = ?