Skip to content
This repository was archived by the owner on Jul 2, 2025. It is now read-only.

Commit 2da8217

Browse files
author
Timo A. Hummel
committed
Merge pull request #644 from partkeepr/PartKeepr-638
Re-check the stock level after a new minimum stock level has been set…
2 parents 0aea0ca + 9815891 commit 2da8217

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/PartKeepr/PartBundle/Entity/Part.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,15 @@ public function setMinStockLevel($minStockLevel)
636636
if ($minStockLevel < 0) {
637637
throw new MinStockLevelOutOfRangeException();
638638
}
639+
639640
$this->minStockLevel = $minStockLevel;
641+
642+
if ($this->getStockLevel() < $this->getMinStockLevel()) {
643+
$this->setLowStock(true);
644+
} else {
645+
$this->setLowStock(false);
646+
}
647+
640648
}
641649

642650
/**

0 commit comments

Comments
 (0)