Added monthly logic in paroduction target plan
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 2m39s
Laravel Larastan / larastan (pull_request) Failing after 7m14s

This commit is contained in:
dhanabalan
2026-09-30 14:06:22 +05:30
parent 7f30695012
commit 0fd6ca6f12
2 changed files with 75 additions and 0 deletions

View File

@@ -20,6 +20,8 @@ class ProductionTargetPlan extends Component
public $dates = [];
public $monthlyRecords;
public $leaveDates = [];
public $productionPlanDates = '';
@@ -27,6 +29,7 @@ class ProductionTargetPlan extends Component
protected $listeners = [
'loadData' => 'loadProductionData',
'loadData1' => 'exportProductionData',
'loadDataMonthly' => 'loadMonthlyPlan',
];
public function getMonthDates($month, $year)
@@ -625,6 +628,19 @@ class ProductionTargetPlan extends Component
$this->records = $records;
}
public function loadMonthlyPlan($year, $month, $plantId, $lineId){
$this->monthlyRecords = ProductionPlan::query()
->selectRaw('
plant_id,
line_id,
SUM(plan_quantity) as monthly_plan
')
->whereYear('created_at', $year)
->whereMonth('created_at', $month)
->groupBy('plant_id', 'line_id')
->get();
}
public function exportProductionData()
{