Show missing products on dashboard

This commit is contained in:
Bernd Bestel
2017-04-21 13:21:09 +02:00
parent f2f18d260d
commit 52e311d847
6 changed files with 39 additions and 6 deletions

View File

@@ -8,7 +8,13 @@ class GrocyLogicStock
public static function GetCurrentStock()
{
$sql = 'SELECT product_id, SUM(amount) AS amount, MIN(best_before_date) AS best_before_date from stock GROUP BY product_id ORDER BY MIN(best_before_date) ASC';
$sql = 'SELECT * from stock_current';
return Grocy::ExecuteDbQuery(Grocy::GetDbConnectionRaw(), $sql)->fetchAll(PDO::FETCH_OBJ);
}
public static function GetMissingProducts()
{
$sql = 'SELECT * from stock_missing_products';
return Grocy::ExecuteDbQuery(Grocy::GetDbConnectionRaw(), $sql)->fetchAll(PDO::FETCH_OBJ);
}