diff --git a/app/Filament/Resources/ProductionQuantityResource/Pages/CreateProductionQuantity.php b/app/Filament/Resources/ProductionQuantityResource/Pages/CreateProductionQuantity.php index 4234f22..52d0046 100644 --- a/app/Filament/Resources/ProductionQuantityResource/Pages/CreateProductionQuantity.php +++ b/app/Filament/Resources/ProductionQuantityResource/Pages/CreateProductionQuantity.php @@ -98,7 +98,7 @@ class CreateProductionQuantity extends CreateRecord return $this->getResource()::getUrl('create'); // Stay on Create Page after saving } - public $qrData, $pId, $bId, $sId, $lId, $iId, $succId, $sNoId, $succStat, $recQr; + public $qrData, $pId, $bId, $sId, $lId, $iId, $succId, $sNoId, $succStat, $recQr, $prodOrder; // protected static bool $canCreateAnother = false; @@ -121,7 +121,7 @@ class CreateProductionQuantity extends CreateRecord public function validateAndProcessForm($formValues) { - $user = Filament::auth()->user(); + $user = Filament::auth()->user(); //->name $operatorName = $user->name; // $this->validate(); @@ -139,10 +139,18 @@ class CreateProductionQuantity extends CreateRecord $this->iId = $formData['item_id'] ?? null; $this->succId = $formData['success_msg'] ?? null; // $this->sNoId = $formData['serial_number'] ?? null; + $this->prodOrder = $formData['production_order'] ?? null; $this->recQr = $formData['recent_qr'] ?? null; } catch (\Exception $e) { - dd('Error parsing form data:', $e->getMessage(), $formValues); + //dd('Error parsing form data:', $e->getMessage(), $formValues); + Notification::make() + ->title("Error Parsing Form Data") // {$operatorName} + ->body($e->getMessage()) + ->danger() + // ->persistent() + ->send(); + return; } if ($this->succId === null) { @@ -154,6 +162,8 @@ class CreateProductionQuantity extends CreateRecord 'item_id'=> null, 'serial_number'=> null, 'success_msg'=> null, + 'production_order'=> null, + 'operator_id'=> $operatorName, 'recent_qr' => $this->recQr, ]); @@ -180,7 +190,8 @@ class CreateProductionQuantity extends CreateRecord 'line_id' => $this->lId, 'item_id'=> $this->iId, 'serial_number' => $this->sNoId, - // 'operator_id'=> $operatorName, + 'production_order'=> $this->prodOrder, + 'operator_id'=> $operatorName, ]); // after success insertion @@ -192,6 +203,8 @@ class CreateProductionQuantity extends CreateRecord 'item_id'=> null, 'serial_number'=> null, 'success_msg'=> null, + 'production_order'=> $this->prodOrder, + 'operator_id'=> $operatorName, 'recent_qr' => $itemCode.' | '.$this->sNoId, ]);