changed regex pattern in invoice validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Successful in 4m48s
Laravel Larastan / larastan (pull_request) Failing after 5m53s

This commit is contained in:
dhanabalan
2026-09-15 16:29:09 +05:30
parent 152f0f18ea
commit 5ae6e3202e

View File

@@ -2553,7 +2553,7 @@ class CreateInvoiceValidation extends CreateRecord
}
$pattern6 = '/^(?<item_code>[^|]+)\|(?<batch_number>[^|]+)\|(?<batch_id>[^|]+)\|(?<batch_count>[^|]+)\|(?<batch_quantity>[^|]+)$/i';
$pattern6 = '/^(?<item_code>[^|]+)\|(?<batch_number>[^|]*)\|(?<batch_id>[^|]+)\|(?<batch_count>[^|]+)\|(?<batch_quantity>[^|]+)$/i';
$pattern0 = '/^(?<item_code>[^|]+)\|(?<batch_id>[^|]+)\|(?<batch_count>[^|]+)\|(?<batch_quantity>[0-9]+(?:\.[0-9]+)?)\s?kg$/i';
$pattern1 = '/^(?<item_code>[^|]+)\|(?<batch_number>[^|]+)\|(?<batch_id>[^|]+)\|(?<batch_count>[^|]+)\/(?<batch_quantity>.+)$/i';
$pattern2 = '/^(?<item_code>[^|]+)\|(?<batch_number>[^|]+)\|(?<batch_id>[^|]+)\|(?<batch_count>.+)$/i';
@@ -2573,29 +2573,32 @@ class CreateInvoiceValidation extends CreateRecord
$this->currentItemCode = $itemCode;
$batchNumber = $matches['batch_number'];
$curScanQty = trim($matches['batch_quantity']);
$serialNumber = $matches['batch_id'].'-'.$matches['batch_count'];
$batchCount = str_replace('-', '', $matches['batch_count']);
$serialNumber = $matches['batch_id'].'-'.$batchCount;
$serNo = null;
if (empty($matches['batch_number']) || ! $matches['batch_number']) {
Notification::make()
->danger()
->title('Invalid Material QR Format')
->body('Scan valid Material QR code to proceed!<br>Sample formats are:<br>123456|123456789|001|5kg (or)<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1 (or) <br>657204|26091200|200000266831|001|650.000')
->seconds(2)
->send();
$this->dispatch('playWarnSound');
// if (empty($matches['batch_number']) || ! $matches['batch_number']) {
// Notification::make()
// ->danger()
// ->title('Invalid Material QR Format')
// ->body('Scan valid Material QR code to proceed!<br>Sample formats are:<br>123456|123456789|001|5kg (or)<br>123456|12345|12345678|1/1 (or)<br>123456|12345|12345678|1 (or)<br>123456|12345678-1 (or) <br>657204|26091200|200000266831|001|650.000')
// ->seconds(2)
// ->send();
// $this->dispatch('playWarnSound');
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totMatQuan,
'update_invoice' => false,
'scanned_quantity' => $scanMatQuan,
]);
// $this->form->fill([
// 'plant_id' => $plantId,
// 'invoice_number' => $invoiceNumber,
// 'serial_number' => null,
// 'total_quantity' => $totMatQuan,
// 'update_invoice' => false,
// 'scanned_quantity' => $scanMatQuan,
// ]);
return;
} elseif (empty($matches['batch_id']) || ! $matches['batch_id']) {
// return;
// }
if (empty($matches['batch_id']) || ! $matches['batch_id']) {
Notification::make()
->danger()
->title('Invalid Material QR Format')