Refactored invoice processing logic to ensure file deletion occurs correctly and added additional condition for marking serial numbers.

This commit is contained in:
dhanabalan
2025-11-19 10:40:06 +05:30
parent 5f1fcf4be4
commit b6c711fc6f

View File

@@ -1024,9 +1024,9 @@ class CreateInvoiceValidation extends CreateRecord
->send();
$this->dispatch('playWarnSound');
// if ($disk->exists($filePath)) {
// $disk->delete($filePath);
// }
if ($disk->exists($filePath)) {
$disk->delete($filePath);
}
return;
}
@@ -1392,7 +1392,6 @@ class CreateInvoiceValidation extends CreateRecord
->send();
$this->dispatch('playWarnSound');
if ($disk->exists($filePath)) {
$disk->delete($filePath);
}
@@ -3479,6 +3478,13 @@ class CreateInvoiceValidation extends CreateRecord
$isMarkC = false;
$isMarkPs = false;
}
else if (!$hasMotorQr && !$hasPumpQr && !$hasPumpSetQr && $hasCapacitorQr)
{
$isMarkM = false;
$isMarkP = false;
$isMarkC = true;
$isMarkPs = false;
}
if ($isMarkM) {
if (!$hasMotorQr)