Suvodip 2025-03-26 12:01:32 +05:30
parent 55874583eb
commit 492e4d2bb6
3 changed files with 83 additions and 43 deletions

View File

@ -251,10 +251,10 @@
</table> </table>
</div> </div>
<div class="d-flex justify-content-end align-items-center"> <div class="d-flex justify-content-end align-items-center">
<div> <div class="mt-2">
<button class="btn btn-secondary">Discard</button> <button class="btn btn-secondary">Discard</button>
<button type="submit" class="btn btn-primary">Save</button> <button type="submit" class="btn text-white" style="background-color: #374151;">Save</button>
<a href="/customers/print-invoice/?customerId=<?= $_GET['customerId'] . '&invoiceId='. $_GET['invoiceId']; ?>" id="printBtn" class="btn btn-primary visually-">Print Invoice</a> <a href="/customers/print-invoice/?customerId=<?= $_GET['customerId'] . '&invoiceId='. $_GET['invoiceId']; ?>" id="printBtn" class="btn text-white visually-" style="background-color: #374151;">Print Invoice</a>
</div> </div>
</div> </div>

View File

@ -107,11 +107,11 @@ if ($invoiceInfo['tenure'] > 1) {
<table class="table table-striped " style="font-size: 14px;"> <table class="table table-striped " style="font-size: 14px;">
<thead class=""> <thead class="">
<tr> <tr>
<th>Payment Amount</th> <th>Amount</th>
<th>Payment Date</th> <th>Date</th>
<th>Payment Source</th> <th>Source</th>
<th>Transaction ID</th> <th>Transaction&nbsp;ID</th>
<th>Remarks</th> <th class="text-center">Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -22,22 +22,33 @@ if ($invoiceInfo['tenure'] > 1) {
<div class="container my-5"> <div class="container my-5">
<div class="invoice-box" id="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="d-flex justify-content-between" >
<div class="w-100"> <img src="/assets/logo_dark.png" alt="" style="width: 150px; height: fit-content;" />
<h6>Invoice ID: <?= $invoiceInfo['invoiceId'] ?></h6> <div>
<h6>Customer: <?= $invoiceInfo['customerName'] ?></h6> <h3 class="text-center fw-bold" style="color: #374151;">Invoice</h3>
<p style="width: 70%;"><strong>Address:</strong> <?= $invoiceInfo['address'] ?></p> <p style="margin-top: -10px;"><strong># <?= $invoiceInfo['invoiceId'] ?></strong></p>
</div>
<div class="w-100 d-flex flex-column align-items-end">
<h6>Invoice Date: <?= $invoiceInfo['invoiceDate'] ?></h6>
<h6>Payment Mode: <?= $invoiceInfo['paymentMode'] ?></h6>
<p><strong>Agent:</strong> <?= $invoiceInfo['salesAgent'] ?></p>
</div> </div>
</div> </div>
<div class="d-flex justify-content-between gap-2">
<table class="table table-bordered mt-3"> <div>
<thead class="table-dark"> <p style="font-size: 14px;"><strong>Bill To:</strong></p>
<p style="margin-top: -10px; font-size: 13px;">
<span><strong><?= $invoiceInfo['customerName'] ?></strong></span><br>
<span style=""><?= $invoiceInfo['address'] ?></span>
</p>
<p style="margin-top: -15px; font-size: 14px;">Invoice Date: <?= $invoiceInfo['invoiceDate'] ?></p>
</div>
<div>
<p style="font-size: 14px;"><strong>CLASSBOXES TECHNOLOGY</strong></p>
<p style="margin-top: -15px; font-size: 13px; text-align: right;">
<span>371 Hoes Lane, Suite #200</span><br>
<span>Piscataway New Jersey</span><br>
<span>US 08854</span>
</p>
</div>
</div>
<table class="table table-bordered mt-3" style="font-size: 14px;">
<thead class="text-white" style="background-color: #374151;">
<tr> <tr>
<th>Item</th> <th>Item</th>
<th>Description</th> <th>Description</th>
@ -60,12 +71,11 @@ if ($invoiceInfo['tenure'] > 1) {
</tr> </tr>
</tbody> </tbody>
</table> </table>
<!-- https://center.rgyci.org/printresult_admin_pdf.php?role=admin&reg=WB180Y2021R11308&sem=1
https://center.rgyci.org/printresult_admin.php?sid=&reg=WB180Y2021R11308&sem=1 -->
<!-- EMI Table (if tenure > 1) --> <!-- EMI Table (if tenure > 1) -->
<?php if ($invoiceInfo['tenure'] > 1): ?> <?php if ($invoiceInfo['tenure'] > 1): ?>
<h4 class="mt-4" style="color: #374151;">EMI Payment Plan</h4> <h6 class="mt-4" style="color: #374151;">EMI Payment Plan</h6>
<table class="table table-striped"> <table class="table table-striped" style="font-size: 14px;">
<thead> <thead>
<tr> <tr>
<th>EMI No.</th> <th>EMI No.</th>
@ -77,7 +87,7 @@ if ($invoiceInfo['tenure'] > 1) {
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($emiPlans as $emi): ?> <?php foreach ($emiPlans as $emi): if($emi['emiAmount'] !== null) {?>
<tr> <tr>
<td><?= $emi['emiNumber'] ?></td> <td><?= $emi['emiNumber'] ?></td>
<td><?= $emi['emiDate'] ?></td> <td><?= $emi['emiDate'] ?></td>
@ -88,14 +98,43 @@ if ($invoiceInfo['tenure'] > 1) {
<?= ($emi['payStatus'] == 1) ? '<span class="badge bg-success">Paid</span>' : '<span class="badge bg-danger">Pending</span>' ?> <?= ($emi['payStatus'] == 1) ? '<span class="badge bg-success">Paid</span>' : '<span class="badge bg-danger">Pending</span>' ?>
</td> </td>
</tr> </tr>
<?php endforeach; ?> <?php } endforeach; ?>
</tbody> </tbody>
</table> </table>
<?php endif; ?> <?php endif; ?>
<?php if(!is_null($emiPlans[0]['adPaymentAmount']) && $emiPlans[0]['adPaymentAmount'] > 0) { ?>
<h6 class="mt-4" style="color: #374151;">Additional Payment Details:</h6>
<table class="table table-striped " style="font-size: 14px;">
<thead class="">
<tr>
<th>Amount</th>
<th>Date</th>
<th>Source</th>
<th>Transaction&nbsp;ID</th>
<th class="text-center">Remarks</th>
</tr>
</thead>
<tbody>
<?php
foreach ($emiPlans as $emiAdditional) {
if (!is_null($emiAdditional['adPaymentAmount']) && $emiAdditional['adPaymentAmount'] > 0) {
?>
<tr>
<td><?= number_format($emiAdditional['adPaymentAmount'], 2) ?></td>
<td><?= !empty($emiAdditional['adPaymentDate']) ? $emiAdditional['adPaymentDate'] : '-' ?></td>
<td><?= !empty($emiAdditional['adPaymentSource']) ? $emiAdditional['adPaymentSource'] : '-' ?></td>
<td><?= !empty($emiAdditional['adPaymentTran']) ? $emiAdditional['adPaymentTran'] : '-' ?></td>
<td><?= !empty($emiAdditional['adPaymentRemarks']) ? $emiAdditional['adPaymentRemarks'] : '-' ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<?php } ?>
<p class="text-muted mt-3"><strong>Admin Note:</strong> <?= $invoiceInfo['adminNote'] ?></p> <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>
<!-- Print Button -->
<div class="d-flex gap-1"> <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="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> <button onclick="window.print()" class="btn text-white btn-print w-100" style="background-color: #374151;">Print Invoice</button>
@ -104,6 +143,8 @@ if ($invoiceInfo['tenure'] > 1) {
</div> </div>
<script src="/assets/js/html2pdf.bundle.min.js"></script> <script src="/assets/js/html2pdf.bundle.min.js"></script>
<script> <script>
document.getElementById('invoiceGenDate').textContent = new Date().toLocaleDateString('en-GB');
function downloadPDF() { function downloadPDF() {
const invoice = document.getElementById("invoice-box"); const invoice = document.getElementById("invoice-box");
html2pdf(invoice, { html2pdf(invoice, {
@ -115,7 +156,6 @@ if ($invoiceInfo['tenure'] > 1) {
}); });
} }
</script> </script>
<style> <style>
body { body {
background-color: #f8f9fa; background-color: #f8f9fa;
@ -124,7 +164,7 @@ if ($invoiceInfo['tenure'] > 1) {
max-width: 800px; max-width: 800px;
margin: auto; margin: auto;
padding: 30px; padding: 30px;
border: 1px solid #ddd; /* border: 1px solid #ddd; */
background: #fff; background: #fff;
border-radius: 10px; border-radius: 10px;
} }