partial update detail opnames page

This commit is contained in:
2025-06-05 15:18:20 +07:00
parent ce0a4718e0
commit d294bb7876
15 changed files with 217 additions and 72 deletions

View File

@@ -16,34 +16,3 @@ let table = $("#opnames-table").DataTable({
{ data: "action", name: "action", orderable: false, searchable: false },
],
});
$(document).on("click", ".btn-product-stock-dealers", function () {
const productId = $(this).data("id");
const productName = $(this).data("name");
const ajaxUrl = $(this).data("url");
// Set product name in modal title
$("#product-name-title").text(productName);
// Initialize or reload DataTable inside modal
$("#dealer-stock-table").DataTable({
destroy: true, // reinit if exists
processing: true,
serverSide: true,
ajax: {
url: ajaxUrl,
data: {
product_id: productId,
},
},
columns: [
{ data: "dealer_name", name: "dealer_name" },
{ data: "system_stock", name: "system_stock" },
{ data: "physical_stock", name: "physical_stock" },
{ data: "difference", name: "difference" },
{ data: "opname_date", name: "opname_date" },
],
});
// Show the modal
$("#dealerStockModal").modal("show");
});