merge develop into main
This commit is contained in:
+2
-11
@@ -7234,21 +7234,12 @@ async function _doSubmitUseAll() {
|
||||
const currentLoc = document.getElementById('use-location')?.value || '__all__';
|
||||
const items = _useCurrentItems.filter(i => parseFloat(i.quantity) > 0);
|
||||
|
||||
const openedAtCurrentLoc = items.find(i => i.location === currentLoc && _isOpenedInventoryItem(i));
|
||||
const allOpened = items.filter(_isOpenedInventoryItem);
|
||||
|
||||
let useLocation;
|
||||
|
||||
if (openedAtCurrentLoc) {
|
||||
// Opened package at the currently selected location → finish only the opened item.
|
||||
// The PHP backend fetches fractional (opened) rows first, so use_all on a specific
|
||||
// location will clear the opened row and leave sealed packages untouched.
|
||||
useLocation = currentLoc;
|
||||
} else if (allOpened.length === 1) {
|
||||
// One opened package somewhere else → almost certainly this is what the user means
|
||||
useLocation = allOpened[0].location;
|
||||
} else if (allOpened.length > 1) {
|
||||
// Multiple opened packages at different locations → ask the user
|
||||
if (allOpened.length >= 1) {
|
||||
// One or more opened packages → always ask the user what they mean
|
||||
showLoading(false);
|
||||
_showUseAllDisambiguation(allOpened, items);
|
||||
return;
|
||||
|
||||
+15
-2
@@ -243,7 +243,13 @@
|
||||
"toast_opened_finished": "🔓 Geöffnete Packung von {name} aufgebraucht!",
|
||||
"disambiguation_hint": "Was meinst du mit \"alles aufgebraucht\"?",
|
||||
"disambiguation_all": "🗑️ ALLES verbraucht ({qty})",
|
||||
"error_exceeds_stock": "⚠️ Du kannst nicht mehr verwenden als du verfügbar hast!"
|
||||
"error_exceeds_stock": "⚠️ Du kannst nicht mehr verwenden als du verfügbar hast!",
|
||||
"use_all_confirm_title": "✅ Alles aufbrauchen",
|
||||
"use_all_confirm_msg": "Bestätige, dass du das Produkt vollständig aufgebraucht hast:",
|
||||
"use_all_confirm_btn": "✅ Ja, aufgebraucht",
|
||||
"throw_all_confirm_title": "🗑️ Alles entsorgen",
|
||||
"throw_all_confirm_msg": "Möchtest du wirklich das gesamte Produkt entsorgen?",
|
||||
"throw_all_confirm_btn": "🗑️ Ja, entsorgen"
|
||||
},
|
||||
"product": {
|
||||
"title_new": "Neues Produkt",
|
||||
@@ -746,7 +752,14 @@
|
||||
},
|
||||
"confirm": {
|
||||
"remove_item": "Möchtest du dieses Produkt wirklich aus dem Bestand entfernen?",
|
||||
"kiosk_exit": "Kioskmodus verlassen?"
|
||||
"kiosk_exit": "Kioskmodus verlassen?",
|
||||
"cancel": "Abbrechen",
|
||||
"proceed": "Bestätigen"
|
||||
},
|
||||
"location": {
|
||||
"dispensa": "Vorratskammer",
|
||||
"frigo": "Kühlschrank",
|
||||
"freezer": "Gefrierschrank"
|
||||
},
|
||||
"edit": {
|
||||
"title": "{name} bearbeiten",
|
||||
|
||||
+15
-2
@@ -242,7 +242,13 @@
|
||||
"toast_opened_finished": "🔓 Opened package of {name} finished!",
|
||||
"disambiguation_hint": "What do you mean by \"all done\"?",
|
||||
"disambiguation_all": "🗑️ Finish EVERYTHING ({qty})",
|
||||
"error_exceeds_stock": "⚠️ You cannot use more than you have available!"
|
||||
"error_exceeds_stock": "⚠️ You cannot use more than you have available!",
|
||||
"use_all_confirm_title": "✅ Finish everything",
|
||||
"use_all_confirm_msg": "Confirm that you have finished the product:",
|
||||
"use_all_confirm_btn": "✅ Yes, finished",
|
||||
"throw_all_confirm_title": "🗑️ Discard everything",
|
||||
"throw_all_confirm_msg": "Do you really want to throw away the whole product?",
|
||||
"throw_all_confirm_btn": "🗑️ Yes, discard"
|
||||
},
|
||||
"product": {
|
||||
"title_new": "New Product",
|
||||
@@ -745,7 +751,14 @@
|
||||
},
|
||||
"confirm": {
|
||||
"remove_item": "Do you really want to remove this product from inventory?",
|
||||
"kiosk_exit": "Exit kiosk mode?"
|
||||
"kiosk_exit": "Exit kiosk mode?",
|
||||
"cancel": "Cancel",
|
||||
"proceed": "Confirm"
|
||||
},
|
||||
"location": {
|
||||
"dispensa": "Pantry",
|
||||
"frigo": "Fridge",
|
||||
"freezer": "Freezer"
|
||||
},
|
||||
"edit": {
|
||||
"title": "Edit {name}",
|
||||
|
||||
+15
-2
@@ -242,7 +242,13 @@
|
||||
"toast_opened_finished": "🔓 Confezione aperta di {name} finita!",
|
||||
"disambiguation_hint": "Cosa intendi con \"finito tutto\"?",
|
||||
"disambiguation_all": "🗑️ Finito TUTTO ({qty})",
|
||||
"error_exceeds_stock": "⚠️ Non puoi usare più di quanto hai disponibile!"
|
||||
"error_exceeds_stock": "⚠️ Non puoi usare più di quanto hai disponibile!",
|
||||
"use_all_confirm_title": "✅ Finisci tutto",
|
||||
"use_all_confirm_msg": "Conferma che hai finito tutto il prodotto:",
|
||||
"use_all_confirm_btn": "✅ Sì, finito",
|
||||
"throw_all_confirm_title": "🗑️ Butta tutto",
|
||||
"throw_all_confirm_msg": "Vuoi davvero buttare via tutto il prodotto?",
|
||||
"throw_all_confirm_btn": "🗑️ Sì, butta"
|
||||
},
|
||||
"product": {
|
||||
"title_new": "Nuovo Prodotto",
|
||||
@@ -745,7 +751,14 @@
|
||||
},
|
||||
"confirm": {
|
||||
"remove_item": "Vuoi davvero rimuovere questo prodotto dall'inventario?",
|
||||
"kiosk_exit": "Uscire dalla modalità kiosk?"
|
||||
"kiosk_exit": "Uscire dalla modalità kiosk?",
|
||||
"cancel": "Annulla",
|
||||
"proceed": "Conferma"
|
||||
},
|
||||
"location": {
|
||||
"dispensa": "Dispensa",
|
||||
"frigo": "Frigo",
|
||||
"freezer": "Freezer"
|
||||
},
|
||||
"edit": {
|
||||
"title": "Modifica {name}",
|
||||
|
||||
Reference in New Issue
Block a user