GWM : client feedback

This commit is contained in:
Gowtham M 2024-10-29 17:14:53 +05:30
parent cd64841608
commit 141b0112a1
6 changed files with 42 additions and 51 deletions

View File

@ -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');

View File

@ -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();

View File

@ -24,40 +24,39 @@ 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; }
// Apply the Indian number format to the integer part
$lastThreeDigits = substr($integerPart, -3);
$remainingDigits = substr($integerPart, 0, -3);
// Split the integer and decimal parts if ($remainingDigits != '') {
$parts = explode('.', $formattedAmount); $formattedNumber = preg_replace('/\B(?=(\d{2})+(?!\d))/', ',', $remainingDigits) . ',' . $lastThreeDigits;
$integerPart = $parts[0]; } else {
$decimalPart = isset($parts[1]) ? $parts[1] : '00'; $formattedNumber = $lastThreeDigits;
// 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 $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();

View File

@ -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) {

View File

@ -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: {

View File

@ -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: {
@ -316,6 +313,7 @@
}); });
// Reset button functionality // Reset button functionality
$("#resetButton").click(function() { $("#resetButton").click(function() {
$("#fromDate").val(''); $("#fromDate").val('');