Refactor invoice validation logic and clean up commented code
This commit is contained in:
@@ -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
|
protected function getRedirectUrl(): string
|
||||||
{
|
{
|
||||||
return $this->getResource()::getUrl('create');
|
return $this->getResource()::getUrl('create');
|
||||||
@@ -97,7 +111,6 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
|
|
||||||
//..GET SERIAL INVOICE API
|
//..GET SERIAL INVOICE API
|
||||||
|
|
||||||
|
|
||||||
//..
|
//..
|
||||||
|
|
||||||
$updateStatus = $this->form->getState()['update_invoice'] ?? null;
|
$updateStatus = $this->form->getState()['update_invoice'] ?? null;
|
||||||
@@ -3457,6 +3470,21 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
return;
|
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 ($isMarkM) {
|
||||||
if (!$hasMotorQr)
|
if (!$hasMotorQr)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user