s11
This commit is contained in:
@@ -21,7 +21,7 @@ if ($invoiceInfo['tenure'] > 1) {
|
||||
?>
|
||||
|
||||
<div class="container my-5">
|
||||
<div class="invoice-box">
|
||||
<div class="invoice-box" id="invoice-box">
|
||||
<h2 class="text-center fw-bold" style="color: #374151;">Invoice</h2><hr>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100">
|
||||
@@ -124,11 +124,26 @@ if ($invoiceInfo['tenure'] > 1) {
|
||||
|
||||
<p class="text-muted mt-3"><strong>Admin Note:</strong> <?= $invoiceInfo['adminNote'] ?></p>
|
||||
<p style="font-size: 12px;"><strong>Invoice Generate Date: </strong><span id="invoiceGenDate"></span></p>
|
||||
<button onclick="window.print()" class="btn text-white btn-print w-100" style="background-color: #374151;">Print Invoice</button>
|
||||
<div class="d-flex gap-1">
|
||||
<button onclick="downloadPDF()" class="btn text-white btn-print w-100" style="background-color: #374151;">Download Invoice</button>
|
||||
<button onclick="window.print()" class="btn text-white btn-print w-100" style="background-color: #374151;">Print Invoice</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/js/html2pdf.bundle.min.js"></script>
|
||||
<script>
|
||||
document.getElementById('invoiceGenDate').textContent = new Date().toLocaleDateString('en-GB');
|
||||
|
||||
function downloadPDF() {
|
||||
const invoice = document.getElementById("invoice-box");
|
||||
html2pdf(invoice, {
|
||||
margin: 10,
|
||||
filename: 'invoice.pdf',
|
||||
image: { type: 'jpeg', quality: 0.98 },
|
||||
html2canvas: { scale: 2 },
|
||||
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
body {
|
||||
@@ -138,7 +153,7 @@ if ($invoiceInfo['tenure'] > 1) {
|
||||
max-width: 800px;
|
||||
margin: auto;
|
||||
padding: 30px;
|
||||
border: 1px solid #ddd;
|
||||
/* border: 1px solid #ddd; */
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user