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

10 lines
291 B
SQL

SELECT
io.amount,
io.ref,
io.issued,
ict.description
FROM vn.invoiceCorrection ic
JOIN vn.invoiceOut io ON io.id = ic.correctedFk
JOIN vn.invoiceCorrectionType ict ON ict.id = ic.invoiceCorrectionTypeFk
LEFT JOIN ticket t ON t.refFk = io.ref
WHERE t.refFk = ?