1
0
forked from poc/pds

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 = [
// 'updateScannedQuantity' => 'updateScannedQuantity',
// ];
protected $listeners = [
'updateScannedQuantity' => 'updateScannedQuantity',
];
// public function updateScannedQuantity()
// {
// $current = $this->form->getState()['scanned_quantity'] ?? 0;
// $this->form->fill([
// 'scanned_quantity' => $current + 1,
// ]);
// }
public function updateScannedQuantity()
{
$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,
]);
}
protected function getRedirectUrl(): string
{
@@ -98,16 +102,8 @@ class CreateInvoiceValidation extends CreateRecord
$this->plantId = $plantId;
$plant = Plant::find($plantId);
if ($plant)
{
$plantCode = $plant->code;
}
else
{
$plantCode = null;
}
//$plant = Plant::find($plantId);
//$plantCode = $plant ? $plant->code : null;
//..GET SERIAL INVOICE API
@@ -3910,8 +3906,10 @@ class CreateInvoiceValidation extends CreateRecord
'scanned_quantity'=> $scannedQuantity,
]);
$this->dispatch( 'refreshInvoiceData', invoiceNumber: $invoiceNumber, plantId: $plantId);
// $this->refreshInvoiceTable();
return;
}
elseif ($isMarkPs)
{