Added logic for duplicate validation in invoice out validation screen

This commit is contained in:
dhanabalan
2025-11-08 01:37:07 +05:30
parent 2004d490b6
commit 3da1616a9f

View File

@@ -217,7 +217,7 @@ class InvoiceOutValidationResource extends Resource
$uniqueKey = $plantCode . '_' . $qrCode; $uniqueKey = $plantCode . '_' . $qrCode;
if (in_array($uniqueKey, $seenPlantQr)) { if (in_array($uniqueKey, $seenPlantQr)) {
$duplicateQrExcel[] = "Duplicate in file at Row {$index}: QR Code '{$qrCode}' already exists for Plant Code {$plantCode}"; $duplicateQrExcel[] = "Duplicate in file at Row {$index}: Document Numbers '{$qrCode}' already exists for Plant Code {$plant->name}";
} }
$seenPlantQr[] = $uniqueKey; $seenPlantQr[] = $uniqueKey;
@@ -227,7 +227,7 @@ class InvoiceOutValidationResource extends Resource
->first(); ->first();
if ($existsInDb) { if ($existsInDb) {
$duplicateQrDb[] = "QR Code '{$qrCode}' already exists in DB for Plant Code {$plantCode}"; $duplicateQrDb[] = "Document Numbers '{$qrCode}' already exists in DB for Plant Code {$plant->name}";
} }
} }