diff --git a/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php b/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php index 433ed63..86c6575 100644 --- a/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php +++ b/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php @@ -2553,7 +2553,7 @@ class CreateInvoiceValidation extends CreateRecord } - $pattern6 = '/^(?[^|]+)\|(?[^|]+)\|(?[^|]+)\|(?[^|]+)\|(?[^|]+)$/i'; + $pattern6 = '/^(?[^|]+)\|(?[^|]*)\|(?[^|]+)\|(?[^|]+)\|(?[^|]+)$/i'; $pattern0 = '/^(?[^|]+)\|(?[^|]+)\|(?[^|]+)\|(?[0-9]+(?:\.[0-9]+)?)\s?kg$/i'; $pattern1 = '/^(?[^|]+)\|(?[^|]+)\|(?[^|]+)\|(?[^|]+)\/(?.+)$/i'; $pattern2 = '/^(?[^|]+)\|(?[^|]+)\|(?[^|]+)\|(?.+)$/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!
Sample formats are:
123456|123456789|001|5kg (or)
123456|12345|12345678|1/1 (or)
123456|12345|12345678|1 (or)
123456|12345678-1 (or)
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!
Sample formats are:
123456|123456789|001|5kg (or)
123456|12345|12345678|1/1 (or)
123456|12345|12345678|1 (or)
123456|12345678-1 (or)
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')