diff --git a/app/Filament/Pages/DataSendToSap.php b/app/Filament/Pages/DataSendToSap.php index 06f420a..7f82c1c 100644 --- a/app/Filament/Pages/DataSendToSap.php +++ b/app/Filament/Pages/DataSendToSap.php @@ -86,6 +86,7 @@ class DataSendToSap extends Page implements HasForms if (!$productionOrder) { $set('pqproducError', 'Please provide production order.'); + $set('production_order', null); $set('scanned_quantity', null); $this->dispatch('refreshed', $this->pId, $this->pOrder); @@ -110,8 +111,7 @@ class DataSendToSap extends Page implements HasForms ->afterStateUpdated(function ($state, $set, $get) { $this->scanned_quantity = $state; }) - ->readOnly() - ->required(), + ->readOnly(), // Add your custom action button here Actions::make([ @@ -280,6 +280,9 @@ class DataSendToSap extends Page implements HasForms $this->pOrder = $value; + $plantId = trim($this->form->getState()['plant_id']) ?? null; + //$this->plantId = $plantId; + // $this->pUom = QualityValidation::where('plant_id',$this->pId) // ->where('production_order',$this->pOrder) @@ -305,6 +308,11 @@ class DataSendToSap extends Page implements HasForms ->send(); $this->dispatch('refreshed', $this->pId, $this->pOrder); + $this->pOrder = null; + $this->form->fill([ + 'plant_id' => $this->pId, + 'production_order' => null, + ]); return; }