partkeepr

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

commit 2d774c3e91a202cc646586cf7eb88afac6ee56e8
parent 2654a6022cc88eb6a2bb169fcf0445a0832382b1
Author: felicitus <felicitus@felicitus.org>
Date:   Tue,  3 Jan 2012 22:14:51 +0100

Fixed StatisticSnapshotManager for bug #62

Diffstat:
Msrc/backend/de/RaumZeitLabor/PartKeepr/Statistic/StatisticSnapshotManager.php | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/backend/de/RaumZeitLabor/PartKeepr/Statistic/StatisticSnapshotManager.php b/src/backend/de/RaumZeitLabor/PartKeepr/Statistic/StatisticSnapshotManager.php @@ -21,9 +21,15 @@ class StatisticSnapshotManager extends Singleton { foreach ($result as $row) { $snapshotUnit = new StatisticSnapshotUnit(); - $snapshotUnit->setPartUnit($row[0]); + $snapshotUnit->setPartUnit(PartUnit::loadById($row["puid"])); $snapshotUnit->setStatisticSnapshot($snapshot); - $snapshotUnit->setStockLevel($row["stockLevel"]); + + if ($row["stockLevel"] !== null) { + $snapshotUnit->setStockLevel($row["stockLevel"]); + } else { + $snapshotUnit->setStockLevel(0); + } + $snapshot->getUnits()->add($snapshotUnit); }