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