Updated focus invoice and serial number logic in throughout invoice validation related pages (resource, create, livewire, blade)
This commit is contained in:
@@ -73,14 +73,32 @@ class CreateInvoiceValidation extends CreateRecord
|
||||
{
|
||||
$totQuan = InvoiceValidation::where('invoice_number', $this->invoiceNumber)->where('plant_id', $this->plantId)->count();
|
||||
$scanSQuan = InvoiceValidation::where('invoice_number', $this->invoiceNumber)->where('scanned_status', 'Scanned')->where('plant_id', $this->plantId)->count();
|
||||
$this->form->fill([
|
||||
'plant_id' => $this->plantId,
|
||||
'invoice_number' => $this->invoiceNumber,
|
||||
'serial_number' => null,
|
||||
'total_quantity' => $totQuan,
|
||||
'update_invoice' => false,
|
||||
'scanned_quantity'=> $scanSQuan,
|
||||
]);
|
||||
|
||||
$this->dispatch('playNotificationSound');
|
||||
if ($totQuan == $scanSQuan)
|
||||
{
|
||||
$this->form->fill([
|
||||
'plant_id' => $this->plantId,
|
||||
'invoice_number' => null,
|
||||
'serial_number' => null,
|
||||
'total_quantity' => 0,
|
||||
'update_invoice' => false,
|
||||
'scanned_quantity'=> 0
|
||||
]);
|
||||
$this->dispatch('refreshCompletedInvoice', invoiceNumber: $this->invoiceNumber, plantId: $this->plantId, isSerial: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->form->fill([
|
||||
'plant_id' => $this->plantId,
|
||||
'invoice_number' => $this->invoiceNumber,
|
||||
'serial_number' => null,
|
||||
'total_quantity' => $totQuan,
|
||||
'update_invoice' => false,
|
||||
'scanned_quantity'=> $scanSQuan
|
||||
]);
|
||||
$this->dispatch('refreshInvoiceData', invoiceNumber: $this->invoiceNumber, plantId: $this->plantId);
|
||||
}
|
||||
}
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
@@ -133,6 +151,7 @@ class CreateInvoiceValidation extends CreateRecord
|
||||
'total_quantity' => 0,
|
||||
'scanned_quantity'=> 0,
|
||||
]);
|
||||
|
||||
$this->dispatch('refreshEmptyInvoice', invoiceNumber: $invoiceNumber, plantId: $plantId);
|
||||
}
|
||||
else
|
||||
@@ -854,7 +873,6 @@ class CreateInvoiceValidation extends CreateRecord
|
||||
//$fullPath = $disk->path($filePath);
|
||||
$disk->delete($filePath);
|
||||
}
|
||||
$this->dispatch('playNotificationSound');
|
||||
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
|
||||
Reference in New Issue
Block a user