1
0
forked from poc/pds

Added operator_id and production_order column

This commit is contained in:
dhanabalan
2025-04-23 20:51:21 +05:30
parent 4b1a25ccbd
commit 2fa637bfab

View File

@@ -98,7 +98,7 @@ class CreateProductionQuantity extends CreateRecord
return $this->getResource()::getUrl('create'); // Stay on Create Page after saving 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; // protected static bool $canCreateAnother = false;
@@ -121,7 +121,7 @@ class CreateProductionQuantity extends CreateRecord
public function validateAndProcessForm($formValues) public function validateAndProcessForm($formValues)
{ {
$user = Filament::auth()->user(); $user = Filament::auth()->user(); //->name
$operatorName = $user->name; $operatorName = $user->name;
// $this->validate(); // $this->validate();
@@ -139,10 +139,18 @@ class CreateProductionQuantity extends CreateRecord
$this->iId = $formData['item_id'] ?? null; $this->iId = $formData['item_id'] ?? null;
$this->succId = $formData['success_msg'] ?? null; $this->succId = $formData['success_msg'] ?? null;
// $this->sNoId = $formData['serial_number'] ?? null; // $this->sNoId = $formData['serial_number'] ?? null;
$this->prodOrder = $formData['production_order'] ?? null;
$this->recQr = $formData['recent_qr'] ?? null; $this->recQr = $formData['recent_qr'] ?? null;
} catch (\Exception $e) { } 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) { if ($this->succId === null) {
@@ -154,6 +162,8 @@ class CreateProductionQuantity extends CreateRecord
'item_id'=> null, 'item_id'=> null,
'serial_number'=> null, 'serial_number'=> null,
'success_msg'=> null, 'success_msg'=> null,
'production_order'=> null,
'operator_id'=> $operatorName,
'recent_qr' => $this->recQr, 'recent_qr' => $this->recQr,
]); ]);
@@ -180,7 +190,8 @@ class CreateProductionQuantity extends CreateRecord
'line_id' => $this->lId, 'line_id' => $this->lId,
'item_id'=> $this->iId, 'item_id'=> $this->iId,
'serial_number' => $this->sNoId, 'serial_number' => $this->sNoId,
// 'operator_id'=> $operatorName, 'production_order'=> $this->prodOrder,
'operator_id'=> $operatorName,
]); ]);
// after success insertion // after success insertion
@@ -192,6 +203,8 @@ class CreateProductionQuantity extends CreateRecord
'item_id'=> null, 'item_id'=> null,
'serial_number'=> null, 'serial_number'=> null,
'success_msg'=> null, 'success_msg'=> null,
'production_order'=> $this->prodOrder,
'operator_id'=> $operatorName,
'recent_qr' => $itemCode.' | '.$this->sNoId, 'recent_qr' => $itemCode.' | '.$this->sNoId,
]); ]);