diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index a09b4ded..d105c43d 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -251,7 +251,7 @@ function purchaseorderListing($forwhat='') function GetAvailableImportBudgetAmount($CostCode,$Year,$BudgetType) { - $subQuery='select BudgetAmount,(select ifnull(sum((Quantity*Rate)),0)as TValue from T_PurchaseOrder_LineItem LineItem + $subQuery='select BudgetAmount,(select ifnull(sum((Quantity*Rate*ExchangeRate)),0)as TValue from T_PurchaseOrder_LineItem LineItem join T_PurchaseOrder_Master Mast on Mast.PONO=LineItem.PONO where POType=? and CostCenterCode=?)as TotalValue from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and BudgetYear=? and BudgetType=?'; $query = $this->db->query($subQuery,array($BudgetType,$CostCode,$CostCode,$Year,$BudgetType));