Anti-waste: themed border, rich info badges, fix latte di montagna shelf-life, exclude opened from expiring_soon
This commit is contained in:
+3
-1
@@ -269,7 +269,9 @@ function estimateOpenedExpiryDaysPHP(string $name, string $category, string $loc
|
||||
|
||||
// ── F: Fridge — short-life perishables ──────────────────────────────
|
||||
if (preg_match('/latte\s+(fresco|intero|parzial|scremato)/', $n)) return 3;
|
||||
if (preg_match('/latte\s+(uht|a\s+lunga)/', $n)) return 5;
|
||||
if (preg_match('/latte\s+(uht|a\s+lunga)/', $n)) return 7;
|
||||
// Long-life mountain/brand milks stored in pantry before use (UHT)
|
||||
if (preg_match('/latte.*(montagna|alta\s+qual|parmalat|granarolo|esselunga|conservaz|microfiltrat)/i', $n)) return 7;
|
||||
if (preg_match('/\blatte\b/', $n)) return 4;
|
||||
if (preg_match('/\byogurt\b/', $n)) return 5;
|
||||
if (preg_match('/mozzarella|burrata|stracciatella/', $n)) return 3;
|
||||
|
||||
@@ -1529,6 +1529,7 @@ function getStats(PDO $db): void {
|
||||
COALESCE(i.vacuum_sealed, 0) as vacuum_sealed
|
||||
FROM inventory i JOIN products p ON i.product_id = p.id
|
||||
WHERE i.expiry_date IS NOT NULL AND i.expiry_date >= date('now') AND i.quantity > 0
|
||||
AND (i.opened_at IS NULL OR i.opened_at = '')
|
||||
ORDER BY i.expiry_date ASC
|
||||
LIMIT 4
|
||||
")->fetchAll();
|
||||
|
||||
Reference in New Issue
Block a user