From 9f7e028e41f90cb6ff7b651c780f7fad244f81ae Mon Sep 17 00:00:00 2001 From: aadhavan valli Date: Sat, 31 Aug 2024 19:07:31 +0530 Subject: [PATCH] CHANGE_ALL_TABLE_CHECK --- app/Models/Assetdetails_model.php | 3 ++- app/Models/Costcenter_model.php | 4 ++-- app/Models/Purchaseorder_model.php | 2 +- app/Models/Rawmaterialdetails_model.php | 2 +- app/Models/Requistion_model.php | 21 ++++++++++++++------- app/Models/Supplier_model.php | 7 +++++-- app/Models/User_model.php | 1 + app/Views/AmendPOlist.php | 2 +- app/Views/POlist.php | 2 +- app/Views/Report_pending_purchase.php | 4 ++-- app/Views/alterpurchaseorder.php | 4 ++-- app/Views/assetListing.php | 6 +++--- app/Views/configlisting.php | 4 +--- app/Views/costListing.php | 6 ++---- app/Views/departmentListing.php | 2 +- app/Views/employeeListing.php | 6 +++--- app/Views/expense_list.php | 4 ++-- app/Views/porelease_view.php | 2 +- app/Views/rawmaterialListing.php | 2 +- app/Views/requisitionlisting.php | 2 +- app/Views/supplierListing.php | 2 +- app/Views/transporterListing.php | 4 +--- app/Views/userListing.php | 2 +- 23 files changed, 50 insertions(+), 44 deletions(-) diff --git a/app/Models/Assetdetails_model.php b/app/Models/Assetdetails_model.php index e7468108..dd88663f 100644 --- a/app/Models/Assetdetails_model.php +++ b/app/Models/Assetdetails_model.php @@ -19,7 +19,8 @@ class Assetdetails_model extends Model $builder = $this->db->table('t_asset_details asd') ->select('asd.*,dep.DepartmentName,sup.SupplierName') ->join('t_departmentdetails dep', ' dep.DEPCode = asd.DEPCode', 'left') - ->join('t_supplierdetailsn sup', 'sup.SupplierID = asd.SupplierCode', 'left'); + ->join('t_supplierdetailsn sup', 'sup.SupplierID = asd.SupplierCode', 'left') + ->orderBy('asd.CreatedDt', 'desc'); $query = $builder->get(); diff --git a/app/Models/Costcenter_model.php b/app/Models/Costcenter_model.php index 20789e62..f5de56dc 100644 --- a/app/Models/Costcenter_model.php +++ b/app/Models/Costcenter_model.php @@ -18,8 +18,8 @@ class Costcenter_model extends Model $builder = $this->db->table('t_costcenter_master as Cost') ->select('Cost.id as id, Cost.CostCenterCode as code,Cost.CostCenterName as CostCenterName , Cost.ApprovedBy as ApprovedBy,Emp.FirstName as FirstName,Emp.Designation as Designation ,Cost.CreatedDate,Cost.IsActive,Cost.DeletedBy,Cost.DeletedBy') - ->join('t_employee_details as Emp', 'Emp.EmpID=Cost.ApprovedBy'); - + ->join('t_employee_details as Emp', 'Emp.EmpID=Cost.ApprovedBy') + ->orderBy('Cost.CreatedDate', 'desc'); $query =$builder->get(); $result = $query->getResult(); diff --git a/app/Models/Purchaseorder_model.php b/app/Models/Purchaseorder_model.php index ccc6603f..bf0a0dd0 100644 --- a/app/Models/Purchaseorder_model.php +++ b/app/Models/Purchaseorder_model.php @@ -405,7 +405,7 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath, $builder->where('POMast.Status !=', PO_AMENDED); // $builder->orderBy('POMast.Status !=',PO_AMENDED); } - $builder->orderBy('POMast.POID', 'desc'); + $builder->orderBy('POMast.PODate', 'desc'); $query = $builder->get(); $result = $query->getResult(); diff --git a/app/Models/Rawmaterialdetails_model.php b/app/Models/Rawmaterialdetails_model.php index 14db3e5c..329e8161 100644 --- a/app/Models/Rawmaterialdetails_model.php +++ b/app/Models/Rawmaterialdetails_model.php @@ -20,7 +20,7 @@ class Rawmaterialdetails_model extends Model $builder = $this->db->table('t_materialmaster') ->select('*') ->where('IsActive', 1) - ->orderBy('CreatedDate','DESC'); + ->orderBy('CreatedDate','desc'); $query = $builder->get(); $result = $query->getResult(); return $result; diff --git a/app/Models/Requistion_model.php b/app/Models/Requistion_model.php index d8891486..515acf22 100644 --- a/app/Models/Requistion_model.php +++ b/app/Models/Requistion_model.php @@ -90,15 +90,22 @@ class Requistion_model extends Model /* This function is used to get the Raw Material information * @return array $result : This is result of the query */ - function getRequistionList($ReqNo,$IsArray='') + function getRequistionList($ReqNo, $IsArray = '') { - $result = $this->db->query("CALL P_GET_AllREQUISTION('".$ReqNo."')"); - // $result = $this->db-> query("CALL P_GET_AllREQUISTION('".$ReqNo."')") or die(mysql_error()); - if (!$result){return [];} - - if($IsArray != ''){return $result->getResultArray();} - else{return $result->getResult();} + $result = $this->db->query("CALL P_GET_AllREQUISTION('".$ReqNo."')"); + if (!$result) { + return []; + } + + if ($IsArray != '') { + $data = $result->getResultArray(); // Fetch as an array + return array_reverse($data); // Reverse the array and return + } else { + $data = $result->getResult(); // Fetch as an object array + return array_reverse($data); // Reverse the array and return + } } + /** * This function is used to get Employee details based on Employee ID Selection diff --git a/app/Models/Supplier_model.php b/app/Models/Supplier_model.php index a940a95f..865e07ea 100644 --- a/app/Models/Supplier_model.php +++ b/app/Models/Supplier_model.php @@ -19,7 +19,8 @@ class Supplier_model extends Model $builder = $this->db->table('t_supplierdetailsn as BaseT') ->select('BaseT.SupplierID, BaseT.SupplierName, BaseT.Address, BaseT.ContactNumber, BaseT.AlternateContactNumber,BaseT.EmailAddress,BaseT.Exiseregistration, BaseT.TIN, BaseT.PAN,,BaseT.GSTNO,BaseT.GSTRange,BaseT.CollectrateAddress,BaseT.UANumber,BaseT.CreatedOn,BaseT.PaymentID,pmt.PaymentTerms,BaseT.CSTDate,BaseT.IsActive') //,BaseT.PaymentTerms,BaseT.PaymentDays,BaseT.PayableAT,pmt.Details'); - ->join('t_paymentterms as pmt', 'pmt.PaymentID = BaseT.PaymentID', 'left'); + ->join('t_paymentterms as pmt', 'pmt.PaymentID = BaseT.PaymentID', 'left') + ->orderBy('BaseT.CreatedOn', 'desc'); // Adjust this column as needed $query = $builder->get(); @@ -173,7 +174,9 @@ class Supplier_model extends Model $builder = $this->db->table('t_transporter as t') ->select('t.id,t.name,t_employee_details.FirstName as FirstName,t.created_on,t.isactive') ->join('tbl_users', 'tbl_users.userId = t.created_by') - ->join('t_employee_details', 't_employee_details.EmpID=tbl_users.EmpID'); + ->join('t_employee_details', 't_employee_details.EmpID=tbl_users.EmpID') + ->orderBy('t.created_on', 'desc'); + $query =$builder->get(); $result = $query->getResult(); // echo $this->db->getLastQuery()->getQuery();die; diff --git a/app/Models/User_model.php b/app/Models/User_model.php index 17bf2148..0d996a9b 100644 --- a/app/Models/User_model.php +++ b/app/Models/User_model.php @@ -23,6 +23,7 @@ class User_model extends Model ->join('t_departmentdetails DEPT', 'EMP.Departmentcode = DEPT.DEPCode') ->join('tbl_users user', 'user.EmpID = EMP.EmpID') ->join('tbl_roles role', 'user.roleId = role.roleId') + ->orderBy('user.createdDtm', 'desc') ->where('user.isDeleted !=', 1); $query = $builder->get(); diff --git a/app/Views/AmendPOlist.php b/app/Views/AmendPOlist.php index dbe27610..c52f4af4 100644 --- a/app/Views/AmendPOlist.php +++ b/app/Views/AmendPOlist.php @@ -204,7 +204,7 @@ $(document).ready(function() { 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: [[0, 'desc']], // Default ordering (column index 0, descending) + order: [], // Default ordering (column index 0, descending) language: { paginate: { next: '', // Next button icon diff --git a/app/Views/POlist.php b/app/Views/POlist.php index eaea187c..da983066 100644 --- a/app/Views/POlist.php +++ b/app/Views/POlist.php @@ -214,7 +214,7 @@ $(document).ready(function() { 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: [[0, 'desc']], // Default ordering (column index 0, descending) + order: [], // Default ordering (column index 0, descending) language: { paginate: { next: '', // Next button icon diff --git a/app/Views/Report_pending_purchase.php b/app/Views/Report_pending_purchase.php index 23008531..321afeac 100644 --- a/app/Views/Report_pending_purchase.php +++ b/app/Views/Report_pending_purchase.php @@ -167,10 +167,10 @@
--> - +
- + diff --git a/app/Views/alterpurchaseorder.php b/app/Views/alterpurchaseorder.php index 156716b4..d331a1e1 100644 --- a/app/Views/alterpurchaseorder.php +++ b/app/Views/alterpurchaseorder.php @@ -5377,8 +5377,8 @@ if (!empty($INRSYMBOL)) {
-
PO Date PO No
- +
+ diff --git a/app/Views/assetListing.php b/app/Views/assetListing.php index 53194795..044ea601 100644 --- a/app/Views/assetListing.php +++ b/app/Views/assetListing.php @@ -70,8 +70,8 @@
-
SNo Requisition No
- +
+ @@ -164,7 +164,7 @@ $(document).ready(function() { 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: [[0, 'desc']], // Default ordering (column index 0, descending) + order: [], // Default ordering (column index 0, descending) language: { paginate: { next: '', // Next button icon diff --git a/app/Views/configlisting.php b/app/Views/configlisting.php index 89e51d14..0999e3ff 100644 --- a/app/Views/configlisting.php +++ b/app/Views/configlisting.php @@ -184,9 +184,7 @@ [10, 20, 30, 50, "All"] ], // Rows per page options responsive: true, // Responsive table - order: [ - [0, 'desc'] - ], // Default ordering (column index 0, descending) + order: [ ], // Default ordering (column index 0, descending) language: { paginate: { next: '', // Next button icon diff --git a/app/Views/costListing.php b/app/Views/costListing.php index 788bd795..08e69cc2 100644 --- a/app/Views/costListing.php +++ b/app/Views/costListing.php @@ -71,7 +71,7 @@
Created Date Asset Code
- + @@ -227,9 +227,7 @@ [10, 20, 30, 50, "All"] ], // Rows per page options responsive: true, // Responsive table - order: [ - [0, 'desc'] - ], // Default ordering (column index 0, descending) + order: [], // Default ordering (column index 0, descending) language: { paginate: { next: '', // Next button icon diff --git a/app/Views/departmentListing.php b/app/Views/departmentListing.php index f5e64b47..890d60bc 100644 --- a/app/Views/departmentListing.php +++ b/app/Views/departmentListing.php @@ -165,7 +165,7 @@ 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: [[0, 'desc']], // Default ordering (column index 0, descending) + order: [], // Default ordering (column index 0, descending) language: { paginate: { next: '', // Next button icon diff --git a/app/Views/employeeListing.php b/app/Views/employeeListing.php index b57abb59..1668acb2 100644 --- a/app/Views/employeeListing.php +++ b/app/Views/employeeListing.php @@ -115,8 +115,8 @@
-
Create Date Create Time
- +
+ @@ -197,7 +197,7 @@ 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: [[0, 'desc']], // Default ordering (column index 0, descending) + order: [], // Default ordering (column index 0, descending) language: { paginate: { next: '', // Next button icon diff --git a/app/Views/expense_list.php b/app/Views/expense_list.php index 0e2a85ad..a85da52e 100644 --- a/app/Views/expense_list.php +++ b/app/Views/expense_list.php @@ -81,8 +81,8 @@
-
Created Date Emp ID
- +
+ diff --git a/app/Views/porelease_view.php b/app/Views/porelease_view.php index 2c912735..38e4ea49 100644 --- a/app/Views/porelease_view.php +++ b/app/Views/porelease_view.php @@ -521,7 +521,7 @@ $(document).ready(function() { 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: [[0, 'desc']], // Default ordering (column index 0, descending) + order: [], // Default ordering (column index 0, descending) language: { paginate: { next: '', // Next button icon diff --git a/app/Views/rawmaterialListing.php b/app/Views/rawmaterialListing.php index dca420f8..68485e34 100644 --- a/app/Views/rawmaterialListing.php +++ b/app/Views/rawmaterialListing.php @@ -172,7 +172,7 @@ 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: [[0, 'desc']], // Default ordering (column index 0, descending) + order: [], // Default ordering (column index 0, descending) language: { paginate: { next: '', // Next button icon diff --git a/app/Views/requisitionlisting.php b/app/Views/requisitionlisting.php index c85015c5..10c0e31a 100644 --- a/app/Views/requisitionlisting.php +++ b/app/Views/requisitionlisting.php @@ -218,7 +218,7 @@ $(document).ready(function() { 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: [[0, 'desc']], // Default ordering (column index 0, descending) + order: [], // Default ordering (column index 0, descending) language: { paginate: { next: '', // Next button icon diff --git a/app/Views/supplierListing.php b/app/Views/supplierListing.php index 8227d7be..66b149c3 100644 --- a/app/Views/supplierListing.php +++ b/app/Views/supplierListing.php @@ -194,7 +194,7 @@ 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: [[0, 'desc']], // Default ordering (column index 0, descending) + order: [], // Default ordering (column index 0, descending) language: { paginate: { next: '', // Next button icon diff --git a/app/Views/transporterListing.php b/app/Views/transporterListing.php index f105de0f..75a4efdb 100644 --- a/app/Views/transporterListing.php +++ b/app/Views/transporterListing.php @@ -260,9 +260,7 @@ [10, 20, 30, 50, "All"] ], // Rows per page options responsive: true, // Responsive table - order: [ - [0, 'desc'] - ], // Default ordering (column index 0, descending) + order: [ ], // Default ordering (column index 0, descending) language: { paginate: { next: '', // Next button icon diff --git a/app/Views/userListing.php b/app/Views/userListing.php index 2e7c7764..871e2f99 100644 --- a/app/Views/userListing.php +++ b/app/Views/userListing.php @@ -194,7 +194,7 @@ $(document).ready(function() { 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: [[0, 'desc']], // Default ordering (column index 0, descending) + order: [], // Default ordering (column index 0, descending) language: { paginate: { next: '', // Next button icon
Created Date