feat: automatically remove items from stock when empty (quantity <= 0)
Build and Push Fridger Container / Build & Push Fridger Image (push) Successful in 1m16s
Build and Push Fridger Container / Build & Push Fridger Image (push) Successful in 1m16s
This commit is contained in:
+12
-4
@@ -546,9 +546,13 @@ async function confirmAndFinishAction() {
|
||||
if (res.ok) {
|
||||
const updated = await res.json();
|
||||
playBeepSound();
|
||||
showToast(`✓ ${action === 'add' ? 'Added' : 'Removed'} ${state.manage.packetCount} pack(s) of ${updated.name}`, 'success');
|
||||
if (updated.deleted || updated.is_empty || updated.quantity <= 0) {
|
||||
showToast(`✓ Removed empty ${updated.name} from stock`, 'success');
|
||||
} else {
|
||||
showToast(`✓ ${action === 'add' ? 'Added' : 'Removed'} ${state.manage.packetCount} pack(s) of ${updated.name}`, 'success');
|
||||
}
|
||||
|
||||
// Return to manage station
|
||||
// Return to manager station
|
||||
resetTabletManageStation();
|
||||
await loadStats();
|
||||
await loadItems();
|
||||
@@ -567,9 +571,13 @@ async function confirmAndFinishAction() {
|
||||
if (res.ok) {
|
||||
const updated = await res.json();
|
||||
playBeepSound();
|
||||
showToast(`✓ Set ${updated.name} to ${updated.quantity} ${updated.unit}`, 'success');
|
||||
if (updated.deleted || updated.is_empty || updated.quantity <= 0) {
|
||||
showToast(`✓ Finished ${updated.name} (0 ${updated.unit}): removed from stock`, 'success');
|
||||
} else {
|
||||
showToast(`✓ Set ${updated.name} to ${updated.quantity} ${updated.unit}`, 'success');
|
||||
}
|
||||
|
||||
// Return to manage station
|
||||
// Return to manager station
|
||||
resetTabletManageStation();
|
||||
await loadStats();
|
||||
await loadItems();
|
||||
|
||||
Reference in New Issue
Block a user