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