partkeepr

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

commit 26210bb3ed21f19c0d5417327358b68d7dd4a401
parent f0b8c88b7bba797ff103414c15a1048531b1d5dd
Author: Felicitus <felicitus@felicitus.org>
Date:   Fri, 23 Dec 2011 13:13:50 +0100

Workaround for issue #86

Diffstat:
Msrc/backend/de/RaumZeitLabor/PartKeepr/Stock/StockService.php | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/backend/de/RaumZeitLabor/PartKeepr/Stock/StockService.php b/src/backend/de/RaumZeitLabor/PartKeepr/Stock/StockService.php @@ -67,7 +67,12 @@ class StockService extends Service implements RestfulService { * Only an admin user may correct the in&out stock levels */ if (SessionManager::getCurrentSession()->getUser()->isAdmin()) { - $stockEntry->setStockLevel($this->getParameter("amount")); + if ($this->getParameter("direction") == "out") { + $stockEntry->setStockLevel(-(abs($this->getParameter("amount")))); + } else { + $stockEntry->setStockLevel($this->getParameter("amount")); + } + } if (SessionManager::getCurrentSession()->getUser()->isAdmin()) {