removed extra attribute in invoice validation
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user