Diverse aanpassing nav mail Peter
This commit is contained in:
@@ -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 ";
|
||||
|
||||
Reference in New Issue
Block a user