diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 705348c8..4a422bd5 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -49,6 +49,7 @@ $routes->post('supplierExist','Supplier::checksupplier'); $routes->post('supplierGSTExist','Supplier::checkGST'); $routes->post('supplierPANExist','Supplier::checkPAN'); $routes->get('exportsupplier','Supplier::exportsupplier'); // export supplier details +$routes->post('deletesupplier','Supplier::deletesupplier'); diff --git a/app/Controllers/Supplier.php b/app/Controllers/Supplier.php index d3d1e41f..e37f717a 100644 --- a/app/Controllers/Supplier.php +++ b/app/Controllers/Supplier.php @@ -376,7 +376,18 @@ class Supplier extends BaseController return $this->response->setJSON($query); } + function deletesupplier() + { + $Sid = $this->request->getPost('id'); + + $updatedDate = get_current_date_time(); + $SupplierInfo = array('IsActive' => 0, 'updatedBy' => $this->session->get('userId'), 'Updatedon' => $updatedDate); + + $result = $this->supplier_model->deleteSupplier($Sid, $SupplierInfo); + + echo 'Succssfully change the Supplier status to InAcive'; + } function exportsupplier() { diff --git a/app/Models/Supplier_model.php b/app/Models/Supplier_model.php index cb8e8a6a..41fcf03d 100644 --- a/app/Models/Supplier_model.php +++ b/app/Models/Supplier_model.php @@ -18,7 +18,7 @@ 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.PaymentTerms,BaseT.PaymentDays,BaseT.PayableAT,pmt.Details'); + ->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'); $query = $builder->get(); diff --git a/app/Views/POlist.php b/app/Views/POlist.php index 2a341784..0cb2ba8f 100644 --- a/app/Views/POlist.php +++ b/app/Views/POlist.php @@ -3,6 +3,42 @@ margin: 0px !important; } + + + +