diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 419cc62b..34f5d776 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -975,11 +975,11 @@ function GetCurrencytype() * @return array $result : This is result of the query join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode */ - function getPOList($q) + function getPOList($Amendment) { $this->db->distinct(); - $this->db->select('mast.PONO,mast.TotalOrderValue,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,rmast.ReqType,bud.BudgetAmount,mast.Remarks'); + $this->db->select('mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,mast.POType as ReqType,bud.BudgetAmount,mast.Remarks'); $this->db->from('T_PurchaseOrder_Master mast'); $this->db->join('T_Status st', 'st.StatusCode=mast.Status'); $this->db->join('tbl_users tbl', 'mast.createdby=tbl.userid'); @@ -988,19 +988,21 @@ function GetCurrencytype() $this->db->join('T_Requestion_Master rmast','rmast.ReqNo=req.ReqNo'); $this->db->join('T_CostCenter_Budget bud','bud.CostCenterCode = req.CostCenterCode and bud.BudgetType = rmast.ReqType'); $this->db->join('T_CostCenter_Master ccm','ccm.CostCenterCode = req.CostCenterCode and ccm.CostCenterCode = bud.CostCenterCode'); - $this->db->where('mast.Status','ST030'); // EMERGENGY PO - if($q=='A'){ - $this->db->where('mast.Status','ST015');//PO CREATED - $this->db->or_where('mast.Status','ST020');//ON HOLD - $this->db->or_where('mast.Status','ST025');// PO APPROVED - $this->db->or_where('mast.Status','ST026');//PO RELEASED - $this->db->or_where('mast.Status','ST024'); // EMERGENGY PO + // $this->db->where('mast.Status',PO_AMENDED); // EMERGENGY PO + if($Amendment=='A'){ //A- Approved + $this->db->or_where('mast.Status',PO_CREATED);//PO CREATED + $this->db->or_where('mast.Status',PO_ONHOLD);//ON HOLD + $this->db->or_where('mast.Status',PO_AWAITING_RELEASE);// PO APPROVED + $this->db->or_where('mast.Status',PO_RELEASED);//PO RELEASED + $this->db->or_where('mast.Status',REQITEM_Emergency_PO_CREATED); // EMERGENGY PO + // $this->db->or_where('mast.Status',PO_AMENDED); // EMERGENGY PO } - else if($q=='R'){ - $this->db->or_where('mast.Status','ST025');// PO APPROVED + else if($Amendment=='R'){ // R -RELEASED + $this->db->or_where('mast.Status',PO_AWAITING_RELEASE);// PO APPROVED + $this->db->or_where('mast.Status',PO_RELEASED); } $result=$this->db->get(); - // print_r($result->result()); + // print_r($this->db->last_query()); return $result->result();