project QadFinancials > class BBudget > business logic query BudgetByBudgetIDCodeStatus

Description

BudgetByBudgetIDCodeStatus; query that returns the budget info.
Including conitional-joins to project and costcentre and special conditions that allow a run-time check '= 0' for Project_ID and for CostCentre_ID (see parameter descriptions).

DO NOT MAKE ANY CHANGE TO THIS QUERY; THIS SHOULD BE AS SIMPLE AS POSSIBLE BECAUSE IT IS USED BY THE BUDGET-RESOLVE (first contact KriLae/WouAnt in case you need a change)

Whenever a field gets added to the result-set of this query, the same shoudl be done for the temp-table data-item tBudgetByBudgetIDCodeStatus (and it should be assigned/used accordingly in the program-code of course).


Parameters


iiBudgetIDintegerBudget ID
icBudgetCodecharacterBudgetCode
icBudgetStatuscharacterBudgetStatus
iiCompanyIdintegerCompany id
icProjectCodecharacterProjectCode (conditional outer-join form budget to project)
icCostCentreCodecharacterCostCentreCode (conditional outer-join form budget to CostCentre)
ilBudgetIsCheckActualOnLinelogicalBudgetIsCheckActualOnLine
ilBudgetIsCheckCommitOnLinelogicalBudgetIsCheckCommitOnLine
ilBudgetIsAutoRollUplogicalBudgetIsAutoRollUp
iiProjectIDintegerProjectID: Note that in case you pass value -999999 then this will result at run-time into a hard-coded condition "Budget.project_ID = 0"
iiCostCentreIDintegerCostCentreID: Note that in case you pass value -999999 then this will result at run-time into a hard-coded condition "Budget.CostCentre_ID = 0"
icBudgetTypecharacterBudgetType


query condition


  each Budget where
Budget.BudgetCode = icBudgetCode AND
Budget.Budget_ID = iiBudgetID AND
Budget.BudgetStatus = icBudgetStatus AND
Budget.BudgetIsCheckActualOnLine = ilBudgetIsCheckActualOnLine AND
Budget.BudgetIsCheckCommitOnLine = ilBudgetIsCheckCommitOnLine AND
Budget.BudgetIsAutoRollUp = ilBudgetIsAutoRollUp AND
Budget.Project_ID = (if iiProjectID = -999999 then 0 else iiProjectID) AND
Budget.CostCentre_ID = (if iiCostCentreID = -999999 then 0 else iiCostCentreID) AND
Budget.BudgetType = icBudgetType

      first CostCentre (conditional-join) where
CostCentre.SharedSet_Id = vi_COSTCENTRE_sharedset(iiCompanyId) AND
CostCentre.CostCentre_ID = Budget.CostCentre_ID AND
CostCentre.CostCentreCode = icCostCentreCode

      first Currency (inner-join) where
Currency.Currency_ID = Budget.Currency_ID AND

      first Project (conditional-join) where
Project.SharedSet_Id = vi_PROJECT_sharedset(iiCompanyId) AND
Project.Project_ID = Budget.Project_ID AND
Project.ProjectCode = icProjectCode


query resultset tqBudgetByBudgetIDCodeStatus


field namedata typedb fielddescription
tiBudget_IDintegerBudget.Budget_IDRecord ID
tcBudgetCodecharacterBudget.BudgetCodeBudget Code
tcBudgetCheckReportPeriodcharacterBudget.BudgetCheckReportPeriodReport Period Check
tlBudgetIsUsedForAllocationlogicalBudget.BudgetIsUsedForAllocationUsed for Allocation
tlBudgetIsSendWarninglogicalBudget.BudgetIsSendWarningSend E-Mail on Warnings
tlBudgetIsAutoRollUplogicalBudget.BudgetIsAutoRollUpAuto Roll-Up
tlBudgetIsCheckActualOnLinelogicalBudget.BudgetIsCheckActualOnLineCheck Actuals Online
tlBudgetIsCheckCommitOnLinelogicalBudget.BudgetIsCheckCommitOnLineCheck Commitments Online
tlBudgetIsSendErrorlogicalBudget.BudgetIsSendErrorSend E-Mail on Errors
tcBudgetTypecharacterBudget.BudgetTypeBudget Type
tcBudgetDescriptioncharacterBudget.BudgetDescriptionDescription
tcBudgetStatuscharacterBudget.BudgetStatusStatus
tlBudgetIsCompanyDependentlogicalBudget.BudgetIsCompanyDependentEntity Dependent
tlBudgetIsWithQuantityDatalogicalBudget.BudgetIsWithQuantityDataUse Quantity Info
tcBudgetOverrunYTDcharacterBudget.BudgetOverrunYTDOverrun (YTD)
tcBudgetOverrunPeriodcharacterBudget.BudgetOverrunPeriodGL Period Overrun
tcBudgetOverrunTotalcharacterBudget.BudgetOverrunTotalTotal Overrun
tiCurrency_IDintegerBudget.Currency_IDCurrency Code
tiUsr_IDintegerBudget.Usr_IDBudget Administrator
tiProject_IDintegerBudget.Project_IDProject Code
tiCostCentre_IDintegerBudget.CostCentre_IDCost Center Code
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tcCostCentreCodecharacterCostCentre.CostCentreCodeCost Center: A code that identifies the cost center.
tcProjectCodecharacterProject.ProjectCodeProject


Internal usage


QadFinancials
method BBudget.ApiGetBudgetWBS
method BBudget.ApiGetBudgetWBSSafInfo
method BBudget.BudgetCheckInfoResolveReadDB
method BBudget.CheckBudgetFDSWBS
method BBudget.InitialValues
method BBudgetRebuild.ApiRebuildBudget
method BProject.ValidateComponent
dataset BBudget.tBudgetByBudgetIDCodeStatus