GWM : client feedback
This commit is contained in:
parent
cd64841608
commit
141b0112a1
@ -225,8 +225,7 @@ class Assetdetails extends BaseController
|
|||||||
if (false) {
|
if (false) {
|
||||||
// $this->addasset();
|
// $this->addasset();
|
||||||
} else {
|
} else {
|
||||||
$assetName = $this->request->getPost('AssetName');
|
$AssetName = $this->request->getPost('AssetName');
|
||||||
$AssetName = (!empty($assetName)) ? strtoupper((string)$assetName) : "";
|
|
||||||
$Description = $this->request->getPost('Description');
|
$Description = $this->request->getPost('Description');
|
||||||
$Department = $this->request->getPost('AssetDept');
|
$Department = $this->request->getPost('AssetDept');
|
||||||
$Location = $this->request->getPost('Location');
|
$Location = $this->request->getPost('Location');
|
||||||
@ -375,8 +374,7 @@ class Assetdetails extends BaseController
|
|||||||
$this->editOldasset($Asset_Code);
|
$this->editOldasset($Asset_Code);
|
||||||
} else {
|
} else {
|
||||||
$Asset_Code = $this->request->getPost('AssetCode');
|
$Asset_Code = $this->request->getPost('AssetCode');
|
||||||
$assetName = $this->request->getPost('AssetName');
|
$AssetName = $this->request->getPost('AssetName');
|
||||||
$AssetName = (!empty($assetName)) ? strtoupper((string)$assetName) : '';
|
|
||||||
$Description = $this->request->getPost('PODescription');
|
$Description = $this->request->getPost('PODescription');
|
||||||
$Department = $this->request->getPost('AssetDept');
|
$Department = $this->request->getPost('AssetDept');
|
||||||
$Location = $this->request->getPost('Location');
|
$Location = $this->request->getPost('Location');
|
||||||
|
|||||||
@ -58,7 +58,6 @@ class CostCenter extends BaseController
|
|||||||
$id = $this->request->getPost('id');
|
$id = $this->request->getPost('id');
|
||||||
log_message('error', 'id: ' . $id);
|
log_message('error', 'id: ' . $id);
|
||||||
$CostCenterName = $this->request->getPost('CostCenterName');
|
$CostCenterName = $this->request->getPost('CostCenterName');
|
||||||
$CostCenterName = ($CostCenterName !== null && is_string($CostCenterName)) ? strtoupper(trim($CostCenterName)) : null;
|
|
||||||
$userId = $this->session->get('userId');
|
$userId = $this->session->get('userId');
|
||||||
$approverId = $this->session->get('EmpID');
|
$approverId = $this->session->get('EmpID');
|
||||||
$currentdt = get_current_date_time();
|
$currentdt = get_current_date_time();
|
||||||
|
|||||||
@ -24,43 +24,42 @@ class Sales extends BaseController
|
|||||||
$this->isLoggedIn();
|
$this->isLoggedIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatIndianCurrency($amount) {
|
function formatIndianCurrency($num,$type) {
|
||||||
// Convert the amount to a string with 2 decimal places
|
$num = explode('.', $num); // Split the number into integer and decimal parts
|
||||||
$formattedAmount = number_format((float)$amount, 2, '.', '');
|
$integerPart = $num[0]; // Get the integer part
|
||||||
|
if($type == 'qty'){ return $integerPart; }
|
||||||
// Split the integer and decimal parts
|
// Apply the Indian number format to the integer part
|
||||||
$parts = explode('.', $formattedAmount);
|
$lastThreeDigits = substr($integerPart, -3);
|
||||||
$integerPart = $parts[0];
|
$remainingDigits = substr($integerPart, 0, -3);
|
||||||
$decimalPart = isset($parts[1]) ? $parts[1] : '00';
|
|
||||||
|
if ($remainingDigits != '') {
|
||||||
// Format the integer part for Indian numbering system
|
$formattedNumber = preg_replace('/\B(?=(\d{2})+(?!\d))/', ',', $remainingDigits) . ',' . $lastThreeDigits;
|
||||||
if (strlen($integerPart) > 3) {
|
} else {
|
||||||
$lastThreeDigits = substr($integerPart, -3); // Get the last 3 digits (thousands)
|
$formattedNumber = $lastThreeDigits;
|
||||||
$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 $formattedNumber;
|
||||||
return $integerPart . '.' . $decimalPart;
|
|
||||||
}
|
}
|
||||||
public function sales_dashboard()
|
public function sales_dashboard()
|
||||||
{
|
{
|
||||||
$this->global['pageTitle'] = 'Sales Dashboard';
|
$this->global['pageTitle'] = 'Sales Dashboard';
|
||||||
$data = [];
|
$data = [];
|
||||||
|
|
||||||
$data['today_sales'] = $this->ipinvoice_model->todaySales();
|
$data['today_sales'] = $this->ipinvoice_model->todaySales();
|
||||||
$data['today_sales']->Sales = $this->formatIndianCurrency($data['today_sales']->Sales, 2, '.', ',');
|
$data['today_sales']->Sales = $this->formatIndianCurrency($data['today_sales']->Sales,'money');
|
||||||
|
$data['today_sales']->Qty = $this->formatIndianCurrency($data['today_sales']->Qty,'qty');
|
||||||
|
|
||||||
$data['this_month_sales'] = $this->ipinvoice_model->thisMonthSales();
|
$data['this_month_sales'] = $this->ipinvoice_model->thisMonthSales();
|
||||||
$data['this_month_sales']->Sales = $this->formatIndianCurrency($data['this_month_sales']->Sales);
|
$data['this_month_sales']->Sales = $this->formatIndianCurrency($data['this_month_sales']->Sales,'money');
|
||||||
|
$data['this_month_sales']->Qty = $this->formatIndianCurrency($data['this_month_sales']->Qty,'qty');
|
||||||
|
|
||||||
$data['this_year_sales'] = $this->ipinvoice_model->thisYearSales();
|
$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']->Sales = $this->formatIndianCurrency($data['this_year_sales']->Sales,'money');
|
||||||
|
$data['this_year_sales']->Qty = $this->formatIndianCurrency($data['this_year_sales']->Qty,'qty');
|
||||||
|
|
||||||
$data['this_year_sales_trend'] = $this->ipinvoice_model->thisYearSalesTrend();
|
$data['this_year_sales_trend'] = $this->ipinvoice_model->thisYearSalesTrend();
|
||||||
$data['get_today_invoices'] = $this->ipinvoice_model->getTodayInvoices();
|
$data['get_today_invoices'] = $this->ipinvoice_model->getTodayInvoices();
|
||||||
|
|
||||||
// Define months from April to March
|
// Define months from April to March
|
||||||
$months = ['Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar'];
|
$months = ['Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar'];
|
||||||
|
|
||||||
|
|||||||
@ -423,14 +423,14 @@ class Supplier extends BaseController
|
|||||||
|
|
||||||
$id = $this->request->getPost('transporterid');
|
$id = $this->request->getPost('transporterid');
|
||||||
$name = $this->request->getPost('transportername');
|
$name = $this->request->getPost('transportername');
|
||||||
$name = ($name !== null && is_string($name)) ? strtoupper(trim($name)) : null;
|
|
||||||
$userId = $this->session->get('userId');
|
$userId = $this->session->get('userId');
|
||||||
|
|
||||||
$data = ['status' => false, 'message' => 'An error occurred while creating transporter details'.gettype($id)];
|
$data = ['status' => false, 'message' => 'An error occurred while creating transporter details'.gettype($id)];
|
||||||
|
|
||||||
$id = trim($id);
|
$id = trim($id);
|
||||||
if ((int)$id === 0) {
|
if ((int)$id === 0) {
|
||||||
$addarr = ['name' => $name,
|
$addarr = [
|
||||||
|
'name' => $name,
|
||||||
'created_by' => $userId,
|
'created_by' => $userId,
|
||||||
];
|
];
|
||||||
if ($this->supplier_model->saveTransporter($addarr) > 0) {
|
if ($this->supplier_model->saveTransporter($addarr) > 0) {
|
||||||
|
|||||||
@ -133,7 +133,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body" style="overflow-x:scroll;">
|
||||||
<!-- <div class="row">
|
<!-- <div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="page-title-box page-title-box-alt">
|
<div class="page-title-box page-title-box-alt">
|
||||||
@ -195,16 +195,13 @@
|
|||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#datatable-buttonss').DataTable({
|
$('#datatable-buttonss').DataTable({
|
||||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
dom: 'Blfrtip',
|
||||||
buttons: [
|
buttons: [
|
||||||
'csv', 'excel', 'pdf'
|
'excel', 'pdf'
|
||||||
],
|
],
|
||||||
pageLength: 10, // Default rows per page
|
pageLength: 10,
|
||||||
lengthMenu: [
|
lengthMenu: [[10, 20, 30, 50, -1],[10, 20, 30, 50, "All"] ],
|
||||||
[10, 20, 30, 50, -1],
|
responsive: false,
|
||||||
[10, 20, 30, 50, "All"]
|
|
||||||
], // Rows per page options
|
|
||||||
responsive: true, // Responsive table
|
|
||||||
order:false,
|
order:false,
|
||||||
language: {
|
language: {
|
||||||
paginate: {
|
paginate: {
|
||||||
|
|||||||
@ -163,7 +163,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body" style="overflow-x:scroll;">
|
||||||
<table id="datatable-buttosns" class="table dt-responsive nowrap w-100">
|
<table id="datatable-buttosns" class="table dt-responsive nowrap w-100">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -296,16 +296,13 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Initialize the DataTable
|
// Initialize the DataTable
|
||||||
var table = $('#datatable-buttosns').DataTable({
|
var table = $('#datatable-buttosns').DataTable({
|
||||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
dom: 'Blfrtip',
|
||||||
buttons: [
|
buttons: [
|
||||||
'csv', 'excel', 'pdf'
|
'excel', 'pdf'
|
||||||
],
|
],
|
||||||
pageLength: 10, // Default rows per page
|
pageLength: 10,
|
||||||
lengthMenu: [
|
lengthMenu: [[10, 20, 30, 50, -1],[10, 20, 30, 50, "All"]],
|
||||||
[10, 20, 30, 50, -1],
|
responsive: false,
|
||||||
[10, 20, 30, 50, "All"]
|
|
||||||
], // Rows per page options
|
|
||||||
responsive: true, // Responsive table
|
|
||||||
order: false,
|
order: false,
|
||||||
language: {
|
language: {
|
||||||
paginate: {
|
paginate: {
|
||||||
@ -314,6 +311,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Reset button functionality
|
// Reset button functionality
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user