Requisition Form Fixes : ps

This commit is contained in:
VE10-Sanjeev 2023-06-12 17:43:44 +05:30
parent 2c830802fc
commit 22f0df4cf1
2 changed files with 18 additions and 15 deletions

View File

@ -29,6 +29,7 @@ class requisitionform extends BaseController
*/ */
function requisitionlisting() function requisitionlisting()
{ {
log_message('error'," Requisition Listing Fns Called");
$this->global['pageTitle'] = 'Siddharth : Requisition Listing'; $this->global['pageTitle'] = 'Siddharth : Requisition Listing';
$userID = $this->session->userdata ( 'userId' ); $userID = $this->session->userdata ( 'userId' );
@ -38,9 +39,9 @@ class requisitionform extends BaseController
$data['TotNoOfLine'] =$this->requistion_model->getRequistionList($userID); $data['TotNoOfLine'] =$this->requistion_model->getRequistionList($userID);
// print_r($data['TotNoOfLine']);
$this->loadViews("requisitionlisting", $this->global, $data, NULL); $this->loadViews("requisitionlisting", $this->global, $data, NULL);
@ -51,6 +52,7 @@ class requisitionform extends BaseController
function requisition() function requisition()
{ {
log_message('error'," Raise Requisition Fns Called");
$this->global['pageTitle'] = 'Siddharth : Raise Requisition'; $this->global['pageTitle'] = 'Siddharth : Raise Requisition';
$data['RequestType'] = $this->requistion_model->getConfigValue('C020'); $data['RequestType'] = $this->requistion_model->getConfigValue('C020');
@ -58,6 +60,7 @@ class requisitionform extends BaseController
$data['EmpList'] = $this->requistion_model->getAllEmployees(); $data['EmpList'] = $this->requistion_model->getAllEmployees();
$data['ServiceOption'] = $this->requistion_model->getConfigValue('C022'); $data['ServiceOption'] = $this->requistion_model->getConfigValue('C022');
$userID = $this->session->userdata ( 'userId' ); $userID = $this->session->userdata ( 'userId' );
log_message('error'," Raise Requisition userId ".$userID);
$data['Emp'] = $this->requistion_model->getEmpIdByUserID($userID); $data['Emp'] = $this->requistion_model->getEmpIdByUserID($userID);
@ -352,6 +355,7 @@ class requisitionform extends BaseController
function addNewRequistion() function addNewRequistion()
{ {
log_message('error'," add new Requisition Fns Called");
$this->form_validation->set_rules('RequestType','RequestType','trim|required'); $this->form_validation->set_rules('RequestType','RequestType','trim|required');
$this->form_validation->set_rules('EmpID','EmpID','trim|required'); $this->form_validation->set_rules('EmpID','EmpID','trim|required');
@ -361,9 +365,11 @@ class requisitionform extends BaseController
} }
else else
{ {
$Status= $_GET['ID']; log_message('error'," add new Requisition (Code of REQ_DRAFT) GET[ID] ".$_GET['ID']);REQ_DRAFT
$Status= $_GET['ID'];
$RequestType = strtoupper(trim($this->input->post('RequestType'))); $RequestType = strtoupper(trim($this->input->post('RequestType')));
$Requestedby = strtoupper(trim($this->input->post('EmpID'))); $Requestedby = strtoupper(trim($this->input->post('EmpID')));
log_message('error'," add new Requisition empid ".$Requestedby);
$RequestedbyDept = $this->session->userdata ( 'DEPCode' ); $RequestedbyDept = $this->session->userdata ( 'DEPCode' );
$CostCenter = $this->input->post('CostCenter'); $CostCenter = $this->input->post('CostCenter');
$CreateBy = $this->session->userdata ( 'userId' ); $CreateBy = $this->session->userdata ( 'userId' );

View File

@ -359,21 +359,18 @@ ifnull(Po.Quantity,0) as POQTY,sta.StatusName
*/ */
function addRequistion($Requistion) function addRequistion($Requistion)
{ {
// $this->db->trans_start(); $this->db->trans_start();
// $this->db->insert('T_Requestion_Master', $Requistion); $this->db->insert('T_Requestion_Master', $Requistion);
// $insert_id = $this->db->affected_rows(); $insert_id = $this->db->affected_rows();
// $this->db->trans_complete(); $this->db->trans_complete();
$insert_id = 1; log_message('error','add new Requisition affected rows = '.$insert_id);
if($insert_id>0) if($insert_id>0)
{ {
// $subQuery = 'select max(ReqNo) as ReqNo from T_Requestion_Master'; // $subQuery = 'select max(ReqNo) as ReqNo from T_Requestion_Master';
$subQuery = 'select ReqNo from T_Requestion_Master order by CreatedDate desc limit 1'; $subQuery = 'select ReqNo from T_Requestion_Master order by CreatedDate desc limit 1';
$query = $this->db->query($subQuery);
$query = $this->db->query($subQuery); return $query->result_array();
return $query->result_array();
} }
} }
/** /**
* This function is used to check the Request is in Draft status * This function is used to check the Request is in Draft status