1
0
forked from poc/pds

removed extra attribute in invoice validation

This commit is contained in:
dhanabalan
2025-12-06 16:44:52 +05:30
parent 385103323a
commit cdd746d5da
2 changed files with 21 additions and 21 deletions

View File

@@ -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');

View File

@@ -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
{