|
|
|
@ -41,7 +41,6 @@ class DashboardBoDController extends Controller
|
|
|
|
|
->sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)')); |
|
|
|
|
} |
|
|
|
|
$totalBudgets = Project::sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)')); |
|
|
|
|
dd($totalBudgets); |
|
|
|
|
$projects = null; |
|
|
|
|
|
|
|
|
|
if (!empty($all_project) || $role === "Super Admin") { |
|
|
|
@ -380,7 +379,6 @@ class DashboardBoDController extends Controller
|
|
|
|
|
public function getTotalProjectPerPhase($role_name, $all_project, $hierarchy) |
|
|
|
|
{ |
|
|
|
|
$role = urldecode($role_name); |
|
|
|
|
$projectPhases = null; |
|
|
|
|
$projectPhases = ProjectPhase::orderBy('order')->get(); |
|
|
|
|
|
|
|
|
|
foreach ($projectPhases as $phase) { |
|
|
|
@ -460,17 +458,15 @@ class DashboardBoDController extends Controller
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getDetailExpenditure($year = '%', $all_project, $hierarchy) |
|
|
|
|
public function getDetailExpenditure($all_project, $hierarchy, $role_name) |
|
|
|
|
{ |
|
|
|
|
$year = $this->interpolateYear($year); |
|
|
|
|
// $year = $this->interpolateYear($year); |
|
|
|
|
$projects = null; |
|
|
|
|
if ($all_project) { |
|
|
|
|
$projects = Project::where('mulai_proyek', 'like', $year) |
|
|
|
|
->orderBy('id', 'desc') |
|
|
|
|
$projects = Project::orderBy('id', 'desc') |
|
|
|
|
->get(); |
|
|
|
|
} else { |
|
|
|
|
$projects = Project::where('mulai_proyek', 'like', $year) |
|
|
|
|
->where('created_by_id', $hierarchy) |
|
|
|
|
$projects = Project::where('created_by_id', $hierarchy) |
|
|
|
|
->orderBy('id', 'desc') |
|
|
|
|
->get(); |
|
|
|
|
} |
|
|
|
|