diversen opmerkingen Peter

This commit is contained in:
2018-04-02 17:32:20 +02:00
parent 0fd25f359b
commit 1b0ad5de83
5 changed files with 79 additions and 29 deletions
@@ -16,8 +16,8 @@ class Qinvoiceoverview {
PRJ.projectname,
(own_revenue + other_revenue ) AS revenues,
CUS.name AS customername,
SUM(IF( YEAR(invoicedate) = {$year},invoiceamount, 0)) AS currentyear,
SUM(IF( YEAR(invoicedate) != {$year},invoiceamount, 0)) AS otheryear,
SUM(IF( YEAR(invoicedate) = {$year}, invoiceamount* ((100 + vts.vatrate)/100), 0)) AS currentyear,
SUM(IF( YEAR(invoicedate) != {$year}, invoiceamount * ((100 + vts.vatrate)/100), 0)) AS otheryear,
SUM(COALESCE(Q1.currentyearpayed, 0)) AS currentyearpayed,
SUM(COALESCE(Q1.otheryearpayed, 0)) AS otheryearpayed,
CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname,
@@ -35,6 +35,8 @@ class Qinvoiceoverview {
ON CUS.id = PRJ.customer_id
JOIN users USR
ON USR.id = PRJ.projectleader_id
JOIN vats VTS
ON VTS.id = INV.vat_id
LEFT JOIN (
SELECT invoice_id,
SUM(IF(YEAR(paymentdate) = {$year},paymentamount, 0)) AS currentyearpayed,