changes in stock module 14-03-2025
This commit is contained in:
parent
5145c23201
commit
9555fdf56b
@ -661,6 +661,11 @@
|
|||||||
<div class="modal-content" style="border: 1px solid #ddd; margin-top: 73px; box-shadow: 0 0 40px rgb(0 0 0 / 43%);">
|
<div class="modal-content" style="border: 1px solid #ddd; margin-top: 73px; box-shadow: 0 0 40px rgb(0 0 0 / 43%);">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="gasShortageListLabel" align="center">List of Gas Shortages</h5>
|
<h5 class="modal-title" id="gasShortageListLabel" align="center">List of Gas Shortages</h5>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-primary btn-sm" id="exportGasShortage" style="margin-left: 10px;">
|
||||||
|
Export
|
||||||
|
<i class="fa fa-download" style="color:white;"></i>
|
||||||
|
</button>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
@ -1276,8 +1281,8 @@
|
|||||||
if(regex.test(item.MaterialCategory) ){
|
if(regex.test(item.MaterialCategory) ){
|
||||||
$('#gasShortageHeader').show();
|
$('#gasShortageHeader').show();
|
||||||
$('#gasShortageListHeader').show();
|
$('#gasShortageListHeader').show();
|
||||||
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
|
trIGRHTML += '<td style="width: 25px; cursor:pointer;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
|
||||||
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
|
trIGRHTML += '<td style="width: 25px; cursor:pointer;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
|
||||||
|
|
||||||
trIGRHTML +='</tr>';
|
trIGRHTML +='</tr>';
|
||||||
}else{
|
}else{
|
||||||
@ -1329,8 +1334,8 @@
|
|||||||
if(regex.test(item.MaterialCategory) ){
|
if(regex.test(item.MaterialCategory) ){
|
||||||
$('#gasShortageHeader').show();
|
$('#gasShortageHeader').show();
|
||||||
$('#gasShortageListHeader').show();
|
$('#gasShortageListHeader').show();
|
||||||
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
|
trIGRHTML += '<td style="width: 25px; cursor:pointer;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
|
||||||
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
|
trIGRHTML += '<td style="width: 25px; cursor:pointer;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
|
||||||
|
|
||||||
trIGRHTML +='</tr>';
|
trIGRHTML +='</tr>';
|
||||||
}else{
|
}else{
|
||||||
@ -1370,13 +1375,13 @@
|
|||||||
'<input type="file" id="txtWeightFile' + i + '" name="txtWeightFile' + i + '"value="' + item.WeightFile + '">' +
|
'<input type="file" id="txtWeightFile' + i + '" name="txtWeightFile' + i + '"value="' + item.WeightFile + '">' +
|
||||||
'<input type="hidden" id="txtWeightFileName' + i + '" name="txtWeightFileName' + i + '"value="' + item.WeightFile + '">';
|
'<input type="hidden" id="txtWeightFileName' + i + '" name="txtWeightFileName' + i + '"value="' + item.WeightFile + '">';
|
||||||
|
|
||||||
let regex = /gas/i;
|
let regex = /gas/i;
|
||||||
|
|
||||||
if(regex.test(item.MaterialCategory) ){
|
if(regex.test(item.MaterialCategory) ){
|
||||||
$('#gasShortageHeader').show();
|
$('#gasShortageHeader').show();
|
||||||
$('#gasShortageListHeader').show();
|
$('#gasShortageListHeader').show();
|
||||||
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
|
trIGRHTML += '<td style="width: 25px; cursor:pointer;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
|
||||||
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
|
trIGRHTML += '<td style="width: 25px; cursor:pointer;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
|
||||||
|
|
||||||
trIGRHTML +='</tr>';
|
trIGRHTML +='</tr>';
|
||||||
}else{
|
}else{
|
||||||
@ -2588,18 +2593,19 @@
|
|||||||
success: function (response) {
|
success: function (response) {
|
||||||
if (response.status === "success") {
|
if (response.status === "success") {
|
||||||
|
|
||||||
console.log(response.data);
|
|
||||||
|
|
||||||
let data = response.data ;
|
let data = response.data ;
|
||||||
console.log("gas shortage list");
|
|
||||||
console.log(data);
|
|
||||||
let tableData = '';
|
let tableData = '';
|
||||||
|
|
||||||
data.forEach((val) => {
|
data.forEach((val) => {
|
||||||
|
|
||||||
|
let fullCylinderDate = val.fullCylinderDate.split("-").reverse().join("-");
|
||||||
|
let emptyCylinderDate = val.emptyCylinderDate.split("-").reverse().join('-');
|
||||||
|
|
||||||
tableData += `
|
tableData += `
|
||||||
<tr>
|
<tr>
|
||||||
<td>${val.fullCylinderDate}</td>
|
<td>${fullCylinderDate}</td>
|
||||||
<td>${val.emptyCylinderDate}</td>
|
<td>${emptyCylinderDate}</td>
|
||||||
<td>${val.invoiceNo}</td>
|
<td>${val.invoiceNo}</td>
|
||||||
<td>${val.cylinderNo}</td>
|
<td>${val.cylinderNo}</td>
|
||||||
<td>${val.grossWeight}</td>
|
<td>${val.grossWeight}</td>
|
||||||
@ -2608,7 +2614,7 @@
|
|||||||
<td>${val.actualWeight}</td>
|
<td>${val.actualWeight}</td>
|
||||||
<td>${val.shortage}</td>
|
<td>${val.shortage}</td>
|
||||||
<td style="display:none">${val.id}</td>
|
<td style="display:none">${val.id}</td>
|
||||||
<td style="width: 25px;">
|
<td style="width: 25px; cursor: pointer;">
|
||||||
<i class="fa fa-solid fa-edit btnEditGasShortageCalculator"
|
<i class="fa fa-solid fa-edit btnEditGasShortageCalculator"
|
||||||
style="text-align: center;"
|
style="text-align: center;"
|
||||||
data-toggle="modal"
|
data-toggle="modal"
|
||||||
@ -2802,5 +2808,51 @@ $("#gasShortageCalculator, #editGasShortageCalculator").submit(function (event)
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<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();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
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 = 'gasShortageTable';
|
||||||
|
|
||||||
|
document.getElementById('exportGasShortage').addEventListener('click',function(){
|
||||||
|
|
||||||
|
exportTableToExcel(tableId, 'gas_shortage_<?= $date->format('d-m-Y') ?>.xlsx');
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user