diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 9c65ae6b..eaebca83 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -1936,7 +1936,7 @@ function addNewImportPurchaseOrder() /* All Function following This command for FINANCE TEAM PO APPROVAL SCREEN*/ function poapproval(){ - $q="A"; + $q="APPROVAL"; $this->global['pageTitle'] = 'Siddharth : Purchase Order Approval'; // $data['Status']= $this->purchaseorder_model->getStatus(); $userID = $this->session->userdata ( 'userId' ); @@ -1992,7 +1992,7 @@ function addNewImportPurchaseOrder() function porelease(){ - $q="R"; + $q="RELEASE"; $this->global['pageTitle'] = 'Siddharth : Purchase Order Release'; // $data['Status']= $this->purchaseorder_model->getStatus(); $userID = $this->session->userdata ( 'userId' ); diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index fc173526..4d25ffba 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -1244,7 +1244,7 @@ function GetCurrencytype() * @return array $result : This is result of the query join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode */ - function getPOList($Amendment) + function getPOList($type) { $this->db->distinct(); @@ -1261,20 +1261,24 @@ function GetCurrencytype() $this->db->join('tbl_users tbl', 'rmast.createdby=tbl.userid'); $this->db->join('T_Employee_Details as emp', 'emp.empid=tbl.empid'); $this->db->join('T_DepartmentDetails as Dep','Dep.DEPCode=emp.Departmentcode'); - // $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 + + if($type=='APPROVAL'){ + $this->db->or_where('mast.Status',PO_CREATED); + $this->db->or_where('mast.Status',PO_APPROVER_ONHOLD); + $this->db->or_where('mast.Status',PO_AWAITING_RELEASE); + $this->db->or_where('mast.Status',PO_RELEASED); $this->db->or_where('mast.Status',REQITEM_Emergency_PO_CREATED); - $this->db->order_by('mast.Status'); // EMERGENGY PO - // $this->db->or_where('mast.Status',PO_AMENDED); // EMERGENGY PO + $this->db->order_by('mast.Status'); + } - else if($Amendment=='R'){ // R -RELEASED - $this->db->or_where('mast.Status',PO_AWAITING_RELEASE);// PO APPROVED + else if($type=='RELEASE'){ + $this->db->or_where('mast.Status',PO_AWAITING_RELEASE); + $this->db->or_where('mast.Status',PO_RELEASER_ONHOLD); $this->db->or_where('mast.Status',PO_RELEASED); - $this->db->order_by('mast.Status','asc'); + $this->db->order_by('mast.Status'); + + + } $result=$this->db->get(); // print_r($this->db->last_query()); diff --git a/application/views/poapproval_view.php b/application/views/poapproval_view.php index 251ca8d0..66bc5fd4 100755 --- a/application/views/poapproval_view.php +++ b/application/views/poapproval_view.php @@ -74,7 +74,7 @@ if(empty($Status)) echo $CreatedDate; ?> StatusName ?> - StatusCode == PO_ONHOLD or $record->StatusCode == PO_CREATED or $record->StatusCode == REQITEM_Emergency_PO_CREATED ){ ?> + StatusCode == PO_APPROVER_ONHOLD or or $record->StatusCode == PO_CREATED or $record->StatusCode == REQITEM_Emergency_PO_CREATED ){ ?>