salix/print/methods/csv/invoice/sql/invoice.sql

9 lines
228 B
MySQL
Raw Normal View History

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