This commit is contained in:
Suvodip
2025-03-08 17:01:20 +05:30
parent e97d30ce72
commit b813a79fe8
7 changed files with 229 additions and 126 deletions

View File

@@ -43,8 +43,8 @@ if ($invoiceInfo['tenure'] > 1) {
<th>Description</th>
<th>Qty</th>
<th>Rate</th>
<th>Tax(%)</th>
<th>Tax</th>
<th>Discount(%)</th>
<th>Discount</th>
<th>Total</th>
</tr>
</thead>
@@ -54,8 +54,8 @@ if ($invoiceInfo['tenure'] > 1) {
<td><?= $invoiceInfo['description'] ?></td>
<td><?= $invoiceInfo['qty'] ?></td>
<td><?= $invoiceInfo['rate'] ?></td>
<td><?= $invoiceInfo['tax'] ?>%</td>
<td>$<?= $invoiceInfo['taxAmount'] ?></td>
<td><?= $invoiceInfo['discount'] ?>%</td>
<td>$<?= $invoiceInfo['discountAmount'] ?></td>
<td>$<?= number_format($invoiceInfo['totalAmount'], 2) ?></td>
</tr>
</tbody>
@@ -63,7 +63,7 @@ if ($invoiceInfo['tenure'] > 1) {
<!-- EMI Table (if tenure > 1) -->
<?php if ($invoiceInfo['tenure'] > 1): ?>
<h4 class="mt-4 text-blue">EMI Payment Plan</h4>
<h5 class="mt-4 text-blue">EMI Payment Plan</h5>
<table class="table table-striped">
<thead>
<tr>
@@ -75,7 +75,7 @@ if ($invoiceInfo['tenure'] > 1) {
</tr>
</thead>
<tbody>
<?php foreach ($emiPlans as $emi): ?>
<?php foreach ($emiPlans as $emi): if($emi['emiAmount'] !== null) {?>
<tr>
<td><?= $emi['emiNumber'] ?></td>
<td><?= $emi['emiDate'] ?></td>
@@ -85,18 +85,49 @@ if ($invoiceInfo['tenure'] > 1) {
<?= ($emi['payStatus'] == 1) ? '<span class="badge bg-success">Paid</span>' : '<span class="badge bg-danger">Pending</span>' ?>
</td>
</tr>
<?php endforeach; ?>
<?php } endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<h5 class="mt-4 text-blue">Additional Payment Details:</h5>
<table class="table table-striped " style="font-size: 12px;">
<thead class="">
<tr>
<th>Payment Amount</th>
<th>Payment Date</th>
<th>Payment Source</th>
<th>Transaction ID</th>
<th>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>
<p class="text-muted mt-3"><strong>Admin Note:</strong> <?= $invoiceInfo['adminNote'] ?></p>
<!-- Print Button -->
<p style="font-size: 12px;"><strong>Invoice Generate Date: </strong><span id="invoiceGenDate"></span></p>
<button onclick="window.print()" class="btn btn-primary btn-print w-100">Print Invoice</button>
</div>
</div>
<script>
document.getElementById('invoiceGenDate').textContent = new Date().toLocaleDateString('en-GB');
</script>
<style>
body {
background-color: #f8f9fa;