Clear invoice number and refresh invoice data on serial number processing!
This commit is contained in:
@@ -2322,6 +2322,10 @@ class CreateSerialValidation extends CreateRecord
|
|||||||
|
|
||||||
$this->dispatch('playWarnSound');
|
$this->dispatch('playWarnSound');
|
||||||
|
|
||||||
|
$this->invoiceNumber = '';
|
||||||
|
|
||||||
|
$this->dispatch('refreshEmptyInvoice', invoiceNumber: $this->invoiceNumber, plantId: $plantId);
|
||||||
|
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
'invoice_number' => null,
|
'invoice_number' => null,
|
||||||
@@ -2360,8 +2364,12 @@ class CreateSerialValidation extends CreateRecord
|
|||||||
->seconds(2)
|
->seconds(2)
|
||||||
->send();
|
->send();
|
||||||
|
|
||||||
|
$this->invoiceNumber = '';
|
||||||
|
|
||||||
$this->dispatch('play-warn-sound');
|
$this->dispatch('play-warn-sound');
|
||||||
|
|
||||||
|
$this->dispatch('refreshEmptyInvoice', invoiceNumber: $this->invoiceNumber, plantId: $plantId);
|
||||||
|
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
'invoice_number' => null,
|
'invoice_number' => null,
|
||||||
@@ -2398,9 +2406,11 @@ class CreateSerialValidation extends CreateRecord
|
|||||||
|
|
||||||
$this->dispatch('playWarnSound');
|
$this->dispatch('playWarnSound');
|
||||||
|
|
||||||
|
// $this->dispatch('refreshEmptyInvoice', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
||||||
|
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
'invoice_number' => null,
|
'invoice_number' => $invoiceNumber,
|
||||||
'serial_number' => null,
|
'serial_number' => null,
|
||||||
'total_quantity' => $totQuan,
|
'total_quantity' => $totQuan,
|
||||||
'update_invoice' => false,
|
'update_invoice' => false,
|
||||||
@@ -2413,12 +2423,6 @@ class CreateSerialValidation extends CreateRecord
|
|||||||
// $hasPumpQr = $record->stickerMasterRelation->tube_sticker_pump ?? null;
|
// $hasPumpQr = $record->stickerMasterRelation->tube_sticker_pump ?? null;
|
||||||
// $hasPumpSetQr = $record->stickerMasterRelation->tube_sticker_pumpset ?? null;
|
// $hasPumpSetQr = $record->stickerMasterRelation->tube_sticker_pumpset ?? null;
|
||||||
|
|
||||||
|
|
||||||
// if (!$hasMotorQr && !$hasPumpQr && !$hasPumpSetQr && !$hasCapacitorQr)
|
|
||||||
// {
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
$hasMotorQr = $record->stickerMasterRelation->pack_slip_motor ?? null;
|
$hasMotorQr = $record->stickerMasterRelation->pack_slip_motor ?? null;
|
||||||
$hasPumpQr = $record->stickerMasterRelation->pack_slip_pump ?? null;
|
$hasPumpQr = $record->stickerMasterRelation->pack_slip_pump ?? null;
|
||||||
$hasPumpSetQr = $record->stickerMasterRelation->pack_slip_pumpset ?? null;
|
$hasPumpSetQr = $record->stickerMasterRelation->pack_slip_pumpset ?? null;
|
||||||
@@ -2550,14 +2554,6 @@ class CreateSerialValidation extends CreateRecord
|
|||||||
'scanned_quantity'=> $scannedQuantity,
|
'scanned_quantity'=> $scannedQuantity,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// $invoiceNumber = $this->form->getState()['invoice_number'];
|
|
||||||
// $this->invoiceNumber = $invoiceNumber;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// $totMQuan = SerialValidation::where('invoice_number', $invoiceNumber)->whereNotNull('quantity')->where('plant_id', $plantId)->count(); //->where('quantity', '!=', '')
|
|
||||||
// $scanMQuan = SerialValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
|
||||||
|
|
||||||
if($totQuan == $scannedQuantity)
|
if($totQuan == $scannedQuantity)
|
||||||
{
|
{
|
||||||
Notification::make()
|
Notification::make()
|
||||||
@@ -2568,7 +2564,6 @@ class CreateSerialValidation extends CreateRecord
|
|||||||
->send();
|
->send();
|
||||||
$this->dispatch('playNotificationSound');
|
$this->dispatch('playNotificationSound');
|
||||||
|
|
||||||
|
|
||||||
$filename = $invoiceNumber . '.xlsx';
|
$filename = $invoiceNumber . '.xlsx';
|
||||||
$directory = 'uploads/temp';
|
$directory = 'uploads/temp';
|
||||||
$disk = Storage::disk('local');
|
$disk = Storage::disk('local');
|
||||||
@@ -2608,6 +2603,8 @@ class CreateSerialValidation extends CreateRecord
|
|||||||
|
|
||||||
$this->dispatch('playWarnSound');
|
$this->dispatch('playWarnSound');
|
||||||
|
|
||||||
|
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
||||||
|
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
'invoice_number' => $invoiceNumber,
|
'invoice_number' => $invoiceNumber,
|
||||||
@@ -2628,6 +2625,8 @@ class CreateSerialValidation extends CreateRecord
|
|||||||
->send();
|
->send();
|
||||||
$this->dispatch('playWarnSound');
|
$this->dispatch('playWarnSound');
|
||||||
|
|
||||||
|
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
||||||
|
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
'invoice_number' => $invoiceNumber,
|
'invoice_number' => $invoiceNumber,
|
||||||
@@ -2642,7 +2641,6 @@ class CreateSerialValidation extends CreateRecord
|
|||||||
$packCnt = 1;
|
$packCnt = 1;
|
||||||
$scanCnt = 1;
|
$scanCnt = 1;
|
||||||
$record->pump_scanned_status = 1;
|
$record->pump_scanned_status = 1;
|
||||||
// if($hadMotorQr == $hasMotorQr && $hadPumpSetQr == $hasPumpSetQr && ($hadCapacitorQr == '1' && $hasCapacitorQr))
|
|
||||||
if($hasMotorQr || $hasPumpSetQr || $hasCapacitorQr)
|
if($hasMotorQr || $hasPumpSetQr || $hasCapacitorQr)
|
||||||
{
|
{
|
||||||
$packCnt = $hasMotorQr ? $packCnt + 1 : $packCnt;
|
$packCnt = $hasMotorQr ? $packCnt + 1 : $packCnt;
|
||||||
@@ -2707,7 +2705,6 @@ class CreateSerialValidation extends CreateRecord
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
||||||
// $this->refreshInvoiceTable();
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2723,9 +2720,7 @@ class CreateSerialValidation extends CreateRecord
|
|||||||
if (!$hasCapacitorQr)
|
if (!$hasCapacitorQr)
|
||||||
{
|
{
|
||||||
Notification::make()
|
Notification::make()
|
||||||
// ->title('Unknown: Capacitor QR')
|
|
||||||
->title('Missing: Panel Box Code')
|
->title('Missing: Panel Box Code')
|
||||||
// ->body("Panel Box Code is not available for Item Code : '$itemCode'.")
|
|
||||||
->body("Scanned 'Item Code' doesn't have 'Panel Box Code' to proceed!")
|
->body("Scanned 'Item Code' doesn't have 'Panel Box Code' to proceed!")
|
||||||
->danger()
|
->danger()
|
||||||
->seconds(2)
|
->seconds(2)
|
||||||
@@ -2768,15 +2763,10 @@ class CreateSerialValidation extends CreateRecord
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//hereToUpdate
|
|
||||||
//$this->dispatch('openCapacitorModal');
|
|
||||||
$this->dispatch('openCapacitorModal', itemCode: $itemCode, serialNumber: $serialNumber, plantId: $plantId);
|
$this->dispatch('openCapacitorModal', itemCode: $itemCode, serialNumber: $serialNumber, plantId: $plantId);
|
||||||
|
|
||||||
$scannedQuantity = SerialValidation::where('invoice_number', $invoiceNumber)->where('scanned_status', 'Scanned')->where('plant_id', $plantId)->count();
|
$scannedQuantity = SerialValidation::where('invoice_number', $invoiceNumber)->where('scanned_status', 'Scanned')->where('plant_id', $plantId)->count();
|
||||||
|
|
||||||
// $invoiceNumber = $this->form->getState()['invoice_number'];
|
|
||||||
// $this->invoiceNumber = $invoiceNumber;
|
|
||||||
|
|
||||||
$totQuan = SerialValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
$totQuan = SerialValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
||||||
$scanSQuan = SerialValidation::where('invoice_number', $invoiceNumber)->where('scanned_status', 'Scanned')->where('plant_id', $plantId)->count();
|
$scanSQuan = SerialValidation::where('invoice_number', $invoiceNumber)->where('scanned_status', 'Scanned')->where('plant_id', $plantId)->count();
|
||||||
$totMQuan = SerialValidation::where('invoice_number', $invoiceNumber)->whereNotNull('quantity')->where('plant_id', $plantId)->count(); //->where('quantity', '!=', '')
|
$totMQuan = SerialValidation::where('invoice_number', $invoiceNumber)->whereNotNull('quantity')->where('plant_id', $plantId)->count(); //->where('quantity', '!=', '')
|
||||||
@@ -2791,7 +2781,6 @@ class CreateSerialValidation extends CreateRecord
|
|||||||
'scanned_quantity'=> $scannedQuantity,
|
'scanned_quantity'=> $scannedQuantity,
|
||||||
]);
|
]);
|
||||||
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
||||||
// $this->refreshInvoiceTable();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
elseif ($isMarkPs)
|
elseif ($isMarkPs)
|
||||||
@@ -2931,23 +2920,10 @@ class CreateSerialValidation extends CreateRecord
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
||||||
// $this->refreshInvoiceTable();
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// $invoiceNumber = $this->form->getState()['invoice_number'];
|
|
||||||
// $this->invoiceNumber = $invoiceNumber;
|
|
||||||
|
|
||||||
// $totQuan = SerialValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
|
||||||
// $scanSQuan = SerialValidation::where('invoice_number', $invoiceNumber)->where('scanned_status', 'Scanned')->where('plant_id', $plantId)->count();
|
|
||||||
// $totMQuan = SerialValidation::where('invoice_number', $invoiceNumber)->whereNotNull('quantity')->where('plant_id', $plantId)->count(); //->where('quantity', '!=', '')
|
|
||||||
// $scanMQuan = SerialValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
|
||||||
|
|
||||||
//..
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHeading(): string
|
public function getHeading(): string
|
||||||
|
|||||||
Reference in New Issue
Block a user