Diverse aanpassing nav mail Peter

This commit is contained in:
2019-02-22 14:19:03 +01:00
parent d71692f320
commit 695f6c6960
23 changed files with 295 additions and 79 deletions
@@ -49,7 +49,21 @@ class QEmployeeHours {
if( $month != 0 ) $sql .= "AND MONTH(hourdate) = '$month' ";
$sql .= "
GROUP BY PEM.user_id, MONTH(hourdate)
UNION
SELECT PH.projectemployee_id AS user_id,
MONTH(hourdate) monthID,
SUM(hours) AS projecthours,
0 AS profitablehours,
SUM(IF(hourtype_id = 3, hours, 0)) AS nonprofitablehours,
0 AS revenues,
0 AS nonprojecthours
FROM projecthours PH
WHERE YEAR(hourdate) = '{$year}' ";
if( $month != 0 ) $sql .= "AND MONTH(hourdate) = '$month' ";
$sql .= "
GROUP BY PH.projectemployee_id, MONTH(hourdate)
) AS Q1
JOIN users AS USR
ON USR.id = Q1.user_id
GROUP BY user_id ";