Updated warning message to display unique codes only
This commit is contained in:
@@ -376,7 +376,7 @@ class InvoiceValidationResource extends Resource
|
||||
}
|
||||
|
||||
$invalidMatCodes = [];
|
||||
$invalidSerialCodes=[];
|
||||
$invalidSerialCodes = [];
|
||||
$materialCodes = [];
|
||||
$missingSerials = [];
|
||||
$duplicateSerials = [];
|
||||
@@ -806,6 +806,7 @@ class InvoiceValidationResource extends Resource
|
||||
|
||||
if (count($invalidCodes) > 10)
|
||||
{
|
||||
$invalidCodes = array_unique($invalidCodes);
|
||||
Notification::make()
|
||||
->title('Invalid item codes found')
|
||||
->body('' . count($invalidCodes) . 'invalid item codes found have serial number.')
|
||||
@@ -819,6 +820,7 @@ class InvoiceValidationResource extends Resource
|
||||
}
|
||||
else if(count($invalidCodes) > 0)
|
||||
{
|
||||
$invalidCodes = array_unique($invalidCodes);
|
||||
Notification::make()
|
||||
->title('Invalid item codes found')
|
||||
->body('Serial invoice Item Codes found : ' . implode(', ', $invalidCodes))
|
||||
@@ -881,6 +883,10 @@ class InvoiceValidationResource extends Resource
|
||||
->send();
|
||||
};
|
||||
|
||||
$nonNumericQtyCodes = array_unique($nonNumericQtyCodes);
|
||||
$zeroQtyCodes = array_unique($zeroQtyCodes);
|
||||
$notDivisibleCodes = array_unique($notDivisibleCodes);
|
||||
|
||||
$showValidationNotification($nonNumericQtyCodes, "The following item codes contains invalid bundle quantity:");
|
||||
$showValidationNotification($zeroQtyCodes, "The following item codes quantity should be greater than '0':");
|
||||
$showValidationNotification($notDivisibleCodes, "The following item codes quantity is not divisible by bundle quantity.");
|
||||
@@ -1031,7 +1037,6 @@ class InvoiceValidationResource extends Resource
|
||||
|
||||
return $indicators;
|
||||
})
|
||||
|
||||
])
|
||||
->filtersFormMaxHeight('280px')
|
||||
->actions([
|
||||
|
||||
Reference in New Issue
Block a user