Added efficiency in target plan
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Pint / pint (pull_request) Successful in 4m23s
Laravel Larastan / larastan (pull_request) Failing after 5m47s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Pint / pint (pull_request) Successful in 4m23s
Laravel Larastan / larastan (pull_request) Failing after 5m47s
This commit is contained in:
@@ -23,6 +23,8 @@ class ProductionTargetPlan extends Component
|
||||
|
||||
public $monthlyRecords = [];
|
||||
|
||||
public $efficiency = [];
|
||||
|
||||
public $monthlyActualQuantity = [];
|
||||
|
||||
public $leaveDates = [];
|
||||
@@ -645,12 +647,14 @@ class ProductionTargetPlan extends Component
|
||||
|
||||
$this->monthlyActualQuantity = ProductionPlan::where('plant_id', $plantId)
|
||||
->where('line_id', $lineId)
|
||||
->whereBetween('created_at', [
|
||||
Carbon::create($year, $month, 1)->startOfMonth(),
|
||||
now(),
|
||||
])
|
||||
->whereYear('created_at', $year)
|
||||
->whereMonth('created_at', $month)
|
||||
->count();
|
||||
|
||||
$this->efficiency = $this->monthlyRecords > 0
|
||||
? ($this->monthlyActualQuantity / $this->monthlyRecords) * 100
|
||||
: 0;
|
||||
|
||||
//$this->monthlyRecords = $plans->sum('plan_quantity');
|
||||
}
|
||||
|
||||
@@ -669,6 +673,7 @@ class ProductionTargetPlan extends Component
|
||||
'records' => $this->records,
|
||||
'monthlyRecords' => $this->monthlyRecords,
|
||||
'monthlyActualRecords' => $this->monthlyActualQuantity,
|
||||
'monthlyEfficiency' => $this->efficiency,
|
||||
'dates' => $this->dates,
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user