From 847e1c444fa2f046141411ec3f367dd6466da090 Mon Sep 17 00:00:00 2001 From: gandhimathi Bharathirajan Date: Fri, 28 Jul 2017 12:57:28 +0530 Subject: [PATCH] IGR issue fixed --- application/models/inwardgateregister_model.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/models/inwardgateregister_model.php b/application/models/inwardgateregister_model.php index 2ff0922a..c2ad4c3c 100755 --- a/application/models/inwardgateregister_model.php +++ b/application/models/inwardgateregister_model.php @@ -39,6 +39,7 @@ class inwardgateregister_model extends CI_Model $this->db->join('T_PurchaseOrder_LineItem POL', 'POL.PONO = POM.PONO'); $this->db->join('T_SupplierDetailsN sup', 'POM.SupplierID = sup.SupplierID'); $this->db->where('POM.Status',PO_RELEASED); + $this->db->where('POM.POType !=',SERVICE); $this->db->or_where('POM.Status',IGR_CREATED); $this->db->or_where('POM.Status',MRIR_CREATED); @@ -146,13 +147,14 @@ class inwardgateregister_model extends CI_Model function UpdatePOMaster($PONO,$updatedBy) { - $this->db->select('Count(*) as cnt'); + $this->db->select('*'); $this->db->from('T_PurchaseOrder_LineItem'); $this->db->where('PONO',$PONO); $this->db->where('Status !=',IGR_CREATED); $query = $this->db->get(); - //print_r($this->db->last_query()); + + if ($query->num_rows == 0) { $this->db->where('PONO', $PONO); $POStatus = array('status'=>IGR_CREATED,'UpdateBY'=>$updatedBy);