From f93c716ec501f24accfe7d729d6ee300e2c90158 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 6 Apr 2018 08:42:12 +0000 Subject: [PATCH] purchaseorder_model.php edited --- application/models/purchaseorder_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 95543c8c..bc53cf1c 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -566,7 +566,7 @@ function GetPOType($ReqNo) if($insert_id>0) { //$subQuery = 'select max(PONO) as PONO from T_PurchaseOrder_Master where POType=? and POSubType=?'; - $subQuery = 'select PONO from T_PurchaseOrder_Master where POType=? and POSubType=? order by CreatedDate desc limit 1'; + $subQuery = 'select PONO from T_PurchaseOrder_Master where POType=? and POSubType=? and isnull(ParentPO) order by CreatedDate desc limit 1'; $query = $this->db->query($subQuery,array($POType,$POSubtype)); return $query->result_array();