diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index ee05efe9..86e6e993 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -464,7 +464,7 @@ function GetPOType($ReqNo) * This function is used to add New Purchase order to the system */ - function addPOMaster($POMaster) + function addPOMaster($POMaster,$POType,$POSubtype) { $this->db->trans_start(); $this->db->insert('T_PurchaseOrder_Master', $POMaster); @@ -473,9 +473,9 @@ function GetPOType($ReqNo) // print_r($this->db->last_query()); if($insert_id>0) { - $subQuery = 'select max(PONO) as PONO from T_PurchaseOrder_Master'; + $subQuery = 'select max(PONO) as PONO from T_PurchaseOrder_Master where POType=? and POSubType=?'; - $query = $this->db->query($subQuery); + $query = $this->db->query($subQuery,array($POType,$POSubtype)); return $query->result_array(); }