From 868a2e06b02e4a0fff35272d707db02891e3a379 Mon Sep 17 00:00:00 2001 From: gandhimathi Bharathirajan Date: Thu, 17 Aug 2017 11:54:21 +0530 Subject: [PATCH] ForgotPassword, Draft for other status issue fixed in PDF --- application/models/requistion_model.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/application/models/requistion_model.php b/application/models/requistion_model.php index d48dc15b..2de55a5e 100755 --- a/application/models/requistion_model.php +++ b/application/models/requistion_model.php @@ -51,12 +51,17 @@ class requistion_model extends CI_Model } */ - $subQuery ='select distinct Req.ReqNo, Mat.MaterialCode,Mat.MaterialName,Mat.UOM, Req.Quantity,if (Po.Quantity is null,0,Po.Quantity) as POQTY,sta.StatusName from T_MaterialMaster Mat join T_Requestion_Details Req on Req.MaterialCode = Mat.MaterialCode - left join T_PurchaseOrder_LineItem Po on Po.ReqNo = Req.ReqNo and Po.MaterialCode = Req.MaterialCode - left join T_Status sta on sta.StatusCode = Req.Status - where Req.ReqNo = ?'; + $subQuery ='select distinct Req.ReqNo, Req.MaterialCode,Mat.MaterialName,Mat.UOM, Req.Quantity, +ifnull(Po.Quantity,0) as POQTY,sta.StatusName + from T_Requestion_Details Req join T_MaterialMaster Mat on + Req.MaterialCode = Mat.MaterialCode + left join T_PurchaseOrder_LineItem Po on Po.ReqNo = Req.ReqNo + left join T_PurchaseOrder_Master POmast on POmast.PONO=Po.PONO + and Po.MaterialCode = Req.MaterialCode + join T_Status sta on sta.StatusCode = Req.Status + where Req.ReqNo = ? and POmast.Status=?'; - $query = $this->db->query($subQuery, array($ReqNo)); + $query = $this->db->query($subQuery, array($ReqNo,PO_AMENDED)); // print_r($this->db->last_query()); return $query->result();