Add safety badges for expired products
- 🗑️ Buttare (red): perishable items (latticini, carne, pesce, frutta, verdura) expired >2 days, or any items expired >6 months - 👀 Controlla (yellow): semi-perishable (pane, surgelati) within 30 days, or long-shelf items 1-6 months past, or fresh items just expired in frigo - ✅ OK (green): long-shelf items (pasta, conserve, condimenti, cereali, snack) within 30 days of TMC date - Tooltip on hover explains the safety recommendation - Added p.category to expired items SQL query - Safety logic uses mapToLocalCategory + location + days expired
This commit is contained in:
+1
-1
@@ -524,7 +524,7 @@ function getStats(PDO $db): void {
|
||||
|
||||
// Expired
|
||||
$expired = $db->query("
|
||||
SELECT i.*, p.name, p.brand
|
||||
SELECT i.*, p.name, p.brand, p.category
|
||||
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')
|
||||
ORDER BY i.expiry_date ASC
|
||||
|
||||
Reference in New Issue
Block a user