Added monthly plan in production target plan
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Successful in 2m37s
Laravel Larastan / larastan (pull_request) Failing after 5m35s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Successful in 2m37s
Laravel Larastan / larastan (pull_request) Failing after 5m35s
This commit is contained in:
@@ -23,6 +23,8 @@ class ProductionTargetPlan extends Component
|
||||
|
||||
public $monthlyRecords = [];
|
||||
|
||||
public $monthlyActualQuantity = [];
|
||||
|
||||
public $leaveDates = [];
|
||||
|
||||
public $productionPlanDates = '';
|
||||
@@ -635,22 +637,23 @@ class ProductionTargetPlan extends Component
|
||||
|
||||
$this->records = $records;
|
||||
|
||||
// $this->monthlyRecords = ProductionPlan::where('plant_id', $plantId)
|
||||
// ->where('line_id', $lineId)
|
||||
// ->whereYear('created_at', $year)
|
||||
// ->whereMonth('created_at', $month)
|
||||
// ->sum('plan_quantity');
|
||||
$this->monthlyRecords = ProductionPlan::where('plant_id', $plantId)
|
||||
->where('line_id', $lineId)
|
||||
->whereYear('created_at', $year)
|
||||
->whereMonth('created_at', $month)
|
||||
->sum('plan_quantity');
|
||||
|
||||
// $this->monthlyRecords = $plans->sum('plan_quantity');
|
||||
$this->monthlyActualQuantity = ProductionPlan::where('plant_id', $plantId)
|
||||
->where('line_id', $lineId)
|
||||
->whereBetween('created_at', [
|
||||
Carbon::create($year, $month, 1)->startOfMonth(),
|
||||
now(),
|
||||
])
|
||||
->count();
|
||||
|
||||
//$this->monthlyRecords = $plans->sum('plan_quantity');
|
||||
}
|
||||
|
||||
// public function loadMonthlyPlan($year, $month, $plantId, $lineId){
|
||||
// $this->monthlyRecords = ProductionPlan::where('plant_id', $plantId)
|
||||
// ->where('line_id', $lineId)
|
||||
// ->whereYear('created_at', $year)
|
||||
// ->whereMonth('created_at', $month)
|
||||
// ->sum('plan_quantity');
|
||||
// }
|
||||
public function exportProductionData()
|
||||
{
|
||||
return Excel::download(
|
||||
@@ -664,9 +667,9 @@ class ProductionTargetPlan extends Component
|
||||
// return view('livewire.production-target-plan');
|
||||
return view('livewire.production-target-plan', [
|
||||
'records' => $this->records,
|
||||
// 'monthlyRecords' => $this->monthlyRecords,
|
||||
'monthlyRecords' => $this->monthlyRecords,
|
||||
'monthlyActualRecords' => $this->monthlyActualQuantity,
|
||||
'dates' => $this->dates,
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user