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

View File

@ -88,7 +88,7 @@ try {
<tr class="text-center"> <tr class="text-center">
<td><?php echo htmlspecialchars($emi['name']); ?></td> <td><?php echo htmlspecialchars($emi['name']); ?></td>
<td>$<?php echo number_format($emi['emiAmount'], 2); ?></td> <td>$<?php echo number_format($emi['emiAmount'], 2); ?></td>
<td><?php echo date('d M Y', strtotime($emi['emiDate'])); ?></td> <td><?php echo date('m/d/Y', strtotime($emi['emiDate'])); ?></td>
<td> <td>
<?php if ($emi['payStatus'] == 0) : ?> <?php if ($emi['payStatus'] == 0) : ?>
<span class="badge bg-danger">Pending</span> <span class="badge bg-danger">Pending</span>

View File

@ -169,7 +169,7 @@
<div> <div>
<p>Customer Name: <strong><?php echo $customer['name']; ?></strong></p> <p>Customer Name: <strong><?php echo $customer['name']; ?></strong></p>
<p>Mobile Number: <strong><?php echo $customer['mobile']; ?></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> <p>Invoice Id: <strong><?php echo $emiPlans[0]['invoiceId']; ?></strong></p>
<p>Email: <strong><?php echo $customer['email']; ?></strong></p> <p>Email: <strong><?php echo $customer['email']; ?></strong></p>
</div> </div>
@ -200,10 +200,10 @@
<tr id="row-<?= $emi['id']; ?>"> <tr id="row-<?= $emi['id']; ?>">
<td><?= $emi['emiNumber']; ?></td> <td><?= $emi['emiNumber']; ?></td>
<td>$<?= number_format($emi['emiAmount'], 2); ?></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> <td>
<?php if (!empty($emi['paymentDate'])) { ?> <?php if (!empty($emi['paymentDate'])) { ?>
<?= date('d-m-Y', strtotime($emi['paymentDate'])); ?> <?= date("m/d/Y", strtotime($emi['paymentDate'])); ?>
<?php } else { ?> <?php } else { ?>
<input value="<?= date('Y-m-d', strtotime($emi['emiDate'])); ?>" id="paymentDateId" class="form-control" type="date" /> <input value="<?= date('Y-m-d', strtotime($emi['emiDate'])); ?>" id="paymentDateId" class="form-control" type="date" />
<?php } ?> <?php } ?>
@ -237,7 +237,7 @@
<?php foreach ($emiPlans as $emi) { if($emi['adPaymentAmount'] !== null) { ?> <?php foreach ($emiPlans as $emi) { if($emi['adPaymentAmount'] !== null) { ?>
<tr id="row-<?= $emi['id']; ?>"> <tr id="row-<?= $emi['id']; ?>">
<td>$<?= $emi['adPaymentAmount']; ?></td> <td>$<?= $emi['adPaymentAmount']; ?></td>
<td><?= $emi['adPaymentDate']; ?></td> <td><?= date("m/d/Y", strtotime($emi['adPaymentDate'])); ?></td>
<td><?= $emi['adPaymentTran']; ?></td> <td><?= $emi['adPaymentTran']; ?></td>
<td><?= $emi['adPaymentRemarks']; ?></td> <td><?= $emi['adPaymentRemarks']; ?></td>
</tr> </tr>

View File

@ -57,8 +57,8 @@
<th>Start Date</th> <th>Start Date</th>
<th>End Date</th> <th>End Date</th>
<th>Installments</th> <th>Installments</th>
<th>Monthly Payment Date</th> <th>Payment Date</th>
<th>Monthly Payment Amount</th> <th>Installment Amount</th>
<th>Total Amount</th> <th>Total Amount</th>
<th>Action</th> <th>Action</th>
</tr> </tr>
@ -118,22 +118,22 @@
<?php echo htmlspecialchars($customer['name']); ?> <?php echo htmlspecialchars($customer['name']); ?>
</a> </a>
</td> </td>
<td><?php echo isset($emi['bookingDate']) ? date('d-m-Y', strtotime($emi['bookingDate'])) : 'N/A'; ?></td> <td><?php echo isset($emi['bookingDate']) ? date("m/d/Y", strtotime($emi['bookingDate'])) : 'N/A'; ?></td>
<td><?php echo isset($emi['bookingDate']) ? (new DateTime($emi['bookingDate']))->modify('+'.$emi['tenure']-'1'.'months')->format('d-m-Y') : 'N/A'; ?></td> <td><?php echo isset($emi['bookingDate']) ? (new DateTime($emi['bookingDate']))->modify('+'.$emi['tenure']-'1'.'months')->format("m/d/Y") : 'N/A'; ?></td>
<td><?php echo isset($emi['tenure']) ? htmlspecialchars($emi['tenure']) : 'N/A'; ?></td> <td><?php echo isset($emi['tenure']) ? htmlspecialchars($emi['tenure']) : 'N/A'; ?></td>
<td><?php echo isset($emi['bookingDate']) ? date('d', strtotime($emi['bookingDate'])) .' Each Month': 'N/A'; ?></td> <td><?php echo isset($emi['bookingDate']) ? date('d', strtotime($emi['bookingDate'])) .' Each Month': 'N/A'; ?></td>
<td>$<?php echo isset($emi['emiAmount']) ? htmlspecialchars($emi['emiAmount']) : '0.00'; ?></td> <td>$<?php echo isset($emi['emiAmount']) ? htmlspecialchars($emi['emiAmount']) : '0.00'; ?></td>
<td>$<?php echo isset($emi['totalAmount']) ? htmlspecialchars($emi['totalAmount']) : '0.00'; ?></td> <td>$<?php echo isset($emi['totalAmount']) ? htmlspecialchars($emi['totalAmount']) : '0.00'; ?></td>
<td class="d-flex gap-1"> <td class="d-flex gap-1">
<a href="/customers/generate-invoice/?customerId=<?php echo $customer['customerId']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;">New</a> <a href="/customers/generate-invoice/?customerId=<?php echo $customer['customerId']; ?>" class="btn btn-sm text-white" style="font-size: 11px; background-color: #374151;">New</a>
<a href="/customers/edit-invoice/?customerId=<?php echo $customer['customerId'].'&invoiceId='.$invoice['invoiceId']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;">Edit</a> <a href="/customers/edit-invoice/?customerId=<?php echo $customer['customerId'].'&invoiceId='.$invoice['invoiceId']; ?>" class="btn btn-sm text-white" style="font-size: 11px; background-color: #374151;">Edit</a>
<a href="/customers/print-invoice/?customerId=<?php echo $customer['customerId'].'&invoiceId='.$invoice['invoiceId']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;" target="_blank">Print</a> <a href="/customers/print-invoice/?customerId=<?php echo $customer['customerId'].'&invoiceId='.$invoice['invoiceId']; ?>" class="btn btn-sm text-white" style="font-size: 11px; background-color: #374151;" target="_blank">Print</a>
<a href="/customers/change-password/?customerId=<?php echo $customer['customerId'].'&userName='.$customer['name']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;">Password</a> <a href="/customers/change-password/?customerId=<?php echo $customer['customerId'].'&userName='.$customer['name']; ?>" class="btn btn-sm text-white" style="font-size: 11px; background-color: #374151;">Password</a>
<form method="post"> <form method="post">
<input type="hidden" name="customerId" value="<?php echo htmlspecialchars($customer['customerId']); ?>" /> <input type="hidden" name="customerId" value="<?php echo htmlspecialchars($customer['customerId']); ?>" />
<input type="hidden" name="invoiceId" value="<?php echo htmlspecialchars($invoice['invoiceId']); ?>" /> <input type="hidden" name="invoiceId" value="<?php echo htmlspecialchars($invoice['invoiceId']); ?>" />
<button type="submit" name="delete" class="btn btn-danger btn-sm" style="font-size: 13px;">Delete</button> <button type="submit" name="delete" class="btn btn-danger btn-sm" style="font-size: 11px;">Delete</button>
</form> </form>
</td> </td>
</tr> </tr>
@ -147,12 +147,12 @@
<td class="fw-bold"><?php echo htmlspecialchars($customer['name']); ?></td> <td class="fw-bold"><?php echo htmlspecialchars($customer['name']); ?></td>
<td colspan="6" class="text-center">No EMI or Invoice Data</td> <td colspan="6" class="text-center">No EMI or Invoice Data</td>
<td class="d-flex gap-1"> <td class="d-flex gap-1">
<a href="/customers/generate-invoice/?customerId=<?php echo $customer['customerId']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;">New</a> <a href="/customers/generate-invoice/?customerId=<?php echo $customer['customerId']; ?>" class="btn btn-sm text-white" style="font-size: 11px; background-color: #374151;">New</a>
<a href="/customers/change-password/?customerId=<?php echo $customer['customerId'].'&userName='.$customer['name']; ?>" class="btn btn-sm text-white" style="font-size: 13px; background-color: #374151;">Password</a> <a href="/customers/change-password/?customerId=<?php echo $customer['customerId'].'&userName='.$customer['name']; ?>" class="btn btn-sm text-white" style="font-size: 11px; background-color: #374151;">Password</a>
<form method="post"> <form method="post">
<input type="hidden" name="customerId" value="<?php echo htmlspecialchars($customer['customerId']); ?>" /> <input type="hidden" name="customerId" value="<?php echo htmlspecialchars($customer['customerId']); ?>" />
<input type="hidden" name="invoiceId" value="<?php echo htmlspecialchars($invoice['invoiceId']); ?>" /> <input type="hidden" name="invoiceId" value="<?php echo htmlspecialchars($invoice['invoiceId']); ?>" />
<button type="submit" name="delete" class="btn btn-danger btn-sm" style="font-size: 13px;">Delete</button> <button type="submit" name="delete" class="btn btn-danger btn-sm" style="font-size: 11px;">Delete</button>
</form> </form>
</td> </td>
</tr> </tr>

View File

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

View File

@ -57,8 +57,8 @@
<!-- Invoice Data --> <!-- Invoice Data -->
<td><?php echo htmlspecialchars($invoice['invoiceId']); ?></td> <td><?php echo htmlspecialchars($invoice['invoiceId']); ?></td>
<td><?php echo htmlspecialchars($invoice['invoiceDate']); ?></td> <td><?php echo date('m/d/Y', strtotime($invoice['invoiceDate'])); ?></td>
<td><?php echo htmlspecialchars($invoice['totalAmount']); ?></td> <td>&#36;<?php echo htmlspecialchars($invoice['totalAmount']); ?></td>
<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> <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> <div>
<p>Customer Name: <strong><?php echo $customer['name']; ?></strong></p> <p>Customer Name: <strong><?php echo $customer['name']; ?></strong></p>
<p>Mobile Number: <strong><?php echo $customer['mobile']; ?></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> <p>Invoice Id: <strong><?php echo $emiPlans[0]['invoiceId']; ?></strong></p>
</div> </div>
<div> <div>
@ -93,7 +93,7 @@ try {
<th>Amount</th> <th>Amount</th>
<th>Date</th> <th>Date</th>
<th>Payment Status</th> <th>Payment Status</th>
<th>Outstanding</th> <th>Outstanding</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -102,7 +102,7 @@ try {
<tr id="row-<?= $emi['id']; ?>"> <tr id="row-<?= $emi['id']; ?>">
<td><?= $emi['emiNumber']; ?></td> <td><?= $emi['emiNumber']; ?></td>
<td>$<?= number_format($emi['emiAmount'], 2); ?></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> <td>
<span id="status-<?= $emi['id']; ?>" class="badge <?= $emi['payStatus'] == 0 ? 'bg-danger' : 'bg-success'; ?>"> <span id="status-<?= $emi['id']; ?>" class="badge <?= $emi['payStatus'] == 0 ? 'bg-danger' : 'bg-success'; ?>">
<?= $emi['payStatus'] == 0 ? 'Unpaid' : 'Paid'; ?> <?= $emi['payStatus'] == 0 ? 'Unpaid' : 'Paid'; ?>
@ -113,4 +113,25 @@ try {
<?php } } ?> <?php } } ?>
</tbody> </tbody>
</table> </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> </div>

View File

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