issue solved for updating in capacitor scanned quanity in invoice validation

This commit is contained in:
dhanabalan
2025-11-14 18:21:56 +05:30
parent 40bf30e10f
commit d5159a2cdc
2 changed files with 25 additions and 27 deletions

View File

@@ -65,19 +65,23 @@ class CreateInvoiceValidation extends CreateRecord
]; ];
} }
// protected $listeners = [ protected $listeners = [
// 'updateScannedQuantity' => 'updateScannedQuantity', 'updateScannedQuantity' => 'updateScannedQuantity',
// ]; ];
public function updateScannedQuantity()
// public function updateScannedQuantity() {
// { $totQuan = InvoiceValidation::where('invoice_number', $this->invoiceNumber)->where('plant_id', $this->plantId)->count();
// $current = $this->form->getState()['scanned_quantity'] ?? 0; $scanSQuan = InvoiceValidation::where('invoice_number', $this->invoiceNumber)->where('scanned_status', 'Scanned')->where('plant_id', $this->plantId)->count();
$this->form->fill([
// $this->form->fill([ 'plant_id' => $this->plantId,
// 'scanned_quantity' => $current + 1, 'invoice_number' => $this->invoiceNumber,
// ]); 'serial_number' => null,
// } 'total_quantity' => $totQuan,
'update_invoice' => false,
'scanned_quantity'=> $scanSQuan,
]);
}
protected function getRedirectUrl(): string protected function getRedirectUrl(): string
{ {
@@ -98,16 +102,8 @@ class CreateInvoiceValidation extends CreateRecord
$this->plantId = $plantId; $this->plantId = $plantId;
$plant = Plant::find($plantId); //$plant = Plant::find($plantId);
//$plantCode = $plant ? $plant->code : null;
if ($plant)
{
$plantCode = $plant->code;
}
else
{
$plantCode = null;
}
//..GET SERIAL INVOICE API //..GET SERIAL INVOICE API
@@ -3910,8 +3906,10 @@ class CreateInvoiceValidation extends CreateRecord
'scanned_quantity'=> $scannedQuantity, 'scanned_quantity'=> $scannedQuantity,
]); ]);
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId); $this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
// $this->refreshInvoiceTable(); // $this->refreshInvoiceTable();
return; return;
} }
elseif ($isMarkPs) elseif ($isMarkPs)
{ {

View File

@@ -157,7 +157,6 @@ class InvoiceDataTable extends Component
$stickCount++; $stickCount++;
} }
} }
} }
if ($row['motor_scanned_status'] == 1) if ($row['motor_scanned_status'] == 1)
@@ -301,10 +300,8 @@ class InvoiceDataTable extends Component
} }
foreach ($this->invoiceData as &$row) { foreach ($this->invoiceData as &$row) {
if ( if (($row['code'] ?? '') === $this->currentItemCode && ($row['serial_number'] ?? '') === $this->currentSerialNumber)
($row['code'] ?? '') === $this->currentItemCode && {
($row['serial_number'] ?? '') === $this->currentSerialNumber
) {
$row['panel_box_supplier'] = $supplier; $row['panel_box_supplier'] = $supplier;
$row['panel_box_item_code'] = $itemCode; $row['panel_box_item_code'] = $itemCode;
$row['panel_box_serial_number'] = $serialNumber; $row['panel_box_serial_number'] = $serialNumber;
@@ -413,8 +410,11 @@ class InvoiceDataTable extends Component
break; break;
} }
} }
$this->showCapacitorInput = false; $this->showCapacitorInput = false;
$this->capacitorInput = ''; $this->capacitorInput = '';
$this->dispatch('updateScannedQuantity');
//$this->loadData($this->invoiceNumber, $this->plantId);
$this->dispatch('focus-serial-number'); $this->dispatch('focus-serial-number');
} }