1
0
forked from poc/pds

Update invoice data handling to include onCapFocus parameter and adjust focus function and timing for input fields

This commit is contained in:
dhanabalan
2025-11-21 17:18:31 +05:30
parent 376ee84e63
commit affa38251d
3 changed files with 47 additions and 30 deletions

View File

@@ -97,7 +97,7 @@ class CreateInvoiceValidation extends CreateRecord
'update_invoice' => false,
'scanned_quantity'=> $scanSQuan
]);
$this->dispatch('refreshInvoiceData', invoiceNumber: $this->invoiceNumber, plantId: $this->plantId);
$this->dispatch('refreshInvoiceData', invoiceNumber: $this->invoiceNumber, plantId: $this->plantId, onCapFocus: false);
}
}
@@ -211,7 +211,7 @@ class CreateInvoiceValidation extends CreateRecord
->send();
$this->dispatch('playNotificationSound');
// $hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId); //$this->invoiceNumber
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false); //$this->invoiceNumber
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
if ($updateStatus == '1')
@@ -852,7 +852,7 @@ class CreateInvoiceValidation extends CreateRecord
'scanned_quantity'=> $scanSQuan,
]);
//$hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
// $this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
// $this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
if ($totQuan == $scanSQuan)
{
@@ -893,7 +893,7 @@ class CreateInvoiceValidation extends CreateRecord
->seconds(1)
->send();
$this->dispatch('playNotificationSound');
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
if ($updateStatus == '1')
{
@@ -1284,8 +1284,8 @@ class CreateInvoiceValidation extends CreateRecord
// }
// $hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId); //$this->invoiceNumber
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false); //$this->invoiceNumber
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
}
}
else
@@ -1894,7 +1894,7 @@ class CreateInvoiceValidation extends CreateRecord
// }
// $hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId); //$this->invoiceNumber
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false); //$this->invoiceNumber
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
}
}
@@ -2270,8 +2270,8 @@ class CreateInvoiceValidation extends CreateRecord
// }
// $hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId); //$this->invoiceNumber
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
// $this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false); //$this->invoiceNumber
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
}
}
else
@@ -2343,7 +2343,16 @@ class CreateInvoiceValidation extends CreateRecord
else
{
$hasRecords = $hasInvoice->stickerMasterRelation->material_type ?? null;
$this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $this->invoiceNumber, plantId: $this->plantId);
//$this->dispatch( (!empty($hasRecords) && $hasRecords) ? 'refreshMaterialInvoiceData' : 'refreshInvoiceData', invoiceNumber: $this->invoiceNumber, plantId: $this->plantId);
if (!empty($hasRecords) && $hasRecords)
{
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $this->invoiceNumber, plantId: $this->plantId);
}
else
{
$this->dispatch('refreshInvoiceData', invoiceNumber: $this->invoiceNumber, plantId: $this->plantId, onCapFocus: false);
}
}
}
}
@@ -2459,7 +2468,7 @@ class CreateInvoiceValidation extends CreateRecord
'scanned_quantity'=> $scanMQuan,
]);
//$hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
$this->dispatch( 'refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
}
$pattern1 = '/^(?<item_code>[^|]+)\|(?<batch_number>[^|]+)\|(?<batch_id>[^|]+)\|(?<batch_count>[^|]+)\/(?<batch_quantity>.+)$/i';
@@ -3209,7 +3218,7 @@ class CreateInvoiceValidation extends CreateRecord
'update_invoice' => false,
'scanned_quantity'=> $scannedMQuantity,
]);
$this->dispatch( 'refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
$this->dispatch('refreshMaterialInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
}
return;
}
@@ -3259,7 +3268,7 @@ class CreateInvoiceValidation extends CreateRecord
'scanned_quantity'=> $scanSQuan,
]);
//$hasRecords = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->first()->stickerMasterRelation->material_type ?? null;
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
}
///^([a-zA-Z0-9]{6,})\|([1-9][a-zA-Z0-9]{8,})(?:\/[MmPpCc])?\|?$/
@@ -3695,7 +3704,7 @@ class CreateInvoiceValidation extends CreateRecord
}
else
{
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
// $this->refreshInvoiceTable();
}
return;
@@ -3871,7 +3880,7 @@ class CreateInvoiceValidation extends CreateRecord
}
else
{
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
// $this->refreshInvoiceTable();
}
return;
@@ -3971,11 +3980,9 @@ class CreateInvoiceValidation extends CreateRecord
'scanned_quantity'=> $scannedQuantity,
]);
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
$this->dispatch('focus-capacitor-input');
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: true);
// $this->refreshInvoiceTable();
return;
}
else if ($isMarkPs)
{
@@ -4150,7 +4157,7 @@ class CreateInvoiceValidation extends CreateRecord
}
else
{
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
$this->dispatch('refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId, onCapFocus: false);
// $this->refreshInvoiceTable();
}
return;