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
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:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user