CHNAGE_DASHBOARD_AND_SALES_VIEW_FIX

This commit is contained in:
aadhavan valli 2024-08-21 10:14:49 +05:30
parent 6ab523fc28
commit 40827e73da
3 changed files with 126 additions and 113 deletions

View File

@ -15,7 +15,6 @@ if(!empty($EmpCount))
?>
<div class="content-wrapper">
<section class="content">
<!-- Dashboard for Account department-->
@ -623,12 +622,18 @@ $('#datepick').change(function() {
</div>
</div>
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>Admin Dashboard</h1>
</section>
<!-- <section class="content-header"> -->
<!-- <h3>Admin Dashboard</h3> -->
<div class="row">
<div class="col-xs-12 col-md-4 col-md-offset-4" style="height: 75px;">
<a href="javascript:void(0)" type="button" class="btn btn-success" onclick="synczohobooks()">Sync With Zoho Books</a>
</div>
</div>
<!-- </section> -->
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-xl-3 col-md-6">
<div class="card">
<div class="card-body">
@ -644,7 +649,9 @@ $('#datepick').change(function() {
</div>
<div class="avatar-sm">
<span class="avatar-title bg-soft-primary rounded">
<i class="ri-arrow-right-left-line font-20 text-primary"> <a href="<?php echo base_url(); ?>userListing" class="small-box-footer"></a></i>
<i class="fe-arrow-right" style="color:black;">
<a href="<?php echo base_url(); ?>userListing"></a>
</i>
</span>
</div>
@ -652,13 +659,11 @@ $('#datepick').change(function() {
</div>
</div>
</div><!-- end col -->
</div>
<div class="row">
<!-- </div>
<div class="row"> -->
<!-- <div class="col-xs-12 col-md-4 col-md-offset-4">
</div> -->
<div class="col-xs-12 col-md-4 col-md-offset-4">
<a href="javascript:void(0)" type="button" class="btn btn-success" onclick="synczohobooks()">Sync With Zoho Books</a>
</div>
</div>
</section>

View File

@ -98,63 +98,70 @@
</div>
</div>
<!-- <div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title">Invoices Table</h4>
</div>
</div>
</div> -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title">Invoices Table</h4>
</div>
</div>
</div>
<table id="datatable-buttonss" class="table dt-responsive nowrap w-100">
<thead>
<tr>
<th>Invoice No.</th>
<th>Invoice Date</th>
<th>Invoice Time</th>
<th>Vehicle No.</th>
<th>Product</th>
<th>Client</th>
<th>Quantity</th>
<th>Rate</th>
<th>Value</th>
<th>CGST</th>
<th>SGST</th>
<th>IGST</th>
<th>TCS</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<?php foreach ($get_today_invoices as $invoice) : ?>
<tr>
<td><?php echo $invoice['Invoice No.']; ?></td>
<td><?php echo $invoice['Invoice Date']; ?></td>
<td><?php echo $invoice['Invoice Time']; ?></td>
<td><?php echo $invoice['Vehicle No.']; ?></td>
<td><?php echo $invoice['Product']; ?></td>
<td><?php echo $invoice['Client']; ?></td>
<td><?php echo $invoice['Quantity']; ?></td>
<td><?php echo $invoice['Rate']; ?></td>
<td><?php echo $invoice['Value']; ?></td>
<td><?php echo $invoice['CGST']; ?></td>
<td><?php echo $invoice['SGST']; ?></td>
<td><?php echo $invoice['IGST']; ?></td>
<td><?php echo $invoice['TCS']; ?></td>
<td><?php echo $invoice['Total']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="col-12">
<div class="card">
<div class="card-body">
<!-- <div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title">Invoices Table</h4>
</div>
</div>
</div> -->
<table id="datatable-buttonss" class="table dt-responsive nowrap w-100">
<thead>
<tr>
<th>Invoice No.</th>
<th>Invoice Date</th>
<th>Invoice Time</th>
<th>Vehicle No.</th>
<th>Product</th>
<th>Client</th>
<th>Quantity</th>
<th>Rate</th>
<th>Value</th>
<th>CGST</th>
<th>SGST</th>
<th>IGST</th>
<th>TCS</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<?php foreach ($get_today_invoices as $invoice) : ?>
<tr>
<td><?php echo $invoice['Invoice No.']; ?></td>
<td><?php echo $invoice['Invoice Date']; ?></td>
<td><?php echo $invoice['Invoice Time']; ?></td>
<td><?php echo $invoice['Vehicle No.']; ?></td>
<td><?php echo $invoice['Product']; ?></td>
<td><?php echo $invoice['Client']; ?></td>
<td><?php echo $invoice['Quantity']; ?></td>
<td><?php echo $invoice['Rate']; ?></td>
<td><?php echo $invoice['Value']; ?></td>
<td><?php echo $invoice['CGST']; ?></td>
<td><?php echo $invoice['SGST']; ?></td>
<td><?php echo $invoice['IGST']; ?></td>
<td><?php echo $invoice['TCS']; ?></td>
<td><?php echo $invoice['Total']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div>
<!-- end row -->
<!-- end page title -->
</div> <!-- container -->

View File

@ -43,18 +43,20 @@
<!-- start page title -->
<div>
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title">Invoices Table</h4>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title">Invoices Table</h4>
</div>
</div>
</div>
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100">
<table id="datatable-buttosns" class="table dt-responsive nowrap w-100">
<thead>
<tr>
<th >Invoice Date</th>
@ -72,43 +74,42 @@
</tr>
</thead>
<tbody>
<input type="text" id="invoice_id_set" name="invoice_id_set" hidden>
<?php if(!empty($sales_invoice)){ foreach($sales_invoice as $invoice){
<input type="text" id="invoice_id_set" name="invoice_id_set" hidden>
<?php if(!empty($sales_invoice)){ foreach($sales_invoice as $invoice){
$subtotal = $invoice->item_price * $invoice->item_quantity;
// Calculate CGST and SGST
$cgst_amount = ($subtotal * $invoice->cgst) / 100;
$sgst_amount = ($subtotal * $invoice->sgst) / 100;
$total = $subtotal + $cgst_amount + $sgst_amount;?>
<!-- Main invoice row -->
<tr class="parent-row">
<td style="text-align: center;"><?php echo date('d-m-Y', strtotime($invoice->invoice_date_created)); ?></td>
<td style="text-align: left;">
<?php if(!empty($invoice->invoice_url)){ ?>
<a href="<?php echo $invoice->invoice_url; ?>" target="_blank" class="invoice-link">
<?php } ?>
<?php echo $invoice->invoice_number; ?>
<?php if(!empty($invoice->invoice_url)){ ?>
</a>
<?php } ?>
</td>
<td style="text-align: left;"><?php echo $invoice->client_name ?></td>
<td style="text-align: left;"><?php echo $invoice->item_name ?></td>
<td style="text-align: center;"><?php echo $invoice->item_price ?></td>
<td style="text-align: center;"><?php echo number_format($invoice->item_quantity, 2 ,'.', ',' ) ?></td>
<td style="text-align: center;"><?php echo number_format($subtotal, 2, '.', ',') ?></td>
<td style="text-align: center;"><?php echo number_format($cgst_amount+$sgst_amount, 2, '.', ',') ?></td>
<td style="text-align: center;"><?php echo number_format($total, 2, '.', ',') ?></td>
<td style="text-align: center;"><?php echo $invoice->status ?></td>
<td style="text-align: center;"><?php echo $invoice->e_invoice_number; ?></td>
<td style="text-align: center;">
<a class="edit-button" style="cursor: pointer; display: inline-block;" title="Files Upload" onclick="openInvoiceModal('<?php echo $invoice->invoice_number; ?>', '<?php echo $invoice->client_name; ?>', '<?php echo $invoice->invoice_date_created; ?>', '<?php echo $invoice->invoice_id; ?>')">
<i class="fas fa-file-upload text-muted" style="font-size: 18px; vertical-align: middle;"></i>
</a>
</td>
</tr>
<?php } } ?>
$subtotal = $invoice->item_price * $invoice->item_quantity;
// Calculate CGST and SGST
$cgst_amount = ($subtotal * $invoice->cgst) / 100;
$sgst_amount = ($subtotal * $invoice->sgst) / 100;
$total = $subtotal + $cgst_amount + $sgst_amount;?>
<!-- Main invoice row -->
<tr >
<td ><?php echo date('d-m-Y', strtotime($invoice->invoice_date_created)); ?></td>
<td >
<?php if(!empty($invoice->invoice_url)){ ?>
<a href="<?php echo $invoice->invoice_url; ?>" target="_blank" class="invoice-link">
<?php } ?>
<?php echo $invoice->invoice_number; ?>
<?php if(!empty($invoice->invoice_url)){ ?>
</a>
<?php } ?>
</td>
<td ><?php echo $invoice->client_name ?></td>
<td ><?php echo $invoice->item_name ?></td>
<td ><?php echo $invoice->item_price ?></td>
<td ><?php echo number_format($invoice->item_quantity, 2 ,'.', ',' ) ?></td>
<td ><?php echo number_format($subtotal, 2, '.', ',') ?></td>
<td ><?php echo number_format($cgst_amount+$sgst_amount, 2, '.', ',') ?></td>
<td ><?php echo number_format($total, 2, '.', ',') ?></td>
<td ><?php echo $invoice->status ?></td>
<td ><?php echo $invoice->e_invoice_number; ?></td>
<td >
<a class="edit-button" style="cursor: pointer; display: inline-block;" title="Files Upload" onclick="openInvoiceModal('<?php echo $invoice->invoice_number; ?>', '<?php echo $invoice->client_name; ?>', '<?php echo $invoice->invoice_date_created; ?>', '<?php echo $invoice->invoice_id; ?>')">
<i class="fas fa-file-upload text-muted" style="font-size: 18px; vertical-align: middle;"></i>
</a>
</td>
</tr>
<?php } } ?>
</tbody>
</table>
@ -122,9 +123,8 @@
</div>
<script>
$('#datatable-buttons').DataTable({
<script>$(document).ready(function() {
$('#datatable-buttosns').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
@ -140,6 +140,7 @@ $('#datatable-buttons').DataTable({
}
}
});
});
</script>
</script>