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

11 lines
262 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
JOIN bi.customer_risk cr ON cr.customer_id = c.id
AND cr.company_id = r.companyFk
2020-09-25 12:45:00 +00:00
WHERE r.id = ?