Show how much is in stock on dashboard

This commit is contained in:
Bernd Bestel
2017-04-21 12:50:53 +02:00
parent 1d293741ba
commit f2f18d260d
2 changed files with 12 additions and 1 deletions

View File

@@ -46,4 +46,15 @@ class GrocyPhpHelper
return $returnArray;
}
public static function SumArrayValue($array, $propertyName)
{
$sum = 0;
foreach($array as $object)
{
$sum += $object->{$propertyName};
}
return $sum;
}
}