PP
This commit is contained in:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user