From edc9a6077a96984b923c7ea0e80184dc8cd780c0 Mon Sep 17 00:00:00 2001 From: gandhimathi Bharathirajan Date: Fri, 1 Sep 2017 16:55:58 +0530 Subject: [PATCH] Available budget amount issue sorted out --- application/models/purchaseorder_model.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 0d7b407b..a57be7a3 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -264,12 +264,12 @@ function purchaseorderListing($forwhat='') Totalvalue from T_PurchaseOrder_LineItem Item join T_Requestion_Master mast on mast.ReqNo = Item.ReqNo join T_PurchaseOrder_Master POM on POM.PONO = Item.PONO left join T_Revenue_Tax tax on tax.LineItemNo = Item.LineItemNo - where Item.CostCenterCode=? and mast.ReqType=? and POM.status not in (?)) else (select + where Item.CostCenterCode=? and POM.POType=? and POM.status not in (?)) else (select round(ifnull(sum(Quantity*Rate*ifnull(case when mast.NumberOfService=? then 1 else mast.NumberOfService end ,1)),0),2) as Totalvalue from T_PurchaseOrder_LineItem Item join T_Requestion_Master mast on mast.ReqNo = Item.ReqNo join T_PurchaseOrder_Master POM on POM.PONO = Item.PONO left join T_Requestion_Master ReqMas on ReqMas.ReqNo= Item.ReqNo - where Item.CostCenterCode=? and mast.ReqType=? and POM.status not in (?) ) end as Totalvalue + where Item.CostCenterCode=? and POM.POType=? and POM.status not in (?) ) end as Totalvalue from T_CostCenter_Budget Bud join T_CostCenter_Departments dept on dept.CostCenterCode = Bud.CostCenterCode where Bud.CostCenterCode=? and BudgetYear = ? and BudgetType =?'; @@ -283,6 +283,17 @@ function purchaseorderListing($forwhat='') } + //to get POTYpe from ReqNo +function GetPOType($ReqNo) +{ + $this->db->select('POType'); + $this->db->from('T_PurchaseOrder_Master mast'); + $this->db->join('T_PurchaseOrder_LineItem Line', 'mast.PONO=Line.PONO'); + $this->db->where('Line.ReqNo', $ReqNo); + $query = $this->db->get(); + return $query->result_array(); +} + /** * This function is used to get the Requsition List for the login user * @return array $result : This is result of the query