Diversen nav opmerkingen

This commit is contained in:
2018-05-05 20:55:18 +02:00
parent b589058437
commit a3d200c38b
10 changed files with 156 additions and 17 deletions
@@ -23,7 +23,6 @@ class Qinvoiceoverview {
CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname,
( SELECT vatrate FROM vats WHERE archive = 'F' LIMIT 1 ) AS vatrate,
COALESCE(reserved, 0 ) AS reserved,
COALESCE(reservedpayed, 0 ) AS reservedpayed,
COALESCE(currentforecast, 0) AS currentforecast,
COALESCE(otherforecast, 0) AS otherforecast
FROM invoices INV
@@ -47,8 +46,7 @@ class Qinvoiceoverview {
ON INV.id = Q1.invoice_id
LEFT JOIN (
SELECT project_id,
SUM(IF(payed='UNPAYED', reservationamount, 0)) reserved,
SUM(IF(payed='PAYED', reservationamount, 0)) reservedpayed
SUM( reservationamount) reserved
FROM reservations
GROUP BY project_id
) AS Q2