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) {
// $this->addasset();
} else {
$assetName = $this->request->getPost('AssetName');
$AssetName = (!empty($assetName)) ? strtoupper((string)$assetName) : "";
$AssetName = $this->request->getPost('AssetName');
$Description = $this->request->getPost('Description');
$Department = $this->request->getPost('AssetDept');
$Location = $this->request->getPost('Location');
@ -375,8 +374,7 @@ class Assetdetails extends BaseController
$this->editOldasset($Asset_Code);
} else {
$Asset_Code = $this->request->getPost('AssetCode');
$assetName = $this->request->getPost('AssetName');
$AssetName = (!empty($assetName)) ? strtoupper((string)$assetName) : '';
$AssetName = $this->request->getPost('AssetName');
$Description = $this->request->getPost('PODescription');
$Department = $this->request->getPost('AssetDept');
$Location = $this->request->getPost('Location');

View File

@ -58,7 +58,6 @@ class CostCenter extends BaseController
$id = $this->request->getPost('id');
log_message('error', 'id: ' . $id);
$CostCenterName = $this->request->getPost('CostCenterName');
$CostCenterName = ($CostCenterName !== null && is_string($CostCenterName)) ? strtoupper(trim($CostCenterName)) : null;
$userId = $this->session->get('userId');
$approverId = $this->session->get('EmpID');
$currentdt = get_current_date_time();

View File

@ -24,43 +24,42 @@ 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;
function formatIndianCurrency($num,$type) {
$num = explode('.', $num); // Split the number into integer and decimal parts
$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);
if ($remainingDigits != '') {
$formattedNumber = preg_replace('/\B(?=(\d{2})+(?!\d))/', ',', $remainingDigits) . ',' . $lastThreeDigits;
} else {
$formattedNumber = $lastThreeDigits;
}
// Combine the integer and decimal parts
return $integerPart . '.' . $decimalPart;
return $formattedNumber;
}
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['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']->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']->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['get_today_invoices'] = $this->ipinvoice_model->getTodayInvoices();
// Define months from April to March
$months = ['Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar'];

View File

@ -423,14 +423,14 @@ class Supplier extends BaseController
$id = $this->request->getPost('transporterid');
$name = $this->request->getPost('transportername');
$name = ($name !== null && is_string($name)) ? strtoupper(trim($name)) : null;
$userId = $this->session->get('userId');
$data = ['status' => false, 'message' => 'An error occurred while creating transporter details'.gettype($id)];
$id = trim($id);
if ((int)$id === 0) {
$addarr = ['name' => $name,
$addarr = [
'name' => $name,
'created_by' => $userId,
];
if ($this->supplier_model->saveTransporter($addarr) > 0) {

View File

@ -133,7 +133,7 @@
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="card-body" style="overflow-x:scroll;">
<!-- <div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
@ -195,16 +195,13 @@
<script>
$(document).ready(function() {
$('#datatable-buttonss').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
dom: 'Blfrtip',
buttons: [
'csv', 'excel', 'pdf'
'excel', 'pdf'
],
pageLength: 10, // Default rows per page
lengthMenu: [
[10, 20, 30, 50, -1],
[10, 20, 30, 50, "All"]
], // Rows per page options
responsive: true, // Responsive table
pageLength: 10,
lengthMenu: [[10, 20, 30, 50, -1],[10, 20, 30, 50, "All"] ],
responsive: false,
order:false,
language: {
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">
<thead>
<tr>
@ -296,16 +296,13 @@
$(document).ready(function() {
// Initialize the DataTable
var table = $('#datatable-buttosns').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
dom: 'Blfrtip',
buttons: [
'csv', 'excel', 'pdf'
'excel', 'pdf'
],
pageLength: 10, // Default rows per page
lengthMenu: [
[10, 20, 30, 50, -1],
[10, 20, 30, 50, "All"]
], // Rows per page options
responsive: true, // Responsive table
pageLength: 10,
lengthMenu: [[10, 20, 30, 50, -1],[10, 20, 30, 50, "All"]],
responsive: false,
order: false,
language: {
paginate: {
@ -314,6 +311,7 @@
}
}
});
// Reset button functionality