Available budget amount

This commit is contained in:
gandhimathi Bharathirajan 2017-08-11 17:19:37 +05:30
parent 80d3d6fa09
commit bf746c0730

View File

@ -247,14 +247,18 @@ function purchaseorderListing($forwhat='')
from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and
BudgetYear = ? and BudgetType =?'; */
$subQuery ='select BudgetAmount, (select ifnull(sum(Quantity*Rate)-tax.AfterDiscount,0) as Totalvalue from
T_PurchaseOrder_LineItem Item join T_Requestion_Master mast
on mast.ReqNo = Item.ReqNo left join T_Revenue_Tax tax on
tax.LineItemNo = Item.LineItemNo where Item.CostCenterCode=? and mast.ReqType=?)as Totalvalue
$subQuery ='select BudgetAmount, ( select
ifnull(sum((Quantity*Rate)-ifnull(tax.AfterDiscount,0)),0) 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_Revenue_Tax tax on
tax.LineItemNo = Item.LineItemNo where Item.CostCenterCode=? and mast.ReqType=?
and POM.status not in (?) )as Totalvalue
from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and
BudgetYear = ? and BudgetType =?';
$query = $this->db->query($subQuery,array($CostCode,$BudgetType,$CostCode,$Year,$BudgetType));
$query = $this->db->query($subQuery,array($CostCode,$BudgetType,PO_AMENDED,$CostCode,$Year,$BudgetType));
//print_r($this->db->last_query());
return $query->result_array();