salix/print/templates/reports/receipt/sql/receipt.sql

11 lines
255 B
MySQL
Raw Normal View History

2020-09-25 12:45:00 +00:00
SELECT
r.id,
r.amountPaid,
cr.amount AS amountUnpaid,
2020-09-25 12:45:00 +00:00
r.payed,
r.companyFk
FROM receipt r
JOIN client c ON c.id = r.clientFk
2021-07-01 07:56:22 +00:00
JOIN vn.clientRisk cr ON cr.clientFk = c.id
AND cr.companyFk = r.companyFk
2020-09-25 12:45:00 +00:00
WHERE r.id = ?