added validation for to show unique plant codes in error response in invoice out validation

This commit is contained in:
dhanabalan
2025-10-31 17:58:10 +05:30
parent e7d549c4c8
commit 43f02e0d13

View File

@@ -231,6 +231,7 @@ class InvoiceOutValidationResource extends Resource
}
if (!empty($invalidPlantCode)) {
$invalidPlantCode = array_unique($invalidPlantCode);
Notification::make()
->title('Invalid Plant Codes')
->body('The following plant codes should contain minimum 4 digits:<br>' . implode(', ', $invalidPlantCode))
@@ -242,6 +243,7 @@ class InvoiceOutValidationResource extends Resource
return;
}
if (!empty($invalidPlaCoFound)) {
$invalidPlaCoFound = array_unique($invalidPlaCoFound);
Notification::make()
->title('Invalid Plant Codes')
->body('The following plant codes not found in plants:<br>' . implode(', ', $invalidPlaCoFound))
@@ -253,6 +255,7 @@ class InvoiceOutValidationResource extends Resource
return;
}
if (!empty($userNotFound)) {
$userNotFound = array_unique($userNotFound);
Notification::make()
->title('Invalid User')
->body('The following user not found:<br>' . implode(', ', $userNotFound))