ranjith-dev #1135

Merged
jothi merged 2 commits from ranjith-dev into master 2026-09-30 08:56:20 +00:00
3 changed files with 11 additions and 10 deletions

View File

@@ -209,7 +209,7 @@ class ProductionTarget extends Page
$this->dispatch('loadData1' ,$plantId, $lineId, $year, $month);
$this->dispatch('loadDataMonthly' ,$plantId, $lineId, $year, $month);
// $this->dispatch('loadDataMonthly' ,$plantId, $lineId, $year, $month);
}
public static function canAccess(): bool

View File

@@ -626,16 +626,22 @@ class ProductionTargetPlan extends Component
}
$this->records = $records;
}
public function loadMonthlyPlan($year, $month, $plantId, $lineId){
return ProductionPlan::where('plant_id', $plantId)
$this->monthlyRecords = ProductionPlan::where('plant_id', $plantId)
->where('line_id', $lineId)
->whereYear('created_at', $year)
->whereMonth('created_at', $month)
->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()
{

View File

@@ -35,12 +35,7 @@
</td>
<td class="border px-4 py-2 whitespace-nowrap font-semibold">
{{ $this->loadMonthlyPlan(
$year,
$month,
$record['plant_id'],
$record['line_id']
) }}
{{ $monthlyRecords ?? 0 }}
</td>
</tr>