Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
cd0c6437cc
@ -24,16 +24,43 @@ class Sales extends BaseController
|
||||
$this->isLoggedIn();
|
||||
}
|
||||
|
||||
function formatIndianCurrency($amount) {
|
||||
// Convert the amount to a string with 2 decimal places
|
||||
$formattedAmount = number_format((float)$amount, 2, '.', '');
|
||||
|
||||
// Split the integer and decimal parts
|
||||
$parts = explode('.', $formattedAmount);
|
||||
$integerPart = $parts[0];
|
||||
$decimalPart = isset($parts[1]) ? $parts[1] : '00';
|
||||
|
||||
// Format the integer part for Indian numbering system
|
||||
if (strlen($integerPart) > 3) {
|
||||
$lastThreeDigits = substr($integerPart, -3); // Get the last 3 digits (thousands)
|
||||
$remainingDigits = substr($integerPart, 0, -3); // Get the remaining digits
|
||||
|
||||
// Add commas to the remaining digits in groups of 2
|
||||
$remainingDigits = preg_replace('/\B(?=(\d{2})+(?!\d))/', ',', $remainingDigits);
|
||||
|
||||
// Combine the formatted parts
|
||||
$integerPart = $remainingDigits . ',' . $lastThreeDigits;
|
||||
}
|
||||
|
||||
// Combine the integer and decimal parts
|
||||
return $integerPart . '.' . $decimalPart;
|
||||
}
|
||||
public function sales_dashboard()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Sales Dashboard';
|
||||
$data = [];
|
||||
$data['today_sales'] = $this->ipinvoice_model->todaySales();
|
||||
$data['today_sales']->Sales = $this->formatIndianCurrency($data['today_sales']->Sales, 2, '.', ',');
|
||||
$data['this_month_sales'] = $this->ipinvoice_model->thisMonthSales();
|
||||
$data['this_month_sales']->Sales = $this->formatIndianCurrency($data['this_month_sales']->Sales);
|
||||
$data['this_year_sales'] = $this->ipinvoice_model->thisYearSales();
|
||||
$data['this_year_sales']->Sales = $this->formatIndianCurrency($data['this_year_sales']->Sales, 2, '.', ',');
|
||||
$data['this_year_sales_trend'] = $this->ipinvoice_model->thisYearSalesTrend();
|
||||
$data['get_today_invoices'] = $this->ipinvoice_model->getTodayInvoices();
|
||||
// dd($data);
|
||||
|
||||
// Define months from April to March
|
||||
$months = ['Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar'];
|
||||
|
||||
|
||||
@ -131,8 +131,8 @@
|
||||
|
||||
<div class="error" id="error"></div>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
<table id="po_list" class="table dt-responsive wrap w-100">
|
||||
<div class="card-body" style="overflow-x:scroll;">
|
||||
<table id="po_list" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Created Date</th>
|
||||
@ -255,23 +255,13 @@
|
||||
</div> <!-- container -->
|
||||
</div> <!-- content -->
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
<script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.3.4/js/dataTables.buttons.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.3.4/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.3.4/js/buttons.print.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
|
||||
<script src="https://cdn.datatables.net/plug-ins/1.13.6/sorting/datetime-moment.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(document).on('click', '.text-truncate', function() {
|
||||
$(this).toggleClass('expanded');
|
||||
});
|
||||
|
||||
|
||||
// Initialize the DataTable
|
||||
var table = $('#po_list').DataTable({
|
||||
@ -284,13 +274,8 @@
|
||||
[10, 20, 30, 50, -1],
|
||||
[10, 20, 30, 50, "All"]
|
||||
], // Rows per page options
|
||||
responsive: true, // Responsive table
|
||||
order: [], // Default ordering (column index 0, descending)
|
||||
columnDefs: [{
|
||||
targets: '_all',
|
||||
className: 'text-truncate'
|
||||
}, // Apply truncation to all columns
|
||||
],
|
||||
responsive: false, // Responsive table
|
||||
ordering: false,
|
||||
language: {
|
||||
paginate: {
|
||||
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
|
||||
@ -465,23 +465,7 @@
|
||||
}
|
||||
</style>
|
||||
<!-- loader css code end -->
|
||||
<script>
|
||||
// window.addEventListener('load', function() {
|
||||
// document.body.classList.add('loaded');
|
||||
// });
|
||||
$(window).on('load', function() {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').fadeOut('slow');
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
// $('.loader').fadeIn();
|
||||
// $('.loader-mask').fadeIn();
|
||||
|
||||
// $('.loader').fadeOut();
|
||||
// $('.loader-mask').delay(350).fadeOut('slow');
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
@ -609,7 +593,9 @@
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="topnav-hr">
|
||||
<a href="<?php echo base_url(); ?>sales_invoice" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>Invoice</a>
|
||||
<?php if(session()->get('roleText') != 'Auditor'){?>
|
||||
<a href="<?php echo base_url(); ?>dashboard" class="dropdown-item"><i class="ri-refresh-line align-middle mr-1"></i>Sync With Zoho Books</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@ -621,6 +607,7 @@
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="topnav-purchase">
|
||||
|
||||
<?php if(session()->get('roleText') != 'Auditor'){?>
|
||||
<div class="dropdown">
|
||||
<a class="dropdown-item dropdown-toggle arrow-none" href="#" id="topnav-requisition"
|
||||
role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
@ -631,6 +618,8 @@
|
||||
<a href="<?php echo base_url(); ?>CreatePO" class="dropdown-item">Purchase Order From Requisition</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="dropdown">
|
||||
<a class="dropdown-item dropdown-toggle arrow-none" href="#" id="topnav-po"
|
||||
role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
@ -639,8 +628,10 @@
|
||||
<div class="dropdown-menu" aria-labelledby="topnav-po">
|
||||
<a href="<?php echo base_url(); ?>purchaseorderListing" class="dropdown-item">Purchase Order List</a>
|
||||
<a href="<?php echo base_url(); ?>PORelease" class="dropdown-item">Approve Purchase Order</a>
|
||||
<?php if(session()->get('roleText') != 'Auditor'){?>
|
||||
<a href="<?php echo base_url(); ?>EmergencyPO" class="dropdown-item">Emergency Purchase Order </a>
|
||||
<a href="<?php echo base_url(); ?>Report_pending_purchase" class="dropdown-item">Pending Purchase Order </a>
|
||||
<?php } ?>
|
||||
<a href="<?php echo base_url(); ?>amendmentpurchaseorder" class="dropdown-item">Amendment Purchase Order</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -658,16 +649,16 @@
|
||||
<div class="dropdown-menu" aria-labelledby="topnav-purchase">
|
||||
|
||||
|
||||
|
||||
<?php if(session()->get('roleText') != 'Auditor'){?>
|
||||
<div class="">
|
||||
<a href="<?php echo base_url(); ?>AddIGR" class="dropdown-item"><i class="ri-task-line align-middle mr-1"></i>
|
||||
Inward Gate Register Entry</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="">
|
||||
|
||||
<a href="<?php echo base_url(); ?>ViewIGR" class="dropdown-item"><i class="ri-eye-fill mr-1"></i>
|
||||
View Inward Gate Register</a>
|
||||
|
||||
</div>
|
||||
<div class="">
|
||||
<a href="<?php echo base_url(); ?>ListIGR" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>
|
||||
@ -719,7 +710,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<?php if(session()->get('roleText') != 'Auditor'){?>
|
||||
<!-- supplier module -->
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle arrow-none" href="<?php echo base_url(); ?>supplierlisting" role="button" aria-expanded="false">
|
||||
@ -735,7 +726,7 @@
|
||||
</li>
|
||||
|
||||
<!-- master detail module -->
|
||||
<li class="nav-item dropdown">
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-others" role="button"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="ri-list-settings-line align-middle mr-1"></i> Master Details <div class="arrow-down"></div>
|
||||
@ -756,8 +747,8 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<!-- Stock module -->
|
||||
<li class="nav-item dropdown">
|
||||
<!-- Stock module -->
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-stock" role="button"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="ri-shopping-bag-line"></i> Stock <div class="arrow-down"></div>
|
||||
@ -783,6 +774,7 @@
|
||||
<i class="ri-keyboard-line mr-1"></i> Report Lists
|
||||
</a>
|
||||
</li> -->
|
||||
<?php }?>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
<div class="text-left">
|
||||
<p class="text-muted mb-0">Sales in Rs.</p>
|
||||
<h4 class="mb-1 mt-0">
|
||||
<span data-plugin="counterup" class="card_font_colorset_green"><?php echo number_format($today_sales->Sales, 2, '.', ','); ?></span>
|
||||
<span class="card_font_colorset_green"><?php echo $today_sales->Sales; ?></span>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
@ -71,7 +71,7 @@
|
||||
<div class="text-left">
|
||||
<p class="text-muted mb-0">Sales in Rs.</p>
|
||||
<h4 class="mb-1 mt-0">
|
||||
<span data-plugin="counterup" class="card_font_colorset_bule"><?php echo number_format($this_month_sales->Sales, 2, '.', ','); ?></span>
|
||||
<span class="card_font_colorset_bule"><?php echo $this_month_sales->Sales; ?></span>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
@ -101,7 +101,7 @@
|
||||
<div class="text-left">
|
||||
<p class="text-muted mb-0">Sales in Rs.</p>
|
||||
<h4 class="mb-1 mt-0">
|
||||
<span data-plugin="counterup" class="card_font_colorset_red"><?php echo number_format($this_year_sales->Sales, 2, '.', ','); ?></span>
|
||||
<span class="card_font_colorset_red"><?php echo $this_year_sales->Sales; ?></span>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user