Available Budget amount for Capital PO issue fixed
This commit is contained in:
parent
090e416b5f
commit
368e53d43f
@ -230,6 +230,33 @@ function purchaseorderListing($forwhat='')
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//Import PO Available Budget Amount
|
||||||
|
function GetAvailableImportBudgetAmount($CostCode,$Year,$BudgetType)
|
||||||
|
{
|
||||||
|
$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=? and Mast.status not in (?) )as TotalValue from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and BudgetYear=? and BudgetType=?';
|
||||||
|
$query = $this->db->query($subQuery,array($BudgetType,$CostCode,PO_AMENDED,$CostCode,$Year,$BudgetType));
|
||||||
|
//print_r($this->db->last_query());
|
||||||
|
return $query->result_array();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
//get available budget for capital
|
||||||
|
function GetAvailableCapitalBudgetAmount($CostCode,$Year,$BudgetType)
|
||||||
|
{
|
||||||
|
|
||||||
|
$subQuery ='select BudgetAmount, (select ifnull(sum(IF(POMaster.ExchangeRate>0,Quantity*Rate*POMaster.ExchangeRate,Quantity*Rate)),0) as Totalvalue from
|
||||||
|
T_PurchaseOrder_LineItem Item join T_Requestion_Master mast
|
||||||
|
on mast.ReqNo = Item.ReqNo join T_PurchaseOrder_Master POMaster on POMaster.PONO=Item.PONO where Item.CostCenterCode=? and mast.ReqType=? and POMaster.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,PO_AMENDED,$CostCode,$Year,$BudgetType));
|
||||||
|
|
||||||
|
return $query->result_array();
|
||||||
|
|
||||||
|
}
|
||||||
function GetAvailableBudgetAmount($CostCode,$Year,$BudgetType)
|
function GetAvailableBudgetAmount($CostCode,$Year,$BudgetType)
|
||||||
{
|
{
|
||||||
$subQuery ='select distinct Bud.CostCenterCode,BudgetAmount, case WHEN BudgetType = ? then (select
|
$subQuery ='select distinct Bud.CostCenterCode,BudgetAmount, case WHEN BudgetType = ? then (select
|
||||||
@ -256,21 +283,6 @@ function purchaseorderListing($forwhat='')
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function GetAvailableImportBudgetAmount($CostCode,$Year,$BudgetType)
|
|
||||||
{
|
|
||||||
$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));
|
|
||||||
//print_r($this->db->last_query());
|
|
||||||
return $query->result_array();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is used to get the Requsition List for the login user
|
* This function is used to get the Requsition List for the login user
|
||||||
* @return array $result : This is result of the query
|
* @return array $result : This is result of the query
|
||||||
@ -1472,21 +1484,7 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
|
|||||||
return $query->result();
|
return $query->result();
|
||||||
|
|
||||||
}
|
}
|
||||||
//get available budget for capital
|
|
||||||
function GetAvailableCapitalBudgetAmount($CostCode,$Year,$BudgetType)
|
|
||||||
{
|
|
||||||
|
|
||||||
$subQuery ='select BudgetAmount, (select ifnull(sum(IF(POMaster.ExchangeRate>0,Quantity*Rate*POMaster.ExchangeRate,Quantity*Rate)),0) as Totalvalue from
|
|
||||||
T_PurchaseOrder_LineItem Item join T_Requestion_Master mast
|
|
||||||
on mast.ReqNo = Item.ReqNo join T_PurchaseOrder_Master POMaster on POMaster.PONO=Item.PONO where Item.CostCenterCode=? and mast.ReqType=?)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));
|
|
||||||
|
|
||||||
return $query->result_array();
|
|
||||||
|
|
||||||
}
|
|
||||||
// update req deatail if work status is completed
|
// update req deatail if work status is completed
|
||||||
|
|
||||||
function updateReqDetail($PONO,$POStatus)
|
function updateReqDetail($PONO,$POStatus)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user