mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Refresh stock statistics on consume on stock overview page (references #26)
This commit is contained in:
@@ -20,6 +20,12 @@ class StockService extends BaseService
|
||||
return $this->DatabaseService->ExecuteDbQuery($sql)->fetchAll(\PDO::FETCH_OBJ);
|
||||
}
|
||||
|
||||
public function GetExpiringProducts(int $days = 5)
|
||||
{
|
||||
$currentStock = $this->GetCurrentStock();
|
||||
return FindAllObjectsInArrayByPropertyValue($currentStock, 'best_before_date', date('Y-m-d', strtotime("+$days days")), '<');
|
||||
}
|
||||
|
||||
public function GetProductDetails(int $productId)
|
||||
{
|
||||
if (!$this->ProductExists($productId))
|
||||
|
Reference in New Issue
Block a user