Added export button in non planned production page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 4m48s
Laravel Larastan / larastan (pull_request) Failing after 5m57s

This commit is contained in:
dhanabalan
2026-10-12 14:11:21 +05:30
parent 8b8e89ba5d
commit ee44ac832c
2 changed files with 54 additions and 0 deletions

View File

@@ -174,6 +174,53 @@ class ProductionNonPlannedReport extends Page implements HasForms
}
}
public function exportNonPlan(){
$plantId = $this->filters['plant_id'] ?? null;
$lineId = $this->filters['line_id'] ?? null;
$date = $this->filters['date'] ?? null;
$selectedDate = Carbon::parse($date);
$date = $selectedDate->toDateString();
$month = $selectedDate->month;
$year = $selectedDate->year;
if (! $plantId) {
Notification::make()
->title('Plant')
->body("please select plant to export data..!")
->danger()
->send();
return;
}
else if (! $lineId) {
Notification::make()
->title('Line')
->body("please select line to export data..!")
->danger()
->send();
return;
}
else if (! $year) {
Notification::make()
->title('Year')
->body("please select year to export data..!")
->danger()
->send();
return;
}
else if (! $month) {
Notification::make()
->title('Month')
->body("please select month to export data..!")
->danger()
->send();
return;
}
$this->dispatch('loadDataExport' ,$plantId, $lineId, $year, $month);
}
public static function canAccess(): bool
{
return Auth::check() && Auth::user()->can('view production non planned page');