changed regex pattern in invoice validation #1035
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user