From cdd746d5da3ede670162566dc6965c29f6163288 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Sat, 6 Dec 2025 16:44:52 +0530 Subject: [PATCH] removed extra attribute in invoice validation --- .../Resources/InvoiceValidationResource.php | 30 +++++++++---------- .../Pages/CreateInvoiceValidation.php | 12 ++++---- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/Filament/Resources/InvoiceValidationResource.php b/app/Filament/Resources/InvoiceValidationResource.php index 0ac171fd9..01cbaed35 100644 --- a/app/Filament/Resources/InvoiceValidationResource.php +++ b/app/Filament/Resources/InvoiceValidationResource.php @@ -135,24 +135,24 @@ class InvoiceValidationResource extends Resource ->label('Serial Number') ->reactive() ->readOnly(fn (callable $get) => empty($get('invoice_number'))) - //->disabled(fn (Get $get) => empty($get('invoice_number'))) - // ->extraAttributes([ - // 'id' => 'serial_number_input', - // 'x-data' => '{ value: "" }', - // 'x-model' => 'value', - // 'wire:keydown.enter.prevent' => 'processSerial(value)', // Using wire:keydown - // ]) - ->dehydrated(false) // Do not trigger Livewire syncing + ->disabled(fn (Get $get) => empty($get('invoice_number'))) ->extraAttributes([ 'id' => 'serial_number_input', - 'x-on:keydown.enter.prevent' => " - let serial = \$event.target.value; - if (serial.trim() != '') { - \$wire.dispatch('process-scan', serial); - \$event.target.value = ''; - } - ", + 'x-data' => '{ value: "" }', + 'x-model' => 'value', + 'wire:keydown.enter.prevent' => 'processSerial(value)', // Using wire:keydown ]) + // ->dehydrated(false) // Do not trigger Livewire syncing + // ->extraAttributes([ + // 'id' => 'serial_number_input', + // 'x-on:keydown.enter.prevent' => " + // let serial = \$event.target.value; + // if (serial.trim() != '') { + // \$wire.dispatch('process-scan', serial); + // \$event.target.value = ''; + // } + // ", + // ]) ->afterStateUpdated(function ($state, callable $set, callable $get, callable $livewire) { $set('update_invoice', 0); // $this->dispatch('focus-serial-number'); diff --git a/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php b/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php index a09413f1b..c2fbeb614 100644 --- a/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php +++ b/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php @@ -2261,7 +2261,7 @@ class CreateInvoiceValidation extends CreateRecord ]; } - public function processSer($serNo) + public function processSerial($serNo) { $serNo = trim($serNo); $mSerNo = $serNo; @@ -3765,11 +3765,11 @@ class CreateInvoiceValidation extends CreateRecord } } - #[On('process-scan')] - public function processSerial($serial) - { - $this->processSer($serial); // Your duplicate check + mail logic - } + // #[On('process-scan')] + // public function processSerial($serial) + // { + // $this->processSer($serial); // Your duplicate check + mail logic + // } public function getHeading(): string {