diff --git a/app/Controllers/Assetdetails.php b/app/Controllers/Assetdetails.php index cecc86b2..97aa6bdc 100755 --- a/app/Controllers/Assetdetails.php +++ b/app/Controllers/Assetdetails.php @@ -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'); diff --git a/app/Controllers/CostCenter.php b/app/Controllers/CostCenter.php index 0a231e42..6d00c8ee 100755 --- a/app/Controllers/CostCenter.php +++ b/app/Controllers/CostCenter.php @@ -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(); diff --git a/app/Controllers/Sales.php b/app/Controllers/Sales.php index dbc27e72..267848f6 100755 --- a/app/Controllers/Sales.php +++ b/app/Controllers/Sales.php @@ -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']; diff --git a/app/Controllers/Supplier.php b/app/Controllers/Supplier.php index c0a4495d..e89c72b2 100755 --- a/app/Controllers/Supplier.php +++ b/app/Controllers/Supplier.php @@ -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) { diff --git a/app/Views/AmendPOlist.php b/app/Views/AmendPOlist.php index 3b7ddfe9..2ce24762 100755 --- a/app/Views/AmendPOlist.php +++ b/app/Views/AmendPOlist.php @@ -213,16 +213,16 @@ }); // Initialize the DataTable var table = $('#amend_po_list').DataTable({ - dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination + dom: 'Blfrtip', buttons: [ - 'csv', 'excel', 'pdf' // Export buttons + 'excel', 'pdf' ], - pageLength: 10, // Default rows per page + pageLength: 10, lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] - ], // Rows per page options - responsive: true, // Responsive table + ], + responsive: false, order:false, language: { diff --git a/app/Views/POlist.php b/app/Views/POlist.php index 2002a31a..8fd16db7 100755 --- a/app/Views/POlist.php +++ b/app/Views/POlist.php @@ -265,16 +265,16 @@ // Initialize the DataTable var table = $('#po_list').DataTable({ - dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination + dom: 'Blfrtip', buttons: [ - 'csv', 'excel', 'pdf', // Export buttons + 'excel', 'pdf' ], - pageLength: 10, // Default rows per page + pageLength: 10, lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] - ], // Rows per page options - responsive: true, // Responsive table + ], + responsive: false, ordering: false, language: { paginate: { diff --git a/app/Views/assetListing.php b/app/Views/assetListing.php index 67164f33..0733986d 100755 --- a/app/Views/assetListing.php +++ b/app/Views/assetListing.php @@ -73,7 +73,7 @@
-
+
@@ -105,7 +105,7 @@ $cdate = date('d-m-Y', strtotime($record->CreatedDt)); } ?> - @@ -144,17 +144,17 @@ $(document).ready(function() { // Initialize the DataTable var table = $('#asset_list_table').DataTable({ - dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination + dom: 'Blfrtip', buttons: [ - 'csv', 'excel', 'pdf' + 'excel', 'pdf' ], - pageLength: 10, // Default rows per page + pageLength: 10, lengthMenu: [ [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) + ], + responsive: false, + order: false, language: { paginate: { next: '', // Next button icon @@ -168,8 +168,6 @@ function(settings, data, dataIndex) { var fromDate = $('#fromDate').val(); var toDate = $('#toDate').val(); - console.log(fromDate); // e.g., 01-09-2024 - console.log(toDate); // e.g., 08-09-2024 if (!fromDate || !toDate) { return true; // If no dates selected, don't filter diff --git a/app/Views/configlisting.php b/app/Views/configlisting.php index a8d1f1ed..01a8faac 100755 --- a/app/Views/configlisting.php +++ b/app/Views/configlisting.php @@ -116,7 +116,7 @@
-
+
AssetCode, 5) ?> + AssetCode, 5) ?> AssetName ?> Description ?> DepartmentName ?>
@@ -186,17 +186,17 @@ // Initialize the DataTable var table = $('#config_list_table').DataTable({ - dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination + dom: 'Blfrtip', buttons: [ - 'csv', 'excel', 'pdf' + 'excel', 'pdf' ], - pageLength: 10, // Default rows per page + pageLength: 10, lengthMenu: [ [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) + ], + responsive: false, + order: false, language: { paginate: { next: '', // Next button icon diff --git a/app/Views/costListing.php b/app/Views/costListing.php index 3c7f04eb..d730245a 100755 --- a/app/Views/costListing.php +++ b/app/Views/costListing.php @@ -73,7 +73,7 @@
-
+
@@ -221,17 +221,17 @@ // Initialize the DataTable var table = $('#cost_listing').DataTable({ - dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination + dom: 'Blfrtip', buttons: [ - 'csv', 'excel', 'pdf' + 'excel', 'pdf' ], - pageLength: 10, // Default rows per page + pageLength: 10, lengthMenu: [ [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) + ], + responsive: false, + order: false, language: { paginate: { next: '', // Next button icon diff --git a/app/Views/createPOfromRequistion.php b/app/Views/createPOfromRequistion.php index e62202bb..605272b7 100755 --- a/app/Views/createPOfromRequistion.php +++ b/app/Views/createPOfromRequistion.php @@ -303,7 +303,7 @@
-
+
@@ -401,19 +401,17 @@ }); var table = $('#create_po_from_requistion').DataTable({ - dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination + dom: 'Blfrtip', buttons: [ - 'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons + 'excel', 'pdf' ], - pageLength: 10, // Default rows per page + pageLength: 10, lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] - ], // Rows per page options - responsive: false, // Responsive table - order: [ - // [0, 'desc'] - ], // Default ordering (column index 0, descending) + ], + responsive: false, + order: false, scrollX: true, language: { paginate: { diff --git a/app/Views/departmentListing.php b/app/Views/departmentListing.php index 2141dc5d..8d14e2ca 100755 --- a/app/Views/departmentListing.php +++ b/app/Views/departmentListing.php @@ -102,7 +102,7 @@
-
+
@@ -127,7 +127,7 @@ $cdate = date('d-m-Y', strtotime($record->CreatedDt)); } ?> - +
DEPCode; ?>DEPCode; ?> DepartmentName ?> HeadDept ?> IsActive == 1) { @@ -164,17 +164,17 @@ // Initialize the DataTable var table = $('#department_list_table').DataTable({ - dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination + dom: 'Blfrtip', buttons: [ - 'csv', 'excel', 'pdf' + 'excel', 'pdf' ], - pageLength: 10, // Default rows per page + pageLength: 10, lengthMenu: [ [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) + ], + responsive: false, + order: false, language: { paginate: { next: '', // Next button icon diff --git a/app/Views/employeeListing.php b/app/Views/employeeListing.php index 10cd0b72..31f4e452 100755 --- a/app/Views/employeeListing.php +++ b/app/Views/employeeListing.php @@ -107,7 +107,7 @@
-
+
@@ -131,7 +131,7 @@ } else { $cdate = date('d-m-Y', strtotime($record->Created_date)); } ?> - + @@ -165,13 +165,13 @@ // Initialize the DataTable var table = $('#datatable').DataTable({ - dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination + dom: 'Blfrtip', buttons: [ - 'csv', 'excel', 'pdf' + 'excel', 'pdf' ], - pageLength: 10, // Default rows per page + pageLength: 10, lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], // Rows per page options - // responsive: true, // Responsive table + responsive: false, order: false, language: { paginate: { diff --git a/app/Views/expense_list.php b/app/Views/expense_list.php index 11a66525..df060602 100755 --- a/app/Views/expense_list.php +++ b/app/Views/expense_list.php @@ -103,12 +103,11 @@
-
+
EmpID ?> EmpID ?> FirstName; ?> ContactNumber ?> Designation ?>
- @@ -471,15 +470,15 @@ var table = $('#expense_list_table').DataTable({ dom: 'Blfrtip', buttons: [ - 'csv', 'excel', 'pdf' + 'excel', 'pdf' ], pageLength: 10, lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], - // responsive: true, - order: [], + responsive: false, + order: false, language: { paginate: { next: '', diff --git a/app/Views/factoryMachineMasterDetails.php b/app/Views/factoryMachineMasterDetails.php index 9c50c7b4..9bf3a053 100644 --- a/app/Views/factoryMachineMasterDetails.php +++ b/app/Views/factoryMachineMasterDetails.php @@ -108,7 +108,7 @@
-
+
Created Date Supplier Name Item Description Cost
@@ -182,14 +182,14 @@ // Initialize the DataTable var table = $('#datatable').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 - order: [], // Default ordering (column index 0, descending) + pageLength: 10, + lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], + responsive: false, + order: false, language: { paginate: { next: '', // Next button icon diff --git a/app/Views/inwardgateregister.php b/app/Views/inwardgateregister.php index 6ffe06e5..501339db 100755 --- a/app/Views/inwardgateregister.php +++ b/app/Views/inwardgateregister.php @@ -397,6 +397,7 @@ } function validate() { + var rowcount = $("#txtRowCount").val(); var isOpenOrder = parseInt($("#hiddenIsOpenOrder").val(), 2); var formatted_IsOpenOrder = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? 0 : 1; @@ -406,11 +407,12 @@ var InvoiceQty = parseFloat($('#QuantityAsPerInvoice' + k).val() == '' ? '0.00' : $('#QuantityAsPerInvoice' + k).val()); var RecQty = parseFloat($('#txtReceivedQuantity' + k).val() == '' ? '0.00' : $('#txtReceivedQuantity' + k).val()); var OrderedQty = parseFloat($('#Quantity_1' + k).text()); + if (InvoiceQty != '0.00') { if (OrderedQty < (InvoiceQty + RecQty)) { isExceed = 1; - return false; + // return false; } Noval = 1; } diff --git a/app/Views/rawmaterialListing.php b/app/Views/rawmaterialListing.php index b19e28f7..316ccab6 100755 --- a/app/Views/rawmaterialListing.php +++ b/app/Views/rawmaterialListing.php @@ -66,7 +66,7 @@ ?>
-
+
@@ -79,7 +79,7 @@
-
+
@@ -112,9 +112,9 @@ stock != null || '') { ?> - + - + @@ -144,17 +144,17 @@ $(document).ready(function() { // Initialize the DataTable var table = $('#raw_material_list_table').DataTable({ - dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination + dom: 'Blfrtip', buttons: [ 'excel', 'pdf' ], - pageLength: 10, // Default rows per page + pageLength: 10, lengthMenu: [ [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) + responsive: false, // Responsive table + order: false, // Default ordering (column index 0, descending) language: { paginate: { next: '', // Next button icon @@ -168,8 +168,6 @@ function(settings, data, dataIndex) { var fromDate = $('#fromDate').val(); var toDate = $('#toDate').val(); - console.log(fromDate); // e.g., 01-09-2024 - console.log(toDate); // e.g., 08-09-2024 if (!fromDate || !toDate) { return true; // If no dates selected, don't filter diff --git a/app/Views/sales_dashboard.php b/app/Views/sales_dashboard.php index 8e175860..7233bc4b 100755 --- a/app/Views/sales_dashboard.php +++ b/app/Views/sales_dashboard.php @@ -133,7 +133,7 @@
-
+
MaterialType ?> UOM ?> stock ?>stock ?> 00 Category ?> HSNCODE ?>