From c23fa3aae22a082d77a78a00af34e4dbe0605af7 Mon Sep 17 00:00:00 2001 From: gandhimathi Bharathirajan Date: Mon, 24 Jul 2017 21:50:27 +0530 Subject: [PATCH] Status Update view changes --- application/models/purchaseorder_model.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index a8aac133..ab165e75 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -4,10 +4,15 @@ class purchaseorder_model extends CI_Model { function GetServicePOListforStatusUpdate() { - $this->db->select('*'); - $this->db->from('T_PurchaseOrder_Master'); - $this->db->where('POType',SERVICE); - $this->db->where('status',PO_RELEASED); + $this->db->distinct(); + $this->db->select('PO.PONO'); + $this->db->from('T_PurchaseOrder_Master PO'); + $this->db->Join('T_PurchaseOrder_LineItem Line','PO.PONO = Line.PONO'); + $this->db->Join('T_Requestion_Master Req','Req.ReqNo = Line.ReqNo'); + $this->db->Join('T_Employee_Details Emp','Emp.EmpID= Req.Requestedby'); + $this->db->where('PO.POType',SERVICE); + $this->db->where('PO.status',PO_RELEASED); + $this->db->where('Emp.Departmentcode',$this->session->userdata('DEPCode')); $query = $this->db->get(); return $query->result();