chnage some feaures
This commit is contained in:
@@ -19,8 +19,13 @@ if ($invoiceInfo['tenure'] > 1) {
|
||||
$emiPlans = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="container my-5">
|
||||
<div class="mt-2">
|
||||
<div class="d-flex gap-1 justify-content-end invoices-button">
|
||||
<button onclick="downloadPDF()" class="btn-print" style=""><img src="/assets/download.svg" alt=""> Download</button>
|
||||
<button onclick="window.print()" class="btn-print" style=""><img src="/assets/print.svg" alt=""> Print</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container mx-auto ">
|
||||
<div class="invoice-box" id="invoice-box">
|
||||
<div class="d-flex justify-content-between" >
|
||||
<img src="/assets/logo_dark.png" alt="" style="width: 150px; height: fit-content;" />
|
||||
@@ -54,7 +59,6 @@ if ($invoiceInfo['tenure'] > 1) {
|
||||
<th>Description</th>
|
||||
<th>Qty</th>
|
||||
<th>Rate</th>
|
||||
<th>Discount(%)</th>
|
||||
<th>Discount</th>
|
||||
<th>Total</th>
|
||||
</tr>
|
||||
@@ -65,7 +69,6 @@ if ($invoiceInfo['tenure'] > 1) {
|
||||
<td><?= $invoiceInfo['description'] ?></td>
|
||||
<td><?= $invoiceInfo['qty'] ?></td>
|
||||
<td><?= $invoiceInfo['rate'] ?></td>
|
||||
<td><?= $invoiceInfo['discount'] ?>%</td>
|
||||
<td>$<?= $invoiceInfo['discountAmount'] ?></td>
|
||||
<td>$<?= number_format($invoiceInfo['totalAmount'], 2) ?></td>
|
||||
</tr>
|
||||
@@ -135,11 +138,8 @@ if ($invoiceInfo['tenure'] > 1) {
|
||||
<?php } ?>
|
||||
<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>
|
||||
<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>
|
||||
@@ -148,9 +148,9 @@ if ($invoiceInfo['tenure'] > 1) {
|
||||
function downloadPDF() {
|
||||
const invoice = document.getElementById("invoice-box");
|
||||
html2pdf(invoice, {
|
||||
margin: 10,
|
||||
margin: 0,
|
||||
filename: 'invoice.pdf',
|
||||
image: { type: 'jpeg', quality: 0.98 },
|
||||
image: { type: 'jpeg', quality: 1 },
|
||||
html2canvas: { scale: 2 },
|
||||
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
|
||||
});
|
||||
@@ -162,14 +162,29 @@ if ($invoiceInfo['tenure'] > 1) {
|
||||
}
|
||||
.invoice-box {
|
||||
max-width: 800px;
|
||||
margin: auto;
|
||||
padding: 30px;
|
||||
margin: 0 auto;
|
||||
padding: 25px 30px;
|
||||
/* border: 1px solid #ddd; */
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
}
|
||||
.invoices-button {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
/* padding: 30px 30px; */
|
||||
/* border: 1px solid #ddd; */
|
||||
background: #fff;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
}
|
||||
.text-blue { color: #007bff; }
|
||||
.btn-print { margin-top: 20px; }
|
||||
.btn-print {
|
||||
margin: 8px 8px 0px 8px;
|
||||
border: 1px solid #374151;
|
||||
background: transparent;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body * {
|
||||
|
||||
Reference in New Issue
Block a user