added validation for to show unique plant codes in error response in invoice out validation
This commit is contained in:
@@ -231,6 +231,7 @@ class InvoiceOutValidationResource extends Resource
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($invalidPlantCode)) {
|
if (!empty($invalidPlantCode)) {
|
||||||
|
$invalidPlantCode = array_unique($invalidPlantCode);
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Invalid Plant Codes')
|
->title('Invalid Plant Codes')
|
||||||
->body('The following plant codes should contain minimum 4 digits:<br>' . implode(', ', $invalidPlantCode))
|
->body('The following plant codes should contain minimum 4 digits:<br>' . implode(', ', $invalidPlantCode))
|
||||||
@@ -242,6 +243,7 @@ class InvoiceOutValidationResource extends Resource
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!empty($invalidPlaCoFound)) {
|
if (!empty($invalidPlaCoFound)) {
|
||||||
|
$invalidPlaCoFound = array_unique($invalidPlaCoFound);
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Invalid Plant Codes')
|
->title('Invalid Plant Codes')
|
||||||
->body('The following plant codes not found in plants:<br>' . implode(', ', $invalidPlaCoFound))
|
->body('The following plant codes not found in plants:<br>' . implode(', ', $invalidPlaCoFound))
|
||||||
@@ -253,6 +255,7 @@ class InvoiceOutValidationResource extends Resource
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!empty($userNotFound)) {
|
if (!empty($userNotFound)) {
|
||||||
|
$userNotFound = array_unique($userNotFound);
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Invalid User')
|
->title('Invalid User')
|
||||||
->body('The following user not found:<br>' . implode(', ', $userNotFound))
|
->body('The following user not found:<br>' . implode(', ', $userNotFound))
|
||||||
|
|||||||
Reference in New Issue
Block a user