diversen opmerkingen Peter
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user