Merge pull request 'removed extra attribute in invoice validation' (#80) from ranjith-dev into master
Reviewed-on: poc/pds#80
This commit is contained in:
@@ -135,24 +135,24 @@ class InvoiceValidationResource extends Resource
|
|||||||
->label('Serial Number')
|
->label('Serial Number')
|
||||||
->reactive()
|
->reactive()
|
||||||
->readOnly(fn (callable $get) => empty($get('invoice_number')))
|
->readOnly(fn (callable $get) => empty($get('invoice_number')))
|
||||||
//->disabled(fn (Get $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
|
|
||||||
->extraAttributes([
|
->extraAttributes([
|
||||||
'id' => 'serial_number_input',
|
'id' => 'serial_number_input',
|
||||||
'x-on:keydown.enter.prevent' => "
|
'x-data' => '{ value: "" }',
|
||||||
let serial = \$event.target.value;
|
'x-model' => 'value',
|
||||||
if (serial.trim() != '') {
|
'wire:keydown.enter.prevent' => 'processSerial(value)', // Using wire:keydown
|
||||||
\$wire.dispatch('process-scan', serial);
|
|
||||||
\$event.target.value = '';
|
|
||||||
}
|
|
||||||
",
|
|
||||||
])
|
])
|
||||||
|
// ->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) {
|
->afterStateUpdated(function ($state, callable $set, callable $get, callable $livewire) {
|
||||||
$set('update_invoice', 0);
|
$set('update_invoice', 0);
|
||||||
// $this->dispatch('focus-serial-number');
|
// $this->dispatch('focus-serial-number');
|
||||||
|
|||||||
@@ -2261,7 +2261,7 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function processSer($serNo)
|
public function processSerial($serNo)
|
||||||
{
|
{
|
||||||
$serNo = trim($serNo);
|
$serNo = trim($serNo);
|
||||||
$mSerNo = $serNo;
|
$mSerNo = $serNo;
|
||||||
@@ -3765,11 +3765,11 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[On('process-scan')]
|
// #[On('process-scan')]
|
||||||
public function processSerial($serial)
|
// public function processSerial($serial)
|
||||||
{
|
// {
|
||||||
$this->processSer($serial); // Your duplicate check + mail logic
|
// $this->processSer($serial); // Your duplicate check + mail logic
|
||||||
}
|
// }
|
||||||
|
|
||||||
public function getHeading(): string
|
public function getHeading(): string
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user