Highlight amount sum in part tables and part info page, when amount is less than minAmount

This commit is contained in:
Jan Böhmer 2023-04-03 23:15:29 +02:00
parent 69fdc85c99
commit 5330476dbe
4 changed files with 29 additions and 5 deletions

View file

@ -202,6 +202,12 @@ final class PartsDataTable implements DataTableTypeInterface
htmlspecialchars($this->amountFormatter->format($expiredAmount, $context->getPartUnit())));
}
//When the amount is below the minimum amount, we highlight the number red
if ($context->isNotEnoughInstock()) {
$ret = sprintf('<b class="text-danger" title="%s">%s</b>',
$this->translator->trans('part.info.amount.less_than_desired'),
$ret);
}
return $ret;
},