Diverse wijzigingen nav word document
This commit is contained in:
@@ -96,7 +96,7 @@ class Project extends BaseModel {
|
||||
Project::whereId( $projectID )->delete();
|
||||
}
|
||||
|
||||
public static function getActiveProjects( $archive = 'T' )
|
||||
public static function getActiveProjects( $archive = 'T', $sortField = FALSE, $direction = FALSE )
|
||||
{
|
||||
$projects = Project::selectRaw( "projects.id, YEAR(projects.startdate) AS instroom, YEAR(projects.enddate) AS uitstroom, projectnumber, current_financial_year,
|
||||
projectname, CUS.name, OFF.own_revenue, OFF.other_revenue" )
|
||||
@@ -106,6 +106,8 @@ class Project extends BaseModel {
|
||||
->groupBy( 'OFF.own_revenue' )
|
||||
->groupBy( 'OFF.other_revenue' );
|
||||
|
||||
if ( $sortField ) $projects = $projects->orderBy( $sortField, $direction );
|
||||
|
||||
if ( $archive == 'F' ) $projects = $projects->where( 'projects.archive', '=', 'F' );
|
||||
|
||||
$projects = $projects->get();
|
||||
@@ -113,12 +115,14 @@ class Project extends BaseModel {
|
||||
return $projects;
|
||||
}
|
||||
|
||||
public static function getProjectsForReport( $orderType, $orderDirection, $archive = 'F' )
|
||||
public static function getProjectsForReport( $orderType, $orderDirection, $archive = 'F', $projectsArray = FALSE )
|
||||
{
|
||||
$projects = self::getBaseProject();
|
||||
|
||||
if ( $archive == 'F' ) $projects = $projects->whereArchive( 'F' );
|
||||
|
||||
if ( is_array( $projectsArray ) ) $projects = $projects->whereIn( 'id', $projectsArray );
|
||||
|
||||
$projects = $projects->orderBy( $orderType, $orderDirection )->get();
|
||||
|
||||
return $projects;
|
||||
|
||||
Reference in New Issue
Block a user