diff --git a/application/models/inwardgateregister_model.php b/application/models/inwardgateregister_model.php index c28441ab..e4eb057f 100755 --- a/application/models/inwardgateregister_model.php +++ b/application/models/inwardgateregister_model.php @@ -422,12 +422,14 @@ class inwardgateregister_model extends CI_Model function getPO($supplierId) { + /// echo $supplierId; $subQuery='select T_PurchaseOrder_Master.PONO from T_PurchaseOrder_Master join T_MRIR_Master on T_MRIR_Master.PONO= T_PurchaseOrder_Master.PONO - where T_PurchaseOrder_Master.SupplierID=? and T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? group by T_PurchaseOrder_Master.PONO'; + where T_PurchaseOrder_Master.SupplierID=? and (T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=? or T_PurchaseOrder_Master.Status=?) group by T_PurchaseOrder_Master.PONO'; //$query= $this->db->query($subQuery, array($supplierId,ST044,PO,ST063)); $query= $this->db->query($subQuery, array($supplierId,ST044,PO,PO_RELEASED,IGR_CREATED,MRIR_CREATED,PARTIAL_MRIRAPPROVED,OGR_COMPLETE,OGR_PARTIAL_COMPLETE,OGR_CREATED)); + //print_r( $this->db->last_query()); return $query->result();