FIX_OFFLINE AND ONLINE INVOICE LISTING PAGE

This commit is contained in:
Srinivas-Saravanan 2024-12-27 10:09:03 +05:30
parent 9b5417f786
commit 1c3e47b623
2 changed files with 26 additions and 3 deletions

View File

@ -146,7 +146,7 @@
<!-- Placeholder for status -->
<a href="#" class="" id="downloadPdfButton" title="Invoice PDF" style="font-size: large;"><i class="ri-file-download-line"></i> </a>
<a href="#" class="ri-printer-line" id="printPdfButton" title="Print Invoice" style="font-size: large; margin-left: 8px;"></a>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="font-size: 27px; margin-bottom: 2px;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="reloadBodyContent()" style="font-size: 27px; margin-bottom: 2px;">
<span id="statusText"></span>
<span aria-hidden="true">&times;</span>
</button>
@ -269,4 +269,16 @@
};
});
});
function reloadBodyContent() {
console.log("Inside Reload Function");
fetch(window.location.href) // Fetch the current page's content
.then(response => response.text())
.then(html => {
const parser = new DOMParser();
const doc = parser.parseFromString(html, 'text/html');
document.body.innerHTML = doc.body.innerHTML; // Replace the body content
// Reinitialize any required scripts if needed
})
.catch(error => console.error('Error reloading body:', error));
}
</script>

View File

@ -154,8 +154,7 @@
<a href="#" class="" id="editInvoiceButton" title="Edit Invoice"style="font-size: large;margin-left: 8px;"><i class="ri-pencil-line"></i> </a>
<a href="#" class="ri-printer-line" id="printPdfButton" title="Print Invoice"style="font-size: large;margin-left: 8px;"></a>
<h5 class="modal-title" id="pdfPreviewModalLabel"></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"style="font-size: 27px;
margin-bottom: 2px;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="reloadBodyContent()" style="font-size: 27px;margin-bottom: 2px;">
<span id="statusText"></span>
<span aria-hidden="true">&times;</span>
</button>
@ -286,6 +285,18 @@
});
});
function reloadBodyContent() {
console.log("Inside Reload Function");
fetch(window.location.href) // Fetch the current page's content
.then(response => response.text())
.then(html => {
const parser = new DOMParser();
const doc = parser.parseFromString(html, 'text/html');
document.body.innerHTML = doc.body.innerHTML; // Replace the body content
// Reinitialize any required scripts if needed
})
.catch(error => console.error('Error reloading body:', error));
}
</script>