Added logic for duplicate validation in invoice out validation screen
This commit is contained in:
@@ -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}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user