today update by sriram completed supplier details
This commit is contained in:
parent
5192d77adb
commit
bf0448f51c
@ -45,7 +45,7 @@ class supplier extends BaseController
|
|||||||
|
|
||||||
$count = $this->supplier_model->supplierListingCount($searchText);
|
$count = $this->supplier_model->supplierListingCount($searchText);
|
||||||
|
|
||||||
$returns = $this->paginationCompress ( "supplierListing/", $count, 15 );
|
$returns = $this->paginationCompress ( "supplierListing/", $count, 5 );
|
||||||
|
|
||||||
$data['userRecords'] = $this->supplier_model->supplierListing($searchText, $returns["page"], $returns["segment"]);
|
$data['userRecords'] = $this->supplier_model->supplierListing($searchText, $returns["page"], $returns["segment"]);
|
||||||
|
|
||||||
@ -59,14 +59,40 @@ class supplier extends BaseController
|
|||||||
function addsupplier()
|
function addsupplier()
|
||||||
{
|
{
|
||||||
$this->load->model('supplier_model');
|
$this->load->model('supplier_model');
|
||||||
//$data['SupplierName'] = $this->purchaseorder_model->getSupplierName();
|
$data['payment'] = $this->supplier_model->getpayment();
|
||||||
//$data['users'] = $this->purchaseorder_model->getusers();
|
//$data['users'] = $this->purchaseorder_model->getusers();
|
||||||
|
|
||||||
$this->global['pageTitle'] = 'siddharth : Add New Supplier';
|
$this->global['pageTitle'] = 'siddharth : AddNew Supplier';
|
||||||
|
|
||||||
$this->loadViews("addsupplier", $this->global, NULL);
|
$this->loadViews("addsupplier", $this->global,$data, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* This function is used to check whether PAN already exist or not
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function CheckPAN()
|
||||||
|
{
|
||||||
|
$id = $this->input->post('id');
|
||||||
|
|
||||||
|
$this->load->model('supplier_model');
|
||||||
|
|
||||||
|
$query = $this->supplier_model->checkPAN($id );
|
||||||
|
|
||||||
|
// $result = array_shift($result);
|
||||||
|
|
||||||
|
$query = $query[0]['PAN'];
|
||||||
|
|
||||||
|
|
||||||
|
print_r($query);
|
||||||
|
|
||||||
|
//return $PAN;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is used to add new user to the system
|
* This function is used to add new user to the system
|
||||||
@ -78,13 +104,23 @@ class supplier extends BaseController
|
|||||||
|
|
||||||
$SupplierID = $this->input->post('SupplierID');
|
$SupplierID = $this->input->post('SupplierID');
|
||||||
|
|
||||||
$this->form_validation->set_rules('SupplierName','Supplier Name','trim|');
|
$this->form_validation->set_rules('SupplierName','Supplier Name','trim|required');
|
||||||
$this->form_validation->set_rules('Address','Address','trim|required|');
|
$this->form_validation->set_rules('Address','Address','trim|required|');
|
||||||
$this->form_validation->set_rules('ContactNumber','Contact Number','trim||numeric');
|
|
||||||
$this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim||numeric');
|
$this->form_validation->set_rules('ContactNumber','Contact Number','trim|required|numeric');
|
||||||
$this->form_validation->set_rules('EmailAddress','Email Address|valid_email|xss_clean|max_length[128]');
|
$this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim|required|numeric');
|
||||||
|
$this->form_validation->set_rules('EmailAddress','Email Address|valid_email|xss_clean|max_length[128]|required');
|
||||||
|
$this->form_validation->set_rules('Exiseregistration','Exiseregistration','trim|required');
|
||||||
$this->form_validation->set_rules('TIN','TIN','trim|required');
|
$this->form_validation->set_rules('TIN','TIN','trim|required');
|
||||||
$this->form_validation->set_rules('PAN','PAN','required');
|
|
||||||
|
$this->form_validation->set_rules('PAN', 'PAN', 'trim|required');
|
||||||
|
$this->form_validation->set_rules('GSTNo','GST No','trim|required');
|
||||||
|
$this->form_validation->set_rules('GSTRange','GST Range','trim|required');
|
||||||
|
$this->form_validation->set_rules('CollectrateAddress','CollectrateAddress','trim|required');
|
||||||
|
$this->form_validation->set_rules('UANumber','UANumber','trim|required');
|
||||||
|
$this->form_validation->set_rules('PaymentTerms','PaymentTerms','trim|required');
|
||||||
|
$this->form_validation->set_rules('PaymentDays','PaymentTerms','trim|required');
|
||||||
|
$this->form_validation->set_rules('PayableAT','PaymentTerms','trim|required');
|
||||||
|
|
||||||
|
|
||||||
if($this->form_validation->run() == FALSE)
|
if($this->form_validation->run() == FALSE)
|
||||||
@ -95,29 +131,39 @@ class supplier extends BaseController
|
|||||||
{
|
{
|
||||||
$SupplierName = ucwords(strtolower($this->input->post('SupplierName')));
|
$SupplierName = ucwords(strtolower($this->input->post('SupplierName')));
|
||||||
$Address = $this->input->post('Address');
|
$Address = $this->input->post('Address');
|
||||||
|
|
||||||
$ContactNumber = $this->input->post('ContactNumber');
|
$ContactNumber = $this->input->post('ContactNumber');
|
||||||
$AlternateContactNumber = $this->input->post('AlternateContactNumber');
|
$AlternateContactNumber = $this->input->post('AlternateContactNumber');
|
||||||
$EmailAddress = $this->input->post('EmailAddress');
|
$EmailAddress = $this->input->post('EmailAddress');
|
||||||
|
$Exiseregistration = $this->input->post('Exiseregistration');
|
||||||
$TIN = $this->input->post('TIN');
|
$TIN = $this->input->post('TIN');
|
||||||
$PAN = $this->input->post('PAN');
|
$PAN = $this->input->post('PAN');
|
||||||
|
$GSTNo = $this->input->post('GSTNo');
|
||||||
|
$GSTRange = $this->input->post('GSTRange');
|
||||||
|
$CollectrateAddress = $this->input->post('CollectrateAddress');
|
||||||
|
$UANumber = $this->input->post('UANumber');
|
||||||
|
$PaymentTerms = $this->input->post('PaymentTerms');
|
||||||
|
$PaymentDays = $this->input->post('PaymentDays');
|
||||||
|
$PayableAT = $this->input->post('PayableAT');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'PAN'=>$PAN,'createdDate'=>date('Y-m-d H:i:sa'));
|
$supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'Exiseregistration'=>$Exiseregistration,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$PaymentDays,'PayableAT'=>$PayableAT,'createdDate'=>date('Y-m-d H:i:sa'));
|
||||||
|
|
||||||
$this->load->model('supplier_model');
|
$this->load->model('supplier_model');
|
||||||
$result = $this->supplier_model->addNewsupplier($supplier);
|
$result = $this->supplier_model->addNewsupplier($supplier);
|
||||||
|
echo $supplier;
|
||||||
if($result > 0)
|
if($result > 0)
|
||||||
{
|
{
|
||||||
$this->session->set_flashdata('success', 'New Supplier created successfully');
|
$this->session->set_flashdata('success', 'New Supplier created successfully');
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->session->set_flashdata('error', 'Supplier Not Create');
|
$this->session->set_flashdata('error', 'Supplier Not Create');
|
||||||
}
|
}
|
||||||
|
|
||||||
redirect('addsupplier');
|
redirect('supplierListing');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -132,7 +178,7 @@ class supplier extends BaseController
|
|||||||
|
|
||||||
//$data['SupplierName'] = $this->purchaseorder_model->getSupplierName();
|
//$data['SupplierName'] = $this->purchaseorder_model->getSupplierName();
|
||||||
$data['supplier'] = $this->supplier_model->getUserInfo($supplierID);
|
$data['supplier'] = $this->supplier_model->getUserInfo($supplierID);
|
||||||
|
$data['payment'] = $this->supplier_model->getpayment();
|
||||||
$this->global['pageTitle'] = 'Siddharth : Edit Supplier';
|
$this->global['pageTitle'] = 'Siddharth : Edit Supplier';
|
||||||
|
|
||||||
$this->loadViews("editOldsupplier", $this->global,$data, NULL);
|
$this->loadViews("editOldsupplier", $this->global,$data, NULL);
|
||||||
@ -159,9 +205,16 @@ class supplier extends BaseController
|
|||||||
$this->form_validation->set_rules('ContactNumber','Contact Number','trim||numeric');
|
$this->form_validation->set_rules('ContactNumber','Contact Number','trim||numeric');
|
||||||
$this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim||numeric');
|
$this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim||numeric');
|
||||||
$this->form_validation->set_rules('EmailAddress','Email Address|valid_email|xss_clean|max_length[128]');
|
$this->form_validation->set_rules('EmailAddress','Email Address|valid_email|xss_clean|max_length[128]');
|
||||||
|
$this->form_validation->set_rules('Exiseregistration','Exiseregistration','trim|required');
|
||||||
$this->form_validation->set_rules('TIN','TIN','trim|required');
|
$this->form_validation->set_rules('TIN','TIN','trim|required');
|
||||||
$this->form_validation->set_rules('PAN','PAN','required');
|
$this->form_validation->set_rules('PAN','PAN','required');
|
||||||
|
$this->form_validation->set_rules('GSTNo','GST No','trim|required');
|
||||||
|
$this->form_validation->set_rules('GSTRange','GST Range','trim|required');
|
||||||
|
$this->form_validation->set_rules('CollectrateAddress','CollectrateAddress','trim|required');
|
||||||
|
$this->form_validation->set_rules('UANumber','UANumber','trim|required');
|
||||||
|
$this->form_validation->set_rules('PaymentTerms','PaymentTerms','trim|required');
|
||||||
|
$this->form_validation->set_rules('PaymentDays','PaymentTerms','trim|required');
|
||||||
|
$this->form_validation->set_rules('PayableAT','PaymentTerms','trim|required');
|
||||||
if($this->form_validation->run() == FALSE)
|
if($this->form_validation->run() == FALSE)
|
||||||
{
|
{
|
||||||
$this->editsupplier($supplierID);
|
$this->editsupplier($supplierID);
|
||||||
@ -174,23 +227,34 @@ class supplier extends BaseController
|
|||||||
$ContactNumber = $this->input->post('ContactNumber');
|
$ContactNumber = $this->input->post('ContactNumber');
|
||||||
$AlternateContactNumber = $this->input->post('AlternateContactNumber');
|
$AlternateContactNumber = $this->input->post('AlternateContactNumber');
|
||||||
$EmailAddress = $this->input->post('EmailAddress');
|
$EmailAddress = $this->input->post('EmailAddress');
|
||||||
|
$Exiseregistration = $this->input->post('Exiseregistration');
|
||||||
$TIN = $this->input->post('TIN');
|
$TIN = $this->input->post('TIN');
|
||||||
$PAN = $this->input->post('PAN');
|
$PAN = $this->input->post('PAN');
|
||||||
|
$GSTNo = $this->input->post('GSTNo');
|
||||||
|
$GSTRange = $this->input->post('GSTRange');
|
||||||
|
$CollectrateAddress = $this->input->post('CollectrateAddress');
|
||||||
|
$UANumber = $this->input->post('UANumber');
|
||||||
|
$PaymentTerms = $this->input->post('PaymentTerms');
|
||||||
|
$PaymentDays = $this->input->post('PaymentDays');
|
||||||
|
$PayableAT = $this->input->post('PayableAT');
|
||||||
|
|
||||||
$supplier = array();
|
|
||||||
|
$supplier = array();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(empty($ContactNumber))
|
if(empty($ContactNumber))
|
||||||
{
|
{
|
||||||
$supplier = array('SupplierID'=>$SupplierID,'SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'PAN'=>$PAN,'createdDate'=>date('Y-m-d H:i:sa'));
|
$supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'Exiseregistration'=>$Exiseregistration,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$PaymentDays,'PayableAT'=>$PayableAT,'createdDate'=>date('Y-m-d H:i:sa'));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'PAN'=>$PAN,'createdDate'=>date('Y-m-d H:i:sa'));
|
$supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'Exiseregistration'=>$Exiseregistration,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$PaymentDays,'PayableAT'=>$PayableAT,'createdDate'=>date('Y-m-d H:i:sa'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->supplier_model->editsupplier($supplier, $supplierID);
|
$result = $this->supplier_model->editsupplier($supplier, $supplierID);
|
||||||
|
|
||||||
|
|
||||||
|
echo $PaymentDays;
|
||||||
if($result == true)
|
if($result == true)
|
||||||
{
|
{
|
||||||
$this->session->set_flashdata('success', 'supplier updated successfully');
|
$this->session->set_flashdata('success', 'supplier updated successfully');
|
||||||
@ -221,28 +285,7 @@ class supplier extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function is used to delete the user using userId
|
|
||||||
* @return boolean $result : TRUE / FALSE
|
|
||||||
|
|
||||||
function deleteUser()
|
|
||||||
{
|
|
||||||
if($this->isAdmin() == TRUE)
|
|
||||||
{
|
|
||||||
echo(json_encode(array('status'=>'access')));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$userId = $this->input->post('userId');
|
|
||||||
$userInfo = array('isDeleted'=>1,'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:sa'));
|
|
||||||
|
|
||||||
$result = $this->user_model->deleteUser($userId, $userInfo);
|
|
||||||
|
|
||||||
if ($result > 0) { echo(json_encode(array('status'=>TRUE))); }
|
|
||||||
else { echo(json_encode(array('status'=>FALSE))); }
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
function pageNotFound()
|
function pageNotFound()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -9,7 +9,7 @@ class supplier_model extends CI_Model
|
|||||||
*/
|
*/
|
||||||
function supplierListingCount($searchText = '')
|
function supplierListingCount($searchText = '')
|
||||||
{
|
{
|
||||||
$this->db->select('BaseT.SupplierID, BaseT.SupplierName, BaseT.Address, BaseT.ContactNumber, BaseT.AlternateContactNumber,BaseT.EmailAddress,BaseT.TIN,BaseT.PAN');
|
$this->db->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.PaymentTerms,BaseT.PaymentDays,BaseT.PayableAT');
|
||||||
$this->db->from('T_SupplierDetailsN as BaseT');
|
$this->db->from('T_SupplierDetailsN as BaseT');
|
||||||
//$this->db->join('tbl_users as users', 'users.userId = BaseT.userId','left');
|
//$this->db->join('tbl_users as users', 'users.userId = BaseT.userId','left');
|
||||||
//$this->db->join('T_SupplierDetails as ID', 'ID.SupplierID = BaseT.SupplierID','left');
|
//$this->db->join('T_SupplierDetails as ID', 'ID.SupplierID = BaseT.SupplierID','left');
|
||||||
@ -20,8 +20,16 @@ class supplier_model extends CI_Model
|
|||||||
OR BaseT.ContactNumber LIKE '%".$searchText."%'
|
OR BaseT.ContactNumber LIKE '%".$searchText."%'
|
||||||
OR BaseT.AlternateContactNumber LIKE '%".$searchText."%'
|
OR BaseT.AlternateContactNumber LIKE '%".$searchText."%'
|
||||||
OR BaseT.EmailAddress LIKE '%".$searchText."%'
|
OR BaseT.EmailAddress LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.Exiseregistration LIKE '%".$searchText."%'
|
||||||
OR BaseT.TIN LIKE '%".$searchText."%'
|
OR BaseT.TIN LIKE '%".$searchText."%'
|
||||||
OR BaseT.PAN LIKE '%".$searchText."%')";
|
OR BaseT.PAN LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.GSTNO LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.GSTRange LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.CollectrateAddress LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.UANumber LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.PaymentTerms LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.PaymentDays LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.PayableAT LIKE '%".$searchText."%')";
|
||||||
$this->db->where($likeCriteria);
|
$this->db->where($likeCriteria);
|
||||||
}
|
}
|
||||||
//$this->db->where('BaseT.isDeleted', 0);
|
//$this->db->where('BaseT.isDeleted', 0);
|
||||||
@ -39,7 +47,7 @@ class supplier_model extends CI_Model
|
|||||||
*/
|
*/
|
||||||
function supplierListing($searchText = '', $page, $segment)
|
function supplierListing($searchText = '', $page, $segment)
|
||||||
{
|
{
|
||||||
$this->db->select('BaseT.SupplierID, BaseT.SupplierName, BaseT.Address, BaseT.ContactNumber, BaseT.AlternateContactNumber,BaseT.EmailAddress, BaseT.TIN, BaseT.PAN,BaseT.CreatedDate');
|
$this->db->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.PaymentTerms,BaseT.PaymentDays,BaseT.PayableAT,BaseT.CreatedDate');
|
||||||
$this->db->from('T_SupplierDetailsN as BaseT');
|
$this->db->from('T_SupplierDetailsN as BaseT');
|
||||||
//$this->db->join('tbl_users as users', 'users.userId = BaseT.userId','left');
|
//$this->db->join('tbl_users as users', 'users.userId = BaseT.userId','left');
|
||||||
//$this->db->join('T_SupplierDetails as ID', 'ID.SupplierID = BaseT.SupplierID','left');
|
//$this->db->join('T_SupplierDetails as ID', 'ID.SupplierID = BaseT.SupplierID','left');
|
||||||
@ -50,9 +58,17 @@ class supplier_model extends CI_Model
|
|||||||
OR BaseT.ContactNumber LIKE '%".$searchText."%'
|
OR BaseT.ContactNumber LIKE '%".$searchText."%'
|
||||||
OR BaseT.AlternateContactNumber LIKE '%".$searchText."%'
|
OR BaseT.AlternateContactNumber LIKE '%".$searchText."%'
|
||||||
OR BaseT.EmailAddress LIKE '%".$searchText."%'
|
OR BaseT.EmailAddress LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.Exiseregistration LIKE '%".$searchText."%'
|
||||||
OR BaseT.TIN LIKE '%".$searchText."%'
|
OR BaseT.TIN LIKE '%".$searchText."%'
|
||||||
OR BaseT.CreatedDate LIKE '%".$searchText."%'
|
OR BaseT.CreatedDate LIKE '%".$searchText."%'
|
||||||
OR BaseT.PAN LIKE '%".$searchText."%')";
|
OR BaseT.PAN LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.GSTNO LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.GSTRange LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.CollectrateAddress LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.UANumber LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.PaymentTerms LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.PaymentDays LIKE '%".$searchText."%'
|
||||||
|
OR BaseT.PayableAT LIKE '%".$searchText."%')";
|
||||||
$this->db->where($likeCriteria);
|
$this->db->where($likeCriteria);
|
||||||
}
|
}
|
||||||
//$this->db->where('BaseT.isDeleted', 0);
|
//$this->db->where('BaseT.isDeleted', 0);
|
||||||
@ -69,6 +85,39 @@ class supplier_model extends CI_Model
|
|||||||
* @return array $result : This is user information
|
* @return array $result : This is user information
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function getpayment()
|
||||||
|
{
|
||||||
|
$ConfigID = 'C009';
|
||||||
|
$this->db->select('ConfigValue');
|
||||||
|
$this->db->from('T_ConfigDetails');
|
||||||
|
$this->db->where('Config_id ',$ConfigID );
|
||||||
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function checkPAN($PAN)
|
||||||
|
{
|
||||||
|
$this->db->select('PAN');
|
||||||
|
$this->db->from('T_SupplierDetailsN');
|
||||||
|
$this->db->where('PAN',$PAN);
|
||||||
|
|
||||||
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
if ($query->num_rows > 0) {
|
||||||
|
//echo $result->num_rows;
|
||||||
|
return $query->result_array();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function addNewsupplier($supplier)
|
function addNewsupplier($supplier)
|
||||||
{
|
{
|
||||||
$this->db->trans_start();
|
$this->db->trans_start();
|
||||||
@ -88,7 +137,7 @@ function addNewsupplier($supplier)
|
|||||||
*/
|
*/
|
||||||
function getuserInfo($supplierID)
|
function getuserInfo($supplierID)
|
||||||
{
|
{
|
||||||
$this->db->select('SupplierID, SupplierName,Address,ContactNumber,AlternateContactNumber,EmailAddress,TIN,PAN,CreatedDate');
|
$this->db->select('SupplierID, SupplierName,Address,ContactNumber,AlternateContactNumber,Exiseregistration,EmailAddress,TIN,PAN,,GSTNO,GSTRange,CollectrateAddress,UANumber,PaymentTerms,PaymentDays,PayableAT,CreatedDate');
|
||||||
$this->db->from('T_SupplierDetailsN');
|
$this->db->from('T_SupplierDetailsN');
|
||||||
//$this->db->where('isDeleted', 0);
|
//$this->db->where('isDeleted', 0);
|
||||||
//$this->db->where('roleId !=', 1);
|
//$this->db->where('roleId !=', 1);
|
||||||
@ -121,17 +170,10 @@ function addNewsupplier($supplier)
|
|||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* This function is used to delete the user information
|
|
||||||
* @param number $userId : This is user id
|
|
||||||
* @return boolean $result : TRUE / FALSE
|
|
||||||
|
|
||||||
function deletePO($PO, $POinfo)
|
}
|
||||||
{
|
|
||||||
$this->db->where('PO', $PO);
|
|
||||||
$this->db->update('T_PurchaseOrderDetails', $POInfo);
|
|
||||||
|
|
||||||
return $this->db->affected_rows();
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
@ -2,15 +2,15 @@
|
|||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1>
|
<h1>
|
||||||
<center> SUPPLIER LIST</center>
|
<center> ADD SUPPLIER </center>
|
||||||
|
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div style="text-align:right;">
|
<div style="text-align:left;">
|
||||||
<a href="<?php echo base_url() ?>supplierListing" class="btn btn-info" value="Back"/>Back</a>
|
<a href="<?php echo base_url() ?>supplierListing" class="btn btn-primary" value="Back"/>Back</a>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -26,64 +26,151 @@
|
|||||||
</div><!-- /.box-header -->
|
</div><!-- /.box-header -->
|
||||||
<!-- form start -->
|
<!-- form start -->
|
||||||
|
|
||||||
<form role="form" id="addUser" action="<?php echo base_url() ?>addNewsupplier" method="post" role="form">
|
<form role="form" id="addsupplier" action="<?php echo base_url() ?>addNewsupplier" method="post" role="form">
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6 col-xs-6">
|
||||||
|
<div class="form">
|
||||||
|
<label for="PAN">PAN</label>
|
||||||
|
<input type="text" class="form-control" id="PAN" name="PAN" onchange="validatePAN()"title="please correct enter the pan number"maxlength="10">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 col-xs-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="SupplierName">Supplier Name</label>
|
<label for="SupplierName">Supplier Name</label>
|
||||||
<input type="text" class="form-control required" id="SupplierName" name="SupplierName" maxlength="128">
|
<input type="text" class="form-control " id="SupplierName" onchange="validatesuppliername()"name="SupplierName" maxlength="128" >
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
|
||||||
|
<div class="col-md-6 col-xs-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="Address">Address</label>
|
<label for="Address2">Address</label>
|
||||||
<input type="text" class="form-control required" id="Address" name="Address" maxlength="255">
|
<input type="text" class="form-control required" id="Address" name="Address" maxlength="250"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6">
|
|
||||||
|
|
||||||
|
<div class="col-md-6 col-xs-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="ContactNumber">Contact Number</label>
|
<label for="ContactNumber">Contact Number</label>
|
||||||
<input type="text" class="form-control required digits" id="ContactNumber" name="ContactNumber" minlength="10" maxlength="10">
|
<input type="text" class="form-control" onchange="validatenumbers()" id="number" title="please enter valid phone number" name="ContactNumber" minlength="10" maxlength="11">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6 col-xs-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="AlternateContactNumber">Alternate Contact Number</label>
|
<label for="AlternateContactNumber">Alternate Contact Number</label>
|
||||||
<input type="text" class="form-control required digits" id="AlternateContactNumber" name="AlternateContactNumber" minlength="10" maxlength="10">
|
<input type="tel" class="form-control" pattern="[0-9]{11}" id="Number" name="AlternateContactNumber" minlength="10" maxlength="11">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6 col-xs-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="EmailAddress">Email Address</label>
|
<label for="EmailAddress">Email Address</label>
|
||||||
<input type="email" class="form-control required email" id="EmailAddress" name="EmailAddress" maxlength="128">
|
<input type="email" class="form-control required email" id="EmailAddress" onchange="validateEmail()"name="EmailAddress" maxlength="128">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6 col-xs-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="Exiseregistration">Exise Registration</label>
|
||||||
|
<input type="text" class="form-control required" id="Exiseregistration" name="Exiseregistration" minlength="10" maxlength="10">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 col-xs-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="TIN">TIN</label>
|
<label for="TIN">TIN</label>
|
||||||
<input type="text" class="form-control required" id="TIN" name="TIN" minlength="10" maxlength="10">
|
<input type="text" class="form-control required" id="TIN" name="TIN" minlength="10" maxlength="10">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="form">
|
|
||||||
<label for="PAN">PAN</label>
|
|
||||||
<input type="text" pattern="(?=.*[A-Z]).{5,}(?=.*[0-9]).{4,}(?=.*[A-Z]).{1,}" class="form-control required" id="PAN" name="PAN" title="please correct enter the pan number"maxlength="10">
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 col-xs-6">
|
||||||
|
<div class="form">
|
||||||
|
<label for="GSTNo">GST No</label>
|
||||||
|
<input type="text" class="form-control " id="GSTNo" name="GSTNo" maxlength="10">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-6 col-xs-6">
|
||||||
|
<div class="form">
|
||||||
|
<label for="Range">Range</label>
|
||||||
|
<input type="text" class="form-control " id="Range" name="GSTRange" "maxlength="10">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 col-xs-6">
|
||||||
|
<div class="form">
|
||||||
|
<label for="CollectrateAddress">Colletrate Address</label>
|
||||||
|
<input type="text" class="form-control " id="CollectrateAddress" name="CollectrateAddress" maxlength="255">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 col-xs-6">
|
||||||
|
<div class="form">
|
||||||
|
<label for="UANumber">UA Number</label>
|
||||||
|
<input type="text" class="form-control " id="UANumber" name="UANumber" maxlength="10">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-offset-5 col-md-3 col-xs-offset-5 col-xs-3">
|
||||||
|
<h4><u>Payment terms </u></h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 col-xs-6">
|
||||||
|
<label for="payablefrom">Payable From</label>
|
||||||
|
<select class="form-control required" id="PaymentTerms" name="PaymentTerms">
|
||||||
|
<option value="0">Select Payment method</option>
|
||||||
|
<?php
|
||||||
|
if(!empty($payment))
|
||||||
|
{
|
||||||
|
foreach ($payment as $rl)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3 col-xs-6">
|
||||||
|
<div class="form">
|
||||||
|
<label for="PaymentDays">Payment Date</label><br/>
|
||||||
|
<span> Before</span>
|
||||||
|
<input type="radio" name="PaymentDays" value="before"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 col-xs-6">
|
||||||
|
<div class="form">
|
||||||
|
|
||||||
|
<span> After</span>
|
||||||
|
<input type="radio" name="PaymentDays" value="after"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 col-xs-6">
|
||||||
|
<div class="form">
|
||||||
|
<label for="PayableAT">Payable AT</label>
|
||||||
|
<input type="text" class="form-control required" id="PayableAT" name="PayableAT" maxlength="10">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div><!-- /.box-body -->
|
</div><!-- /.box-body -->
|
||||||
|
|
||||||
<div class="box-footer" style="text-align:right">
|
<div class="box-footer" style="text-align:right">
|
||||||
<input type="submit" class="btn btn-info" value="Submit" />
|
<input type="submit" class="btn btn-primary" value="Submit" />
|
||||||
<input type="reset" class="btn btn-info" value="Cancel" />
|
<input type="reset" class="btn btn-primary" value="Reset" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@ -121,4 +208,106 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script src="<?php echo base_url(); ?>assets/js/addUser.js" type="text/javascript"></script>
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
//Call to ajax existing PAN
|
||||||
|
$('#PAN').change(function() {
|
||||||
|
|
||||||
|
var id = $('#PAN').val();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
data:{id:id},
|
||||||
|
|
||||||
|
type:"POST",
|
||||||
|
url:"<?php echo base_url();?>supplier/checkPAN",
|
||||||
|
success:function(data) {
|
||||||
|
if(data)
|
||||||
|
{
|
||||||
|
alert( data+""+" already supplier existing change Status");
|
||||||
|
window.location = 'supplier/supplierListing';
|
||||||
|
|
||||||
|
//$('#PAN').val(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
//Email Validate
|
||||||
|
function validateEmail() {
|
||||||
|
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
||||||
|
|
||||||
|
var email = $('#EmailAddress').val();
|
||||||
|
if(email != "")
|
||||||
|
{
|
||||||
|
if (reg.test(email) == false)
|
||||||
|
{
|
||||||
|
alert('Please Enter Valid Email Address');
|
||||||
|
return (false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//PAN Validate
|
||||||
|
function validatePAN() {
|
||||||
|
var reg = /^(?=.*[A-Z]).{5,}(?=.*[0-9]).{4,}(?=.*[A-Z]).{1,}$/;
|
||||||
|
|
||||||
|
var PAN = $('#PAN').val();
|
||||||
|
if(PAN != "")
|
||||||
|
{
|
||||||
|
if (reg.test(PAN) == false)
|
||||||
|
{
|
||||||
|
alert('Please Enter Valid PAN Number');
|
||||||
|
return (false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Validate Supplier Name
|
||||||
|
function validatesuppliername() {
|
||||||
|
var reg = /^[A-Za-z ]{3,30}$/;
|
||||||
|
|
||||||
|
var suppliername = $('#SupplierName').val();
|
||||||
|
if(suppliername != "")
|
||||||
|
{
|
||||||
|
if (reg.test(suppliername) == false)
|
||||||
|
{
|
||||||
|
alert('Please Enter Valid Supplier Name');
|
||||||
|
return (false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function validatenumbers() {
|
||||||
|
var reg = /^[0-9]{10,11}$/
|
||||||
|
|
||||||
|
var number = $('#number').val();
|
||||||
|
if(number != "")
|
||||||
|
{
|
||||||
|
if (reg.test(number) == false)
|
||||||
|
{
|
||||||
|
alert('Please Enter Valid Number');
|
||||||
|
return (false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 text-right">
|
<div class="col-xs-12 text-right">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<a class="btn btn-primary" href="<?php echo base_url(); ?>addsupplier">AddNew</a>
|
<a class="btn btn-info" href="<?php echo base_url(); ?>addsupplier">AddNew</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -39,8 +39,16 @@
|
|||||||
<th>Contact Number</th>
|
<th>Contact Number</th>
|
||||||
<th>Alternate Contact Number</th>
|
<th>Alternate Contact Number</th>
|
||||||
<th>Email Address</th>
|
<th>Email Address</th>
|
||||||
|
<th>Exiseregistration</th>
|
||||||
<th>TIN</th>
|
<th>TIN</th>
|
||||||
<th>PAN</th>
|
<th>PAN</th>
|
||||||
|
<th>GSTNO</th>
|
||||||
|
<th>GSTRange</th>
|
||||||
|
<th>CollectrateAddress</th>
|
||||||
|
<th>UANumber</th>
|
||||||
|
<th>PaymentTerms</th>
|
||||||
|
<th>PaymentDays</th>
|
||||||
|
<th>PayableAT</th>
|
||||||
<th>Create Date</th>
|
<th>Create Date</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
|
|
||||||
@ -58,8 +66,16 @@
|
|||||||
<td><?php echo $record->ContactNumber ?></td>
|
<td><?php echo $record->ContactNumber ?></td>
|
||||||
<td><?php echo $record->AlternateContactNumber ?></td>
|
<td><?php echo $record->AlternateContactNumber ?></td>
|
||||||
<td><?php echo $record->EmailAddress ?></td>
|
<td><?php echo $record->EmailAddress ?></td>
|
||||||
|
<td><?php echo $record->Exiseregistration ?></td>
|
||||||
<td><?php echo $record->TIN ?></td>
|
<td><?php echo $record->TIN ?></td>
|
||||||
<td><?php echo $record->PAN ?></td>
|
<td><?php echo $record->PAN ?></td>
|
||||||
|
<td><?php echo $record->GSTNO ?></td>
|
||||||
|
<td><?php echo $record->GSTRange ?></td>
|
||||||
|
<td><?php echo $record->CollectrateAddress ?></td>
|
||||||
|
<td><?php echo $record->UANumber ?></td>
|
||||||
|
<td><?php echo $record->PaymentTerms ?></td>
|
||||||
|
<td><?php echo $record->PaymentDays ?></td>
|
||||||
|
<td><?php echo $record->PayableAT ?></td>
|
||||||
<td><?php echo $record->CreatedDate ?></td>
|
<td><?php echo $record->CreatedDate ?></td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@ -8,7 +8,13 @@ $AlternateContactNumber = '';
|
|||||||
$EmailAddress = '';
|
$EmailAddress = '';
|
||||||
$TIN = '';
|
$TIN = '';
|
||||||
$PAN = '';
|
$PAN = '';
|
||||||
|
$GSTNO = '';
|
||||||
|
$GSTRange = '';
|
||||||
|
$CollectrateAddress = '';
|
||||||
|
$UANumber = '';
|
||||||
|
$PaymentTerms = '';
|
||||||
|
$PaymentDays = '';
|
||||||
|
$PayableAT = '';
|
||||||
if(!empty($supplier))
|
if(!empty($supplier))
|
||||||
{
|
{
|
||||||
foreach ($supplier as $uf)
|
foreach ($supplier as $uf)
|
||||||
@ -21,6 +27,13 @@ if(!empty($supplier))
|
|||||||
$EmailAddress = $uf->EmailAddress;
|
$EmailAddress = $uf->EmailAddress;
|
||||||
$TIN = $uf->TIN;
|
$TIN = $uf->TIN;
|
||||||
$PAN = $uf->PAN;
|
$PAN = $uf->PAN;
|
||||||
|
$GSTNO = $uf->GSTNO;
|
||||||
|
$GSTRange = $uf->GSTRange;
|
||||||
|
$CollectrateAddress = $uf->CollectrateAddress;
|
||||||
|
$UANumber = $uf->UANumber;
|
||||||
|
$PaymentTerms = $uf->PaymentTerms;
|
||||||
|
$PaymentDays = $uf->PaymentDays;
|
||||||
|
$PayableAT = $uf->PayableAT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,10 +129,44 @@ window.print();
|
|||||||
<tr>
|
<tr>
|
||||||
<td> <label for="PAN">PAN</label></td>
|
<td> <label for="PAN">PAN</label></td>
|
||||||
<td><?php echo $PAN; ?></td>
|
<td><?php echo $PAN; ?></td>
|
||||||
</div>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
</tr>
|
<td> <label for="GSTNO">GST NO</label></td>
|
||||||
|
<td><?php echo $GSTNO; ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> <label for="GSTRange">GST Range</label></td>
|
||||||
|
<td><?php echo $GSTRange; ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> <label for="CollectrateAddress">Collectrate Address</label></td>
|
||||||
|
<td><?php echo $CollectrateAddress; ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> <label for="UANumber">UA Number</label></td>
|
||||||
|
<td><?php echo $UANumber; ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> <label for="PaymentTerms">Payment Terms</label></td>
|
||||||
|
<td><?php echo $PaymentTerms; ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> <label for="PaymentDays">Payment Days</label></td>
|
||||||
|
<td><?php echo $PaymentDays; ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> <label for="PayableAT">Payable AT</label></td>
|
||||||
|
<td><?php echo $PayableAT; ?></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</table>
|
</table>
|
||||||
</div><!-- /.box-body -->
|
</div><!-- /.box-body -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user