fix: 0.5 conf use page (default conf mode + fraction btns); depleted items always in shopping; conf decimals in history log

This commit is contained in:
dadaloop82
2026-05-20 13:35:27 +00:00
parent ac8b5acc0c
commit 7b60f1dbe3
2 changed files with 48 additions and 9 deletions
+6 -3
View File
@@ -2395,7 +2395,7 @@ function listTransactions(PDO $db): void {
$productId = $_GET['product_id'] ?? '';
$query = "
SELECT t.*, p.name, p.brand, p.unit
SELECT t.*, p.name, p.brand, p.unit, p.default_quantity, p.package_unit
FROM transactions t
JOIN products p ON t.product_id = p.id
";
@@ -7658,8 +7658,11 @@ function smartShopping(PDO $db): void {
$reasons[] = 'Esaurito';
$score += 30;
} else {
// Rarely used or not used recently — skip
continue;
// Product is depleted. Even without a proven usage pattern, always
// show at minimum 'low' so the user can restock it.
$urgency = 'low';
$reasons[] = 'Esaurito';
$score += 15;
}
}