| Line 10... |
Line 10... |
| 10 |
var transactionId = $(this).data("transaction");
|
10 |
var transactionId = $(this).data("transaction");
|
| 11 |
var warehouseId = $("#selectedWarehouse").val();
|
11 |
var warehouseId = $("#selectedWarehouse").val();
|
| 12 |
loadTransactionDetail(transactionId, warehouseId, "transaction-detail-container");
|
12 |
loadTransactionDetail(transactionId, warehouseId, "transaction-detail-container");
|
| 13 |
});
|
13 |
});
|
| 14 |
|
14 |
|
| - |
|
15 |
$(document).on('click', ".change-warehouse-save-mk", function () {
|
| - |
|
16 |
var selectedFromBillingWarehouse = $("#selectedFromBillingWarehouse").val();
|
| - |
|
17 |
var orderId = $("#selectedFromBillingWarehouse").data('orderid');
|
| - |
|
18 |
doPostAjaxRequestHandler(context + `/om/changeBillingWarehouse/?billingFromWarehouseId=${selectedFromBillingWarehouse}&orderId=${orderId}`, function (response) {
|
| - |
|
19 |
if (response.response === true) {
|
| - |
|
20 |
var warehouseId = $("#selectedWarehouse").val();
|
| - |
|
21 |
loadAllTransaction(warehouseId, "main-content");
|
| - |
|
22 |
} else {
|
| - |
|
23 |
alert('Something went wrong');
|
| - |
|
24 |
}
|
| - |
|
25 |
|
| - |
|
26 |
});
|
| - |
|
27 |
});
|
| - |
|
28 |
|
| - |
|
29 |
$(document).on('click', ".changeWarehouse-mk", function () {
|
| - |
|
30 |
var itemId = $(this).data("itemid");
|
| - |
|
31 |
var warehouseId = $(this).data("warehouseid");
|
| - |
|
32 |
var orderId = $(this).data("orderid");
|
| - |
|
33 |
console.log('warehouse', warehouseId);
|
| - |
|
34 |
console.log('itemId', itemId);
|
| - |
|
35 |
doGetAjaxRequestHandler(`${context}/om/formWarehouseByItemId/?warehouseId=${warehouseId}&itemId=${itemId}`, function (response) {
|
| - |
|
36 |
console.log(response);
|
| - |
|
37 |
if (response && response.response && Array.isArray(response.response)) {
|
| - |
|
38 |
console.log("response warehouse", response.response);
|
| - |
|
39 |
var selectOptions = '';
|
| - |
|
40 |
response.response.forEach(function (warehouse) {
|
| - |
|
41 |
selectOptions += `<option value="${warehouse.warehouseFrom}">${warehouse.warehouseFromName}</option>`;
|
| - |
|
42 |
});
|
| - |
|
43 |
// Populate the modal with the select dropdown
|
| - |
|
44 |
$('#changeWarehouseModal .modal-body').html(`<select id="selectedFromBillingWarehouse" data-orderid="${orderId}" class="form-control">${selectOptions}</select>`);
|
| - |
|
45 |
} else {
|
| - |
|
46 |
console.log('error: invalid response structure');
|
| - |
|
47 |
}
|
| - |
|
48 |
});
|
| - |
|
49 |
});
|
| - |
|
50 |
|
| - |
|
51 |
|
| - |
|
52 |
|
| - |
|
53 |
|
| 15 |
$(document).on('click', ".order_accepted", function () {
|
54 |
$(document).on('click', ".order_accepted", function () {
|
| 16 |
var transactionId = $("#selectedTransactionId").text();
|
55 |
var transactionId = $("#selectedTransactionId").text();
|
| 17 |
var warehouseId = $("#selectedWarehouseId").val();
|
56 |
var warehouseId = $("#selectedWarehouseId").val();
|
| 18 |
var orderBillingModels = []; // Array to store OrderBillingModel objects
|
57 |
var orderBillingModels = []; // Array to store OrderBillingModel objects
|
| 19 |
$("#wareHouseTransactionTable > tbody > tr").each(function (rowIndex) {
|
58 |
$("#wareHouseTransactionTable > tbody > tr").each(function (rowIndex) {
|