1
0
forked from poc/pds

Refactor invoice validation logic and clean up commented code

This commit is contained in:
dhanabalan
2025-11-14 16:34:27 +05:30
parent fc8b6382ac
commit 3bdc0d1859

View File

@@ -65,6 +65,20 @@ class CreateInvoiceValidation extends CreateRecord
];
}
// protected $listeners = [
// 'updateScannedQuantity' => 'updateScannedQuantity',
// ];
// public function updateScannedQuantity()
// {
// $current = $this->form->getState()['scanned_quantity'] ?? 0;
// $this->form->fill([
// 'scanned_quantity' => $current + 1,
// ]);
// }
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('create');
@@ -97,7 +111,6 @@ class CreateInvoiceValidation extends CreateRecord
//..GET SERIAL INVOICE API
//..
$updateStatus = $this->form->getState()['update_invoice'] ?? null;
@@ -3457,6 +3470,21 @@ class CreateInvoiceValidation extends CreateRecord
return;
}
if ($hasMotorQr && !$hasPumpQr && !$hasPumpSetQr && !$hasCapacitorQr)
{
$isMarkM = true;
$isMarkP = false;
$isMarkC = false;
$isMarkPs = false;
}
else if (!$hasMotorQr && $hasPumpQr && !$hasPumpSetQr && !$hasCapacitorQr)
{
$isMarkM = false;
$isMarkP = true;
$isMarkC = false;
$isMarkPs = false;
}
if ($isMarkM) {
if (!$hasMotorQr)
{