Skip to content

Commit

Permalink
Merge pull request #644 from partkeepr/PartKeepr-638
Browse files Browse the repository at this point in the history
Re-check the stock level after a new minimum stock level has been set…
  • Loading branch information
Timo A. Hummel committed Apr 17, 2016
2 parents 0aea0ca + 9815891 commit 2da8217
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/PartKeepr/PartBundle/Entity/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,15 @@ public function setMinStockLevel($minStockLevel)
if ($minStockLevel < 0) {
throw new MinStockLevelOutOfRangeException();
}

$this->minStockLevel = $minStockLevel;

if ($this->getStockLevel() < $this->getMinStockLevel()) {
$this->setLowStock(true);
} else {
$this->setLowStock(false);
}

}

/**
Expand Down

0 comments on commit 2da8217

Please sign in to comment.