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

This commit is contained in:
dhanabalan
2026-10-01 18:09:23 +05:30
parent d76c911880
commit 80547e2e04
2 changed files with 10 additions and 5 deletions

View File

@@ -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,
]);
}

View File

@@ -48,7 +48,7 @@
{{ $monthlyActualQuantity ?? 0 }}
</td>
<td class="border px-4 py-2 whitespace-nowrap font-semibold">
{{ $monthlyRecords ?? 0 }}
{{ number_format($efficiency ?? 0, 2) }}%
</td>
</tr>