Diverse aanpassing nav mail Peter
This commit is contained in:
@@ -27,7 +27,7 @@ class Projecthour extends BaseModel {
|
||||
|
||||
public static function getMonthlyEmployeeHoursPerProject( $employeeID, $year )
|
||||
{
|
||||
$projectHours = ProjecthoursPerEmployeePerMonth::fire($employeeID, $year);
|
||||
$projectHours = ProjecthoursPerEmployeePerMonth::fire( $employeeID, $year );
|
||||
|
||||
return $projectHours;
|
||||
}
|
||||
@@ -61,5 +61,21 @@ class Projecthour extends BaseModel {
|
||||
Projecthour::whereId( $projecthourID )->delete();
|
||||
}
|
||||
|
||||
public static function getTotalHoursPerProject( $projectID )
|
||||
{
|
||||
$totalProjecthours =
|
||||
self::selectRaw( "CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname,
|
||||
SUM(IF(hourtype_id = 1, hours, 0)) AS declarable,
|
||||
SUM(IF(hourtype_id = 1, hours * tarif, 0)) AS revenues,
|
||||
SUM(IF(hourtype_id != 1, hours, 0)) AS nondeclarable" )
|
||||
->join( 'projectemployees AS PRE', 'PRE.id', '=', 'projecthours.projectemployee_id' )
|
||||
->join( 'users AS USR', 'USR.id', '=', 'PRE.user_id' )
|
||||
->groupBy( 'USR.id' )
|
||||
->where( 'PRE.project_id', '=', $projectID )
|
||||
->get();
|
||||
|
||||
return $totalProjecthours;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user