stock module - 15-03-2025

This commit is contained in:
vadivelJ96 2025-03-17 12:04:51 +05:30
parent f7a0d44692
commit 6a95add649
12 changed files with 348 additions and 113 deletions

View File

@ -1135,17 +1135,25 @@ class StockController extends BaseController
// Update stock values for each day in the month // Update stock values for each day in the month
foreach ($resultExists as $index => $result) { foreach ($resultExists as $index => $result) {
if ($index == 0) { if ($index == 0) {
// Update the first entry with new consumption // Update the first entry with new consumption
$result['consumption'] = (float)($result['consumption']) + (float)($consumption); $result['consumption'] = (float)($result['consumption']) + (float)($consumption);
$result['total'] = (float)$result['opening'] + (float)$result['purchaseBharath'] + (float)$result['purchaseIndian']; $result['total'] = (float)$result['opening'] + (float)$result['purchaseBharath'] + (float)$result['purchaseIndian'];
$result['balanceStock'] = $result['total'] - $result['consumption']; $result['balanceStock'] = $result['total'] - $result['consumption'];
$updatedOpeningStock = (int)$result['balanceStock']; $updatedOpeningStock = (int)$result['balanceStock'];
} else { } else {
// Update subsequent entries based on previous balance // Update subsequent entries based on previous balance
$result['opening'] = (float)$updatedOpeningStock; $result['opening'] = (float)$updatedOpeningStock;
$result['total'] = (float)$result['opening'] + (float)$result['purchaseBharath'] + (float)$result['purchaseIndian']; $result['total'] = (float)$result['opening'] + (float)$result['purchaseBharath'] + (float)$result['purchaseIndian'];
$result['balanceStock'] = (float)$result['total'] - (float)$result['consumption']; $result['balanceStock'] = (float)$result['total'] - (float)$result['consumption'];
$updatedOpeningStock = (int)$result['balanceStock']; $updatedOpeningStock = (int)$result['balanceStock'];
} }
@ -1159,6 +1167,8 @@ class StockController extends BaseController
} else { } else {
return 0; return 0;
} }
} else { } else {
// Get the last date of the previous month // Get the last date of the previous month
$previousMonthDate = new DateTime($date); $previousMonthDate = new DateTime($date);

View File

@ -1604,41 +1604,47 @@
<script> <script>
$(document).ready(function(){ $(document).ready(function () {
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
let table = document.getElementById(tableID); let table = document.getElementById(tableID);
let rows = [];
let cloneTable = table.cloneNode(true); // Clone the table to modify // Extract table data row-by-row
$(table).find('tr').each(function (rowIndex) {
let rowData = [];
// Remove hidden rows $(this).find('th, td').each(function (colIndex) {
$(cloneTable).find('tr').filter(function () { // Skip hidden columns
return $(this).css('display') === 'none'; if ($(this).css('display') === 'none') return;
}).remove();
// Remove hidden columns let cellText = $(this).text().trim();
$(cloneTable).find('th, td').each(function () {
if ($(this).css('display') === 'none') {
$(this).remove();
rowData.push(cellText);
});
// Add the cleaned row only if it has data
if (rowData.length > 0) {
rows.push(rowData);
} }
}); });
let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet // Create a worksheet from array (no DOM needed!)
let wb = XLSX.utils.book_new(); // Create a new workbook let ws = XLSX.utils.aoa_to_sheet(rows);
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); // Append sheet to workbook let wb = XLSX.utils.book_new();
XLSX.writeFile(wb, filename || 'export.xlsx'); // Save the file XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
XLSX.writeFile(wb, filename || 'export.xlsx');
} }
let tableId = 'coatingMachineDetailTableId'; let tableId = 'coatingMachineDetailTableId';
document.getElementById('coatingMachineDetailsExport').addEventListener('click',function(){ document.getElementById('coatingMachineDetailsExport').addEventListener('click', function () {
exportTableToExcel(tableId, 'coatingMachineDetails_<?=$month?>.xlsx');
});
exportTableToExcel(tableId,'coatingMachineDetails_<?=$month?>.xlsx'); });
})
})

View File

@ -1111,6 +1111,7 @@
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
let table = document.getElementById(tableID); let table = document.getElementById(tableID);
let cloneTable = table.cloneNode(true); // Clone the table to modify let cloneTable = table.cloneNode(true); // Clone the table to modify
// Remove hidden rows // Remove hidden rows
@ -1124,6 +1125,25 @@
$(this).remove(); $(this).remove();
} }
}); });
$(cloneTable).find('tbody tr').each(function() {
let firstTd = $(this).find('td').eq(0); // Get the first column (Date)
// Convert Date Format (Assuming it's in YYYY-MM-DD format)
let originalDate = firstTd.text().trim(); // Get the text value
let parts = originalDate.split('-'); // Split into [YYYY, MM, DD]
if (parts.length === 3) {
let formattedDate = `${parts[2]}-${parts[1]}-${parts[0]}`; // Rearrange to DD-MM-YYYY
firstTd.text(formattedDate); // Update the cell value
}
// Apply left alignment to the date column
firstTd.css("text-align", "left");
$(this).find('th').eq(13).remove(); // Remove the last column (Actions)
$(this).find('td').eq(13).remove(); // Remove the last column (Actions)
});
let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet
let wb = XLSX.utils.book_new(); // Create a new workbook let wb = XLSX.utils.book_new(); // Create a new workbook
@ -1131,6 +1151,7 @@
XLSX.writeFile(wb, filename || 'export.xlsx'); // Save the file XLSX.writeFile(wb, filename || 'export.xlsx'); // Save the file
} }
let tableId = 'bagStockDetailsTableId'; let tableId = 'bagStockDetailsTableId';
document.getElementById('bagStockExport').addEventListener('click',function(){ document.getElementById('bagStockExport').addEventListener('click',function(){

View File

@ -1428,6 +1428,7 @@ foreach ($period as $day) {
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
let table = document.getElementById(tableID); let table = document.getElementById(tableID);
let cloneTable = table.cloneNode(true); // Clone the table to modify let cloneTable = table.cloneNode(true); // Clone the table to modify
// Remove hidden rows // Remove hidden rows
@ -1441,6 +1442,25 @@ foreach ($period as $day) {
$(this).remove(); $(this).remove();
} }
}); });
$(cloneTable).find('tbody tr').each(function() {
let firstTd = $(this).find('td').eq(0); // Get the first column (Date)
// Convert Date Format (Assuming it's in YYYY-MM-DD format)
let originalDate = firstTd.text().trim(); // Get the text value
let parts = originalDate.split('-'); // Split into [YYYY, MM, DD]
if (parts.length === 3) {
let formattedDate = `${parts[2]}-${parts[1]}-${parts[0]}`; // Rearrange to DD-MM-YYYY
firstTd.text(formattedDate); // Update the cell value
}
// Apply left alignment to the date column
firstTd.css("text-align", "left");
$(this).find('th').eq(13).remove(); // Remove the last column (Actions)
$(this).find('td').eq(13).remove(); // Remove the last column (Actions)
});
let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet
let wb = XLSX.utils.book_new(); // Create a new workbook let wb = XLSX.utils.book_new(); // Create a new workbook

View File

@ -1307,31 +1307,32 @@ function convertToDate(dateString) {
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
let table = document.getElementById(tableID); let table = document.getElementById(tableID);
let rows = table.rows; let rows = [];
let data = [];
for (let i = 0; i < rows.length; i++) { // Extract table data row-by-row
let row = rows[i]; $(table).find('tr').each(function (rowIndex) {
let cols = row.querySelectorAll('td, th');
let rowData = []; let rowData = [];
for (let j = 0; j < cols.length; j++) { $(this).find('th, td').each(function (colIndex) {
let cell = cols[j]; // Skip hidden columns
if ($(this).css('display') === 'none') return;
// Check if the cell contains a <select> dropdown let cellText = $(this).text().trim();
let select = cell.querySelector('select');
if (select) {
rowData.push(select.options[select.selectedIndex].text); // Get only selected value
} else {
rowData.push(cell.innerText.trim()); // Normal text
}
}
data.push(rowData);
}
rowData.push(cellText);
});
// Add the cleaned row only if it has data
if (rowData.length > 0) {
rows.push(rowData);
}
});
// Create a worksheet from array (no DOM needed!)
let ws = XLSX.utils.aoa_to_sheet(rows);
let wb = XLSX.utils.book_new(); let wb = XLSX.utils.book_new();
let ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
XLSX.writeFile(wb, filename || 'export.xlsx'); XLSX.writeFile(wb, filename || 'export.xlsx');
} }

View File

@ -463,7 +463,7 @@
<br> <br>
<div class="row"> <div class="row">
<div class="col-md-12 text-center"> <div class="col-md-12 text-left" style="margin-left :350px !important ;" >
<input type="button" class="btn btn-success px-4" id="saveId" value="save"> <input type="button" class="btn btn-success px-4" id="saveId" value="save">
</div> </div>
</div> </div>
@ -634,12 +634,49 @@
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
let table = document.getElementById(tableID); let table = document.getElementById(tableID);
let ws = XLSX.utils.table_to_sheet(table); // Convert table to worksheet
let cloneTable = table.cloneNode(true); // Clone the table to modify
// Remove hidden rows
$(cloneTable).find('tr').filter(function () {
return $(this).css('display') === 'none';
}).remove();
// Remove hidden columns
$(cloneTable).find('th, td').each(function () {
if ($(this).css('display') === 'none') {
$(this).remove();
}
});
$(cloneTable).find('tbody tr').each(function() {
let firstTd = $(this).find('td').eq(0); // Get the first column (Date)
// Convert Date Format (Assuming it's in YYYY-MM-DD format)
let originalDate = firstTd.text().trim(); // Get the text value
let parts = originalDate.split('-'); // Split into [YYYY, MM, DD]
if (parts.length === 3) {
let formattedDate = `${parts[2]}-${parts[1]}-${parts[0]}`; // Rearrange to DD-MM-YYYY
firstTd.text(formattedDate); // Update the cell value
}
// Apply left alignment to the date column
firstTd.css("text-align", "left");
$(this).find('th').eq(13).remove(); // Remove the last column (Actions)
$(this).find('td').eq(13).remove(); // Remove the last column (Actions)
});
let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet
let wb = XLSX.utils.book_new(); // Create a new workbook let wb = XLSX.utils.book_new(); // Create a new workbook
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); // Append sheet to workbook XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); // Append sheet to workbook
XLSX.writeFile(wb, filename || 'export.xlsx'); // Save the file XLSX.writeFile(wb, filename || 'export.xlsx'); // Save the file
} }
let tableId = 'dustAndRoughStockDetailsTableId'; let tableId = 'dustAndRoughStockDetailsTableId';
document.getElementById('dustAndRoughStockExport').addEventListener('click',function(){ document.getElementById('dustAndRoughStockExport').addEventListener('click',function(){

View File

@ -280,10 +280,14 @@
<div class="dropdown-menu dropdown-menu-right"> <div class="dropdown-menu dropdown-menu-right">
<a style="cursor:pointer" <a style="cursor:pointer"
class="dropdown-item" data-toggle="modal" data-target="#filterModalId">Filter</a> class="dropdown-item" data-toggle="modal" data-target="#filterModalId">Filter</a>
<a style="cursor:pointer"
class="dropdown-item" id="gasStockDetailsExport" href="#">Export</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</form> </form>
@ -1095,6 +1099,69 @@ function convertToDate(dateString) {
return input; return input;
} }
</script>
<!-- excel export -->
<script>
$(document).ready(function(){
function exportTableToExcel(tableID, filename = '') {
let table = document.getElementById(tableID);
let cloneTable = table.cloneNode(true); // Clone the table to modify
// Remove hidden rows
$(cloneTable).find('tr').filter(function () {
return $(this).css('display') === 'none';
}).remove();
// Remove hidden columns
$(cloneTable).find('th, td').each(function () {
if ($(this).css('display') === 'none') {
$(this).remove();
}
});
$(cloneTable).find('tbody tr').each(function() {
let firstTd = $(this).find('td').eq(0); // Get the first column (Date)
// Convert Date Format (Assuming it's in YYYY-MM-DD format)
let originalDate = firstTd.text().trim(); // Get the text value
let parts = originalDate.split('-'); // Split into [YYYY, MM, DD]
if (parts.length === 3) {
let formattedDate = `${parts[2]}-${parts[1]}-${parts[0]}`; // Rearrange to DD-MM-YYYY
firstTd.text(formattedDate); // Update the cell value
}
// Apply left alignment to the date column
firstTd.css("text-align", "left");
$(this).find('th').eq(13).remove(); // Remove the last column (Actions)
$(this).find('td').eq(13).remove(); // Remove the last column (Actions)
});
let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet
let wb = XLSX.utils.book_new(); // Create a new workbook
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); // Append sheet to workbook
XLSX.writeFile(wb, filename || 'export.xlsx'); // Save the file
}
let tableId = 'gasStockDetailsTableId';
document.getElementById('gasStockDetailsExport').addEventListener('click',function(){
exportTableToExcel(tableId,'gasStockDetails<?=$month?>.xlsx');
})
})
</script> </script>
<script> <script>

View File

@ -315,6 +315,7 @@
<a style="cursor:pointer" <a style="cursor:pointer"
class="dropdown-item" id="incomingSilicaSandDetailsExport" href="#">Export</a> class="dropdown-item" id="incomingSilicaSandDetailsExport" href="#">Export</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -1729,6 +1730,7 @@ $(document).ready(function() {
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
let table = document.getElementById(tableID); let table = document.getElementById(tableID);
let cloneTable = table.cloneNode(true); // Clone the table to modify let cloneTable = table.cloneNode(true); // Clone the table to modify
// Remove hidden rows // Remove hidden rows
@ -1743,36 +1745,43 @@ $(document).ready(function() {
} }
}); });
let rows = cloneTable.rows; $(cloneTable).find('tbody tr').each(function() {
let data = []; let invoiceTd = $(this).find('td').eq(2); // Get the first column (Date)
let materialReceivedTd = $(this).find('td').eq(3); // Get the second column (Material Received)
for (let i = 0; i < rows.length; i++) { // Convert Date Format (Assuming it's in YYYY-MM-DD format)
let row = rows[i]; let originalInvoiceDate = invoiceTd.text().trim(); // Get the text value
let cols = row.querySelectorAll('td, th'); let originalMaterialReceivedDate = materialReceivedTd.text().trim(); // Get the text value
let rowData = [];
for (let j = 0; j < cols.length; j++) { let originalInvoiceParts = originalInvoiceDate.split('-'); // Split into [YYYY, MM, DD]
let cell = cols[j]; let originalMaterialReceivedParts = originalMaterialReceivedDate.split('-'); // Split into [YYYY, MM, DD]
// Check if the cell contains a <select> dropdown if (originalInvoiceParts.length === 3) {
let select = cell.querySelector('select'); let formattedDate = `${originalInvoiceParts[2]}-${originalInvoiceParts[1]}-${originalInvoiceParts[0]}`; // Rearrange to DD-MM-YYYY
if (select) { invoiceTd.text(formattedDate); // Update the cell value
rowData.push(select.options[select.selectedIndex].text); // Get only selected value
} else {
rowData.push(cell.innerText.trim()); // Normal text
}
} }
data.push(rowData); if (originalMaterialReceivedParts.length === 3) {
let formattedDate = `${originalMaterialReceivedParts[2]}-${originalMaterialReceivedParts[1]}-${originalMaterialReceivedParts[0]}`; // Rearrange to DD-MM-YYYY
materialReceivedTd.text(formattedDate); // Update the cell value
} }
let wb = XLSX.utils.book_new(); // Apply left alignment to the date column
let ws = XLSX.utils.aoa_to_sheet(data); invoiceTd.css("text-align", "left");
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); materialReceivedTd.css("text-align", "left");
XLSX.writeFile(wb, filename || 'export.xlsx');
});
let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet
let wb = XLSX.utils.book_new(); // Create a new workbook
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); // Append sheet to workbook
XLSX.writeFile(wb, filename || 'export.xlsx'); // Save the file
} }
let tableId = 'incomingSilicaSandDetailsTable'; let tableId = 'incomingSilicaSandDetailsTable';
document.getElementById('incomingSilicaSandDetailsExport').addEventListener('click',function(){ document.getElementById('incomingSilicaSandDetailsExport').addEventListener('click',function(){

View File

@ -1366,26 +1366,48 @@ foreach ($period as $day) {
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
let table = document.getElementById(tableID); let table = document.getElementById(tableID);
let cloneTable = table.cloneNode(true); // Clone the table to modify let cloneTable = table.cloneNode(true); // Clone the table to modify
// Remove hidden rows // Remove hidden rows
$(cloneTable).find('tr').filter(function() { $(cloneTable).find('tr').filter(function () {
return $(this).css('display') === 'none'; return $(this).css('display') === 'none';
}).remove(); }).remove();
// Remove hidden columns // Remove hidden columns
$(cloneTable).find('th, td').each(function() { $(cloneTable).find('th, td').each(function () {
if ($(this).css('display') === 'none') { if ($(this).css('display') === 'none') {
$(this).remove(); $(this).remove();
} }
}); });
$(cloneTable).find('tbody tr').each(function() {
let firstTd = $(this).find('td').eq(0); // Get the first column (Date)
// Convert Date Format (Assuming it's in YYYY-MM-DD format)
let originalDate = firstTd.text().trim(); // Get the text value
let parts = originalDate.split('-'); // Split into [YYYY, MM, DD]
if (parts.length === 3) {
let formattedDate = `${parts[2]}-${parts[1]}-${parts[0]}`; // Rearrange to DD-MM-YYYY
firstTd.text(formattedDate); // Update the cell value
}
// Apply left alignment to the date column
firstTd.css("text-align", "left");
$(this).find('th').eq(13).remove(); // Remove the last column (Actions)
$(this).find('td').eq(13).remove(); // Remove the last column (Actions)
});
let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet
let wb = XLSX.utils.book_new(); // Create a new workbook let wb = XLSX.utils.book_new(); // Create a new workbook
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); // Append sheet to workbook XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); // Append sheet to workbook
XLSX.writeFile(wb, filename || 'export.xlsx'); // Save the file XLSX.writeFile(wb, filename || 'export.xlsx'); // Save the file
} }
let tableId = 'powerStockDetailsTableId'; let tableId = 'powerStockDetailsTableId';
document.getElementById('powerConsumptionExport').addEventListener('click', function() { document.getElementById('powerConsumptionExport').addEventListener('click', function() {

View File

@ -1065,19 +1065,39 @@ foreach ($period as $day) {
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
let table = document.getElementById(tableID); let table = document.getElementById(tableID);
let cloneTable = table.cloneNode(true); // Clone the table to modify let cloneTable = table.cloneNode(true); // Clone the table to modify
// Remove hidden rows // Remove hidden rows
$(cloneTable).find('tr').filter(function() { $(cloneTable).find('tr').filter(function () {
return $(this).css('display') === 'none'; return $(this).css('display') === 'none';
}).remove(); }).remove();
// Remove hidden columns // Remove hidden columns
$(cloneTable).find('th, td').each(function() { $(cloneTable).find('th, td').each(function () {
if ($(this).css('display') === 'none') { if ($(this).css('display') === 'none') {
$(this).remove(); $(this).remove();
} }
}); });
$(cloneTable).find('tbody tr').each(function() {
let firstTd = $(this).find('td').eq(0); // Get the first column (Date)
// Convert Date Format (Assuming it's in YYYY-MM-DD format)
let originalDate = firstTd.text().trim(); // Get the text value
let parts = originalDate.split('-'); // Split into [YYYY, MM, DD]
if (parts.length === 3) {
let formattedDate = `${parts[2]}-${parts[1]}-${parts[0]}`; // Rearrange to DD-MM-YYYY
firstTd.text(formattedDate); // Update the cell value
}
// Apply left alignment to the date column
firstTd.css("text-align", "left");
$(this).find('th').eq(13).remove(); // Remove the last column (Actions)
$(this).find('td').eq(13).remove(); // Remove the last column (Actions)
});
let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet
let wb = XLSX.utils.book_new(); // Create a new workbook let wb = XLSX.utils.book_new(); // Create a new workbook

View File

@ -331,7 +331,8 @@ $timeOtions[] = "12:00 AM";
</a> </a>
<div class="dropdown-menu dropdown-menu-right"> <div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a> <a class="dropdown-item" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a>
<a class="dropdown-item" href="#">Export</a> <a style="cursor:pointer"
class="dropdown-item" id="gasStockDetailsExport" href="#">Export</a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -488,7 +488,7 @@
<br> <br>
<div class="row"> <div class="row">
<div class="col-md-12 text-center"> <div class="col-md-12 text-left" style="margin-left :350px !important ;" >
<input type="button" class="btn btn-success px-4" id="saveId" value="save"> <input type="button" class="btn btn-success px-4" id="saveId" value="save">
</div> </div>
</div> </div>
@ -664,6 +664,7 @@
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
let table = document.getElementById(tableID); let table = document.getElementById(tableID);
let cloneTable = table.cloneNode(true); // Clone the table to modify let cloneTable = table.cloneNode(true); // Clone the table to modify
// Remove hidden rows // Remove hidden rows
@ -678,6 +679,26 @@
} }
}); });
$(cloneTable).find('tbody tr').each(function() {
let firstTd = $(this).find('td').eq(0); // Get the first column (Date)
// Convert Date Format (Assuming it's in YYYY-MM-DD format)
let originalDate = firstTd.text().trim(); // Get the text value
let parts = originalDate.split('-'); // Split into [YYYY, MM, DD]
if (parts.length === 3) {
let formattedDate = `${parts[2]}-${parts[1]}-${parts[0]}`; // Rearrange to DD-MM-YYYY
firstTd.text(formattedDate); // Update the cell value
}
// Apply left alignment to the date column
firstTd.css("text-align", "left");
$(this).find('th').eq(13).remove(); // Remove the last column (Actions)
$(this).find('td').eq(13).remove(); // Remove the last column (Actions)
});
let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet
let wb = XLSX.utils.book_new(); // Create a new workbook let wb = XLSX.utils.book_new(); // Create a new workbook
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); // Append sheet to workbook XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); // Append sheet to workbook