invoice DataTable Order : ps
This commit is contained in:
parent
0e510d1aa3
commit
76242628f1
@ -373,6 +373,7 @@ public function get_general_invoice_data($f_date = null, $t_date = null)
|
|||||||
$result = $query->join('customers', 'customers.customer_id = invoice.customer_id', 'left')
|
$result = $query->join('customers', 'customers.customer_id = invoice.customer_id', 'left')
|
||||||
->join('invoiceitems', 'invoiceitems.invoice_id = invoice.invoice_id', 'left')
|
->join('invoiceitems', 'invoiceitems.invoice_id = invoice.invoice_id', 'left')
|
||||||
->join('books', 'books.book_id = invoiceitems.product', 'left')
|
->join('books', 'books.book_id = invoiceitems.product', 'left')
|
||||||
|
->orderBy("invoice.invoice_date", "DESC")
|
||||||
->groupBy('invoice.invoice_id') // Assuming invoice_id is the primary key of the invoice table
|
->groupBy('invoice.invoice_id') // Assuming invoice_id is the primary key of the invoice table
|
||||||
->get()
|
->get()
|
||||||
->getResult();
|
->getResult();
|
||||||
|
|||||||
@ -54,6 +54,7 @@
|
|||||||
<table id="scroll-horizontal-datatable_wrapper" class="table w-100 nowrap">
|
<table id="scroll-horizontal-datatable_wrapper" class="table w-100 nowrap">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
<tr>
|
<tr>
|
||||||
|
<th hidden></th>
|
||||||
<th>Order Number</th>
|
<th>Order Number</th>
|
||||||
<th>Invoice Date</th>
|
<th>Invoice Date</th>
|
||||||
<th>Customer Name</th>
|
<th>Customer Name</th>
|
||||||
@ -68,18 +69,13 @@
|
|||||||
$invoice_date = date('d/m/Y', strtotime($row['invoice_date']));
|
$invoice_date = date('d/m/Y', strtotime($row['invoice_date']));
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="preview-pdf" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['invoice_number']; ?></td>
|
<td hidden><?= $row['invoice_date']; ?></td>
|
||||||
<td class="preview-pdf" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $invoice_date; ?></td>
|
<td class="preview-pdf" data-order="<?= $row['invoice_number']; ?>" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['invoice_number']; ?></td>
|
||||||
<td class="preview-pdf" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['customer_name']; ?></td>
|
<td class="preview-pdf" data-order="<?= strtotime($row['invoice_date']); ?>" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $invoice_date; ?></td>
|
||||||
<td class="preview-pdf" id="status-column" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['status']; ?></td>
|
<td class="preview-pdf" data-order="<?= $row['customer_name']; ?>" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['customer_name']; ?></td>
|
||||||
<td class="preview-pdf" data-invoice-id="<?= $row['invoice_id']; ?>"><?= "₹ " . $row['total_amount']; ?></td>
|
<td class="preview-pdf" data-order="<?= $row['status']; ?>;" id="status-column" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['status']; ?></td>
|
||||||
|
<td class="preview-pdf" data-order="<?= $row['total_amount']; ?>" data-invoice-id="<?= $row['invoice_id']; ?>"><?= "₹ " . $row['total_amount']; ?></td>
|
||||||
<td>
|
<td>
|
||||||
<?php if ($row['invoice_type'] == 2) : ?>
|
|
||||||
<a href="<?= base_url() . "new_subscription_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Subscription"></i></a>
|
|
||||||
<?php elseif ($row['invoice_type'] == 1) : ?>
|
|
||||||
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<a href="<?= base_url("generate_invoice_pdf/{$row['invoice_id']}") ?>" class="download-pdf-button" title="Download the Invoice"><i class="ri-file-download-line"></i></a>
|
<a href="<?= base_url("generate_invoice_pdf/{$row['invoice_id']}") ?>" class="download-pdf-button" title="Download the Invoice"><i class="ri-file-download-line"></i></a>
|
||||||
<a href="<?= base_url("print_address/{$row['invoice_id']}") ?>" class="print-address-button" title="Print Address"><i class="ri-printer-line"></i></a>
|
<a href="<?= base_url("print_address/{$row['invoice_id']}") ?>" class="print-address-button" title="Print Address"><i class="ri-printer-line"></i></a>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
<style>
|
<style>
|
||||||
<style>
|
|
||||||
/* CSS for modal content */
|
/* CSS for modal content */
|
||||||
#pdfPreviewModal .modal-dialog {
|
#pdfPreviewModal .modal-dialog {
|
||||||
max-width: 210mm; /* A5 width */
|
max-width: 210mm; /* A5 width */
|
||||||
@ -104,34 +103,20 @@
|
|||||||
<?php foreach ($invoice as $row) :
|
<?php foreach ($invoice as $row) :
|
||||||
if ($row['invoice_type'] == 1) : // Check if it's a subscription invoice
|
if ($row['invoice_type'] == 1) : // Check if it's a subscription invoice
|
||||||
$invoice_date = date('d/m/Y', strtotime($row['invoice_date']));
|
$invoice_date = date('d/m/Y', strtotime($row['invoice_date']));
|
||||||
?>
|
if (empty($row['order_number'])) : // Check if order_number is empty ?>
|
||||||
<?php if (empty($row['order_number'])) : // Check if order_number is empty ?>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td hidden><?= $row['invoice_id']; ?></td>
|
<td hidden><?= $row['invoice_date']; ?></td>
|
||||||
<td class="preview-pdf" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['invoice_number']; ?></td>
|
<td class="preview-pdf" data-order="<?= $row['invoice_number']; ?>" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['invoice_number']; ?></td>
|
||||||
<td class="preview-pdf" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $invoice_date; ?></td>
|
<td class="preview-pdf" data-order="<?= strtotime($row['invoice_date']); ?>" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $invoice_date; ?></td>
|
||||||
<td class="preview-pdf" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['customer_name']; ?></td>
|
<td class="preview-pdf" data-order="<?= $row['customer_name']; ?>" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['customer_name']; ?></td>
|
||||||
<td class="preview-pdf" id="status-column" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['status']; ?></td>
|
<td class="preview-pdf" data-order="<?= $row['status']; ?>;" id="status-column" data-invoice-id="<?= $row['invoice_id']; ?>"><?= $row['status']; ?></td>
|
||||||
<td class="preview-pdf" data-invoice-id="<?= $row['invoice_id']; ?>"><?= "₹ ".$row['total_amount']; ?></td>
|
<td class="preview-pdf" data-order="<?= $row['total_amount']; ?>" data-invoice-id="<?= $row['invoice_id']; ?>"><?= "₹ " . $row['total_amount']; ?></td>
|
||||||
<!-- Add a class to each td -->
|
|
||||||
<!-- <td class="preview-pdf" data-invoice-id="<?= $row['invoice_id']; ?>">Preview</td> -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<!-- <a href="<?= base_url() . "approve_invoice/" . $row['invoice_id']; ?>" class="approve-button" title="Approve the Invoice"><i class="ri-checkbox-circle-fill"></i></a> -->
|
|
||||||
<?php if ($row['invoice_type'] == 2) : ?>
|
|
||||||
<a href="<?= base_url() . "new_subscription_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Subscription"></i></a>
|
|
||||||
<?php elseif ($row['invoice_type'] == 1) : ?>
|
|
||||||
<a href="<?= base_url() . "new_book_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<a href="<?= base_url("generate_invoice_pdf/{$row['invoice_id']}") ?>" class="download-pdf-button" title="Download the Invoice"><i class="ri-file-download-line"></i></a>
|
<a href="<?= base_url("generate_invoice_pdf/{$row['invoice_id']}") ?>" class="download-pdf-button" title="Download the Invoice"><i class="ri-file-download-line"></i></a>
|
||||||
<a href="<?= base_url("print_address/{$row['invoice_id']}") ?>" class="print-address-button" title="Print Address"><i class="ri-printer-line"></i></a>
|
<a href="<?= base_url("print_address/{$row['invoice_id']}") ?>" class="print-address-button" title="Print Address"><i class="ri-printer-line"></i></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif; ?>
|
<?php endif; endif; endforeach; ?>
|
||||||
<?php endif; endforeach; ?>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user