|
|
|
@ -66,11 +66,11 @@ class DashboardBoDController extends Controller
|
|
|
|
|
|
|
|
|
|
return response()->json([ |
|
|
|
|
'data' => [ |
|
|
|
|
'total_budget' => (int) ($totalBudgets->total_rencana_biaya ?? 0), |
|
|
|
|
'total_budget' => $totalBudgets->total_value_proyek ?? 0, |
|
|
|
|
'total_expenditure' => $totalExpenditure, |
|
|
|
|
'total_invoice' => $totalInvoice, |
|
|
|
|
'total_paid_invoice' => $totalPaidInvoice, |
|
|
|
|
'total_value_proyek' => $totalBudgets->total_value_proyek ?? 0, |
|
|
|
|
'total_value_proyek' => (int) ($totalBudgets->total_rencana_biaya ?? 0), |
|
|
|
|
'total_income_year' => $totalBudgets->total_income_year ?? 0 |
|
|
|
|
] |
|
|
|
|
], 200); |
|
|
|
@ -288,10 +288,7 @@ class DashboardBoDController extends Controller
|
|
|
|
|
->pluck('id'); |
|
|
|
|
|
|
|
|
|
// arr overrun |
|
|
|
|
if ($role === 'Super Admin') { |
|
|
|
|
$response['data']['overrun'] = Project::where('budget_health', 'overrun') |
|
|
|
|
->count(); |
|
|
|
|
} elseif ($all_project == 'true') { |
|
|
|
|
if ($all_project) { |
|
|
|
|
$response['data']['overrun'] = Project::whereIn('divisi_id', $divisi) |
|
|
|
|
->where([['budget_health', 'overrun']]) |
|
|
|
|
->count(); |
|
|
|
@ -301,10 +298,7 @@ class DashboardBoDController extends Controller
|
|
|
|
|
->count(); |
|
|
|
|
} |
|
|
|
|
// arr warning |
|
|
|
|
if ($role === 'Super Admin') { |
|
|
|
|
$response['data']['warning'] = Project::where('budget_health', 'warning') |
|
|
|
|
->count(); |
|
|
|
|
} elseif ($all_project == 'true') { |
|
|
|
|
if ($all_project) { |
|
|
|
|
$response['data']['warning'] = Project::whereIn('divisi_id', $divisi) |
|
|
|
|
->where([['budget_health', 'warning']]) |
|
|
|
|
->count(); |
|
|
|
@ -314,10 +308,7 @@ class DashboardBoDController extends Controller
|
|
|
|
|
->count(); |
|
|
|
|
} |
|
|
|
|
// arr on-budget |
|
|
|
|
if ($role === 'Super Admin') { |
|
|
|
|
$response['data']['on-budget'] = Project::where('budget_health', 'on-budget') |
|
|
|
|
->count(); |
|
|
|
|
} elseif ($all_project == 'true') { |
|
|
|
|
if ($all_project) { |
|
|
|
|
$response['data']['on-budget'] = Project::whereIn('divisi_id', $divisi) |
|
|
|
|
->where([['budget_health', 'on-budget']]) |
|
|
|
|
->count(); |
|
|
|
|