1
0
forked from poc/pds

Added monthly logic in paroduction target plan

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()
{