This commit is contained in:
Suvodip
2025-03-27 11:51:04 +05:30
parent 492e4d2bb6
commit 43f6f2ce21
7 changed files with 53 additions and 32 deletions

View File

@@ -57,8 +57,8 @@
<!-- Invoice Data -->
<td><?php echo htmlspecialchars($invoice['invoiceId']); ?></td>
<td><?php echo htmlspecialchars($invoice['invoiceDate']); ?></td>
<td><?php echo htmlspecialchars($invoice['totalAmount']); ?></td>
<td><?php echo date('m/d/Y', strtotime($invoice['invoiceDate'])); ?></td>
<td>&#36;<?php echo htmlspecialchars($invoice['totalAmount']); ?></td>
<td>
<a href="/my-account/emi-details/?customerId=<?php echo $customer['customerId'] . '&invoiceId=' . $invoice['invoiceId']; ?>" class="btn text-white btn-sm" style="background-color: #374151;">Details</a>

View File

@@ -75,7 +75,7 @@ try {
<div>
<p>Customer Name: <strong><?php echo $customer['name']; ?></strong></p>
<p>Mobile Number: <strong><?php echo $customer['mobile']; ?></strong></p>
<p>Installment Start Date: <strong><?php echo $bookingDate ? htmlspecialchars($bookingDate) : 'N/A'; ?></strong></p>
<p>Installment Start Date: <strong><?php echo $bookingDate ? date('m/d/Y', strtotime($bookingDate)) : 'N/A'; ?></strong></p>
<p>Invoice Id: <strong><?php echo $emiPlans[0]['invoiceId']; ?></strong></p>
</div>
<div>
@@ -93,7 +93,7 @@ try {
<th>Amount</th>
<th>Date</th>
<th>Payment Status</th>
<th>Outstanding</th>
<th>Outstanding</th>
</tr>
</thead>
<tbody>
@@ -102,7 +102,7 @@ try {
<tr id="row-<?= $emi['id']; ?>">
<td><?= $emi['emiNumber']; ?></td>
<td>$<?= number_format($emi['emiAmount'], 2); ?></td>
<td><?= date('d-m-Y', strtotime($emi['emiDate'])); ?></td>
<td><?= date('m/d/Y', strtotime($emi['emiDate'])); ?></td>
<td>
<span id="status-<?= $emi['id']; ?>" class="badge <?= $emi['payStatus'] == 0 ? 'bg-danger' : 'bg-success'; ?>">
<?= $emi['payStatus'] == 0 ? 'Unpaid' : 'Paid'; ?>
@@ -113,4 +113,25 @@ try {
<?php } } ?>
</tbody>
</table>
<h3 class="mb-3">Additional Payment Details</h3>
<table class="table table-striped table-bordered">
<thead class="text-white text-center" style="background-color: #374151;">
<tr>
<th>Amount</th>
<th>Payment Date</th>
<th>Transaction Id</th>
<th>Remarks</th>
</tr>
</thead>
<tbody>
<?php foreach ($emiPlans as $emi) { if($emi['adPaymentAmount'] !== null) { ?>
<tr id="row-<?= $emi['id']; ?>">
<td>$<?= $emi['adPaymentAmount']; ?></td>
<td><?= date('m/d/Y', strtotime($emi['adPaymentDate'])); ?></td>
<td><?= $emi['adPaymentTran']; ?></td>
<td><?= $emi['adPaymentRemarks']; ?></td>
</tr>
<?php } }?>
</tbody>
</table>
</div>

View File

@@ -36,7 +36,7 @@ if ($invoiceInfo['tenure'] > 1) {
<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>
<p style="margin-top: -15px; font-size: 14px;">Invoice Date: <?= date('m/d/Y', strtotime($invoiceInfo['invoiceDate'])) ?></p>
</div>
<div>
<p style="font-size: 14px;"><strong>CLASSBOXES TECHNOLOGY</strong></p>
@@ -90,8 +90,8 @@ if ($invoiceInfo['tenure'] > 1) {
<?php foreach ($emiPlans as $emi): if($emi['emiAmount'] !== null) {?>
<tr>
<td><?= $emi['emiNumber'] ?></td>
<td><?= $emi['emiDate'] ?></td>
<td><?= $emi['payStatus'] == 1 ? $emi['paymentDate'] : 'Unpaid' ?></td>
<td><?= date('m/d/Y', strtotime($emi['emiDate'])) ?></td>
<td><?= $emi['payStatus'] == 1 ? date('m/d/Y', strtotime($emi['paymentDate'])) : 'Unpaid' ?></td>
<td>$<?= number_format($emi['emiAmount'], 2) ?></td>
<td>$<?= number_format($emi['outstanding'], 2) ?></td>
<td>
@@ -121,7 +121,7 @@ if ($invoiceInfo['tenure'] > 1) {
?>
<tr>
<td><?= number_format($emiAdditional['adPaymentAmount'], 2) ?></td>
<td><?= !empty($emiAdditional['adPaymentDate']) ? $emiAdditional['adPaymentDate'] : '-' ?></td>
<td><?= !empty($emiAdditional['adPaymentDate']) ? date('m/d/Y', strtotime($emiAdditional['adPaymentDate'])) : '-' ?></td>
<td><?= !empty($emiAdditional['adPaymentSource']) ? $emiAdditional['adPaymentSource'] : '-' ?></td>
<td><?= !empty($emiAdditional['adPaymentTran']) ? $emiAdditional['adPaymentTran'] : '-' ?></td>
<td><?= !empty($emiAdditional['adPaymentRemarks']) ? $emiAdditional['adPaymentRemarks'] : '-' ?></td>
@@ -143,7 +143,7 @@ if ($invoiceInfo['tenure'] > 1) {
</div>
<script src="/assets/js/html2pdf.bundle.min.js"></script>
<script>
document.getElementById('invoiceGenDate').textContent = new Date().toLocaleDateString('en-GB');
document.getElementById('invoiceGenDate').textContent = new Date().toLocaleDateString('en-US');
function downloadPDF() {
const invoice = document.getElementById("invoice-box");