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

16 lines
362 B
SQL

SELECT
i.id,
s.id supplierId,
i.created,
s.name,
s.street AS postalAddress,
s.nif,
s.phone,
p.name payMethod,
c.companyCode
FROM invoiceIn i
JOIN supplier s ON s.id = i.supplierFk
JOIN company c ON c.id = i.companyFk
JOIN payMethod p ON p.id = s.payMethodFk
WHERE i.id = ?