From 943124e68f530751d82641252ede78b1cdc9e82d Mon Sep 17 00:00:00 2001 From: gandhimathi Bharathirajan Date: Fri, 9 Jun 2017 12:23:43 +0530 Subject: [PATCH] Requistion Fixes by Raja" --- application/models/purchaseorder_model.php | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 3a3045a7..39de822e 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -99,10 +99,27 @@ class purchaseorder_model extends CI_Model { return $result->result(); } - } - + } } + + /** + This Function to get the List of Requistion which require to create PO + */ + function getAllRequistionListToCreatePO() + { + $result = $this->db-> query("CALL P_PURCHASEORDER_DETAILS()") or die(mysql_error()); + + $result ->next_result(); + + + if ($result->num_rows > 0) + { + + return $result->result(); + } + } + /** * This function is used to get the Raw Material information * @return array $result : This is result of the query @@ -632,7 +649,7 @@ class purchaseorder_model extends CI_Model function getRequistionListbySearch($Depid='',$Status='',$FromDate='',$ToDate='') { $subQuery =' SELECT ReqNo,ReqType,Requestedby,EMP.FirstName,EMP.Designation,STAT.StatusCode ,STAT.StatusName,ReqDate,DEPT.DEPCode,DEPT.DepartmentName FROM T_Requestion_Master REQ - JOI T_Employee_Details EMP ON REQ.Requestedby = EMP.EmpID + JOIN T_Employee_Details EMP ON REQ.Requestedby = EMP.EmpID JOIN T_DepartmentDetails DEPT ON EMP.Departmentcode = DEPT.DEPCode JOIN T_Status STAT on REQ.Status = STAT.StatusCode where REQ.Status NOT IN (?,?,?,?,?)'; @@ -642,7 +659,7 @@ class purchaseorder_model extends CI_Model if($Depid != '' && $Status != '' && $FromDate != '' && $ToDate != '') { $appendQuery .= ' AND DEPT.DEPCode=? AND STAT.StatusCode=? AND ReqDate >= ? AND ReqDate <= ?'; - echo "$appendQuery";die(); + //echo "$appendQuery";die(); $query = $this->db->query($appendQuery,array(REQ_DRAFT,REQ_PENDING_APPROVAL,REQ_DELETED,REQ_REJECTED,REQ_PO_CREATED,$Depid ,$Status,$FromDate,$ToDate)); //print_r($this->db->last_query()); return $query->result_array();