project QadFinancials > class BBudget > method ApiGetBudgetWBSWithFiguresActualFig
Description
This sub-method of ApiGetBudgetWBSWithFigures will read all required actual/commit records from db.
This method was created because the parent-method could not contain all code.
Parameters
iiBudgetID | input | integer | iiBudgetID |
iiBudgetVersionID | input | integer | iiBudgetVersionID |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program9/bbudget.p)
/* ===================================================================================== */
/* Call query that returns all actuals+commitments of the budget over all budget-periods */
/* ===================================================================================== */
<Q-1 run BudgetLinkByBudgetPerWBS (all) (Read) (NoCache)
(input ?, (BudgetLinkID)
input iiBudgetID, (BudgetID)
input ?, (BudgetWBSID)
input ?, (FromBudgetPeriodID)
input ?, (ToBudgetPeriodID)
output dataset tqBudgetLinkByBudgetPerWBS) in BBudgetLink >
/* ======================================================================= */
/* Go through all WBS'es of the budget/version and get the figures for all */
/* ======================================================================= */
for each tViewBudgetWBS ,
each tViewBudgetWBSFigures where
tViewBudgetWBSFigures.tiBudgetWBSID = tViewBudgetWBS.tiBudgetWBSID :
/* Sommate all actuals and commitments for the BudgetWbs over all budget-periods */
for each tqBudgetLinkByBudgetPerWBS where
tqBudgetLinkByBudgetPerWBS.tiBudgetWBS_ID = tViewBudgetWBSFigures.tiBudgetWBSID :
assign tViewBudgetWBSFigures.tdCommitCostTC = tViewBudgetWBSFigures.tdCommitCostTC + tqBudgetLinkByBudgetPerWBS.tdBudgetLinkCommitTC
tViewBudgetWBSFigures.tdCommitQTY = tViewBudgetWBSFigures.tdCommitQTY + tqBudgetLinkByBudgetPerWBS.tdBudgetLinkCommitQTY
tViewBudgetWBSFigures.tdActualRevenueTC = tViewBudgetWBSFigures.tdActualRevenueTC + tqBudgetLinkByBudgetPerWBS.tdBudgetLinkActualSalesTC
tViewBudgetWBSFigures.tdActualCostTC = tViewBudgetWBSFigures.tdActualCostTC + tqBudgetLinkByBudgetPerWBS.tdBudgetLinkActualTC
tViewBudgetWBSFigures.tdActualQTY = tViewBudgetWBSFigures.tdActualQTY + tqBudgetLinkByBudgetPerWBS.tdBudgetLinkActualQTY
no-error.
end. /* for each tqBudgetLinkByBudgetPerWBS where */
end. /* for each tViewBudgetWBS */
/* ========================== */
/* Clear query-table contents */
/* ========================== */
empty temp-table tqBudgetLinkByBudgetPerWBS.