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

@ -151,6 +151,15 @@ trait InstockTrait
return false;
}
/**
* Returns true, if the total instock amount of this part is less than the minimum amount.
* @return bool
*/
public function isNotEnoughInstock(): bool
{
return $this->getAmountSum() < $this->getMinAmount();
}
/**
* Returns the summed amount of this part (over all part lots)
* Part Lots that have unknown value or are expired, are not used for this value.