- API returns total_remaining, product_name, unit, default_qty after use
- isLowStock() detects when inventory is running low (pz<=2, conf<=1, weight/vol<=25% of default)
- After using a product, if low stock detected, shows prompt asking to add to Bring shopping list
- Works in main USE form, USE ALL, and recipe ingredient USE
- Prompt chains properly: low-stock then move-after-use (if applicable)
- Skips prompt when product is fully depleted (already auto-added to Bring)
- Clicking 'Usa' on a recipe ingredient now opens a modal popup instead of
directly consuming. Shows location selector, quantity controls (+/- buttons),
conf/sub-unit mode, and 'Usa TUTTO' option.
- Quantity is pre-filled with the recipe's suggested amount
- Auto-selects location with opened package
- After use, shows move-after-use modal (stays on recipe page, not dashboard)
- Separate recipe-context move functions (showRecipeMoveModal, confirmRecipeMove)
- Modal overlay z-index 250 to appear above recipe dialog
- Fixed isSuspiciousDefaultQty: for conf products, checks package_unit thresholds
(375g is fine for g-max=10000, not checked against conf-max=50)
- Auto-split on use: when using from a conf product with whole+fractional qty,
automatically separates whole confs from opened part
e.g. Panna 2.6conf → use 5g → 2conf (sealed) + 0.56conf (opened)
- Move modal now moves only the opened row (via opened_id)
- Use query prefers fractional rows (opened packages) first
- Non-conf products still get standard move-after-use behavior
- Fixed Cracker integrali default_quantity from 500 to 16 (was weight in grams, should be pieces)
- Review system now also flags products with absurd default_quantity (package size)
e.g. a 'pz' product claiming 500pz per package gets flagged as '📦 Conf. sospetta'
- Uses same QTY_THRESHOLDS max values for detection
- Dopo aver usato un prodotto, se rimane quantità mostra modal con opzione
di spostarlo in un'altra posizione (es. dispensa→frigo dopo apertura)
- La scadenza viene ricalcolata per la nuova posizione
- Fix marmellata: default_quantity era 0 → non appariva tra prodotti aperti
- Auto-set default_quantity al primo add per prodotti g/ml/kg/l senza pkg size
- Versione: 20260316b
- selectPurchaseType: non usa più date hardcoded, ricalcola sempre in base
alla posizione e stato sotto vuoto corrente
- Edit inventario: cambiare posizione o toggle sotto vuoto ricalcola la scadenza
- Spostamento prodotto: ricalcola scadenza per la nuova posizione
- Fix DB: fusi di pollo freezer 120gg, Bel Paese vacuum 21gg, Speck vacuum 75gg
- Versione: 20260315j
- Query SQL ora rileva prodotti aperti per tutte le unità dove la quantità
non è multiplo della dimensione confezione (soglia 2% per evitare errori arrot.)
- Frontend: rendering differente per conf (X conf + rimanente) e altri (Xg / Yg)
- Versione: 20260315i
- Scanner: usa BarcodeDetector API nativa (Chrome Android) come primario, Quagga come fallback
- Settings: aggiunta tab Fotocamera per scegliere posteriore/anteriore/specifica
- Scanner feedback: barra verde (scansione attiva), gialla (barcode rilevato)
- Ricette: invio titoli ricette del giorno per evitare duplicati nello stesso giorno
- Debug: sistema di logging remoto (client_debug.log) per diagnostica da dispositivi chioscati
- Fix: permessi .env per scrittura da Apache
- Aggiunto version param a CSS/JS per forzare reload browser
- startManualEntry() resetta pf-conf-size-row correttamente
- Validazione: se unit=conf ma dimensione non specificata, errore
- onAddUnitChange: scrollIntoView quando conf-size-row appare
- Reset campi conf quando si cambia unità nel form aggiungi
- Nuovo campo package_unit in DB (migrazione automatica)
- Form aggiungi/modifica: quando si seleziona 'conf', appare campo per
specificare il contenuto della singola confezione (es. 300g, 2L)
- Visualizzazione: '3 conf (da 300g)' in inventario, dettaglio, butta
- formatQuantity aggiornato con supporto package_unit
- API: salva/restituisce package_unit in tutti gli endpoint
- Ricette e chat: contesto arricchito con info confezione
- CSS: stili per il nuovo campo conf-size