fix: skip use-all confirm when only one item row and no open packages

This commit is contained in:
dadaloop82
2026-05-22 04:49:27 +00:00
parent 6f2d6d9944
commit 1efeaf9236
+7 -1
View File
@@ -9272,7 +9272,13 @@ async function submitUseAll() {
return;
}
// No opened packages → standard destructive confirm
// No opened packages → if there is only one item row, it's unambiguous — skip confirm
if (items0.length === 1) {
_doSubmitUseAll();
return;
}
// Multiple rows, no opened packages → standard destructive confirm
const totalQty = items0.reduce((s, i) => s + parseFloat(i.quantity || 0), 0);
const unit = items0[0]?.unit || 'pz';
const qtyStr = stripHtml(formatQuantity(totalQty, unit, items0[0]?.default_quantity, items0[0]?.package_unit));