This commit is contained in:
2025-01-23 16:10:25 +00:00
parent a4a65d5b4f
commit 8ecc410394
9 changed files with 52 additions and 21 deletions

View File

@@ -90,6 +90,7 @@ $(document).ready(function () {
$("#excelBtn").click(() => { exportExcel(); });
$("#pdfBtn").click(() => { window.alert("In progress."); });
$("#productionBtn").click(() => { window.alert("In progress."); });
$("#createInsideOrder").click(createInsideOrder);
});
function editQty(id) {
@@ -210,4 +211,23 @@ function exportExcel() {
window.console.log(data);
},
});
}
}
function createInsideOrder() {
var ids = [];
$('input.allCheck:checkbox:checked').each(function () {
ids.push($(this).val());
});
if (ids.length === 0) {
alert('Wybierz pozycje.');
return;
}
var products = [];
ids.forEach(el => {
const qty = parseFloat($("#qtyInput-" + el).val().trim());
const id = $("#productId-" + el).val();
products.push(id + "|" + qty);
});
$("#insideOrderProducts").val(products.join('*'));
$("#createInsideOrderForm").submit();
}