partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 2da821726f0d8f2fb3a9a15e97da329c62b0edc5
parent 0aea0caac7318f4bc4adc75dc6ac88f8897eadb2
Author: Timo A. Hummel <felicitus@felicitus.org>
Date:   Sun, 17 Apr 2016 19:25:22 +0200

Merge pull request #644 from partkeepr/PartKeepr-638

Re-check the stock level after a new minimum stock level has been set…
Diffstat:
Msrc/PartKeepr/PartBundle/Entity/Part.php | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/PartKeepr/PartBundle/Entity/Part.php b/src/PartKeepr/PartBundle/Entity/Part.php @@ -636,7 +636,15 @@ class Part extends BaseEntity if ($minStockLevel < 0) { throw new MinStockLevelOutOfRangeException(); } + $this->minStockLevel = $minStockLevel; + + if ($this->getStockLevel() < $this->getMinStockLevel()) { + $this->setLowStock(true); + } else { + $this->setLowStock(false); + } + } /**