Script CPTBUD : Budgets
BUDCTL: before a budget control
Use this entry point to take control after reading each budget before the budget control is run, if a budget has been defined.
Context and operating mode
Transaction
There is no transaction in progress.
Log file
A log file is not normally open (this can depend on the context).
Call context
The budget control only runs if the local variable BUDEXISTS is either not defined, or equal to 1.
If the budget control should only be run when the budget exists, the BUDEXISTS variable must be declared and initialized to 1 in a specific script.
Open tables
The [F:BUD] class is available and contains the budget that was just read.
The [F:BUP] class is available and contains the budget setup.
Other tables are open but their content is not relevant.
Other tables can be open according to the call context.
BEFACSBUD: before reading the budget
Use this entry point to take control before the budget control is read.
Context and operating mode
Transaction
There is no transaction in progress.
Log file
A log file is not normally open (this can depend on the context).
Call cases
The BEFACSBUD entry point is called at each budget control. There are, therefore, various possible contexts (purchase request creation, direct entry of commitments etc.).
Available variables and masks
GBUDNB | Number of budgets to be controlled |
GBUDGET(x) | List of budgets to be controlled |
LEDTYP | Ledger type of the upstream document |
SOCIETE | Company of the upstream document |
DEVISE | Currency of the upstream document |
PLAN / COMPTE | Chart of accounts and account of the upstream document |
TBDIE(x)/TBCCE(x) | Dimensions/Dimensions types on the upstream document |
MONTANT | Amount of the upstream document in the document currency |
QUANTITE | Quantity on the upstream document |
Open tables
Other tables are open but their content is not relevant.
Other tables can be open according to the call context.
BEFBUDCTL: before the budget control
Use this entry point to take control before the budget control is run in order to modify the budget excess control amount to be applied.
Context and operating mode
Transaction
There is no transaction in progress.
Log file
A log file is not normally open (this can depend on the context).
Call cases
The BEFBUDCTL entry point is called before the budgeted and current transaction amounts in the ledger currency are converted, and the budget control is run in the ledger currency.
Available variables and masks
DEVBUD | Currency of the budget to control |
DEVISE | Currency of the upstream document |
DEVLED | Ledger currency |
MTBUD | Amount of the budget to be controlled in the DEVBUD currency |
QTBUD | Quantity of the budget to control |
MONTANT | Amount of the upstream document in the document currency |
QUANTITE | Quantity of the upstream document |
MTBLA, MTCMM, MTPRP | Amount already achieved, committed, pre-committed in ledger currency |
QTBLA, QTCMM, QTPRP | Quantity already achieved, committed, pre-committed |
Open tables
The [F:BUD] class is available and contains the budget that was just read.
The [F:BUP] class is available and contains the budget setup.
Other tables are open but their content is not relevant.
Other tables can be open according to the call context.
AFTBUDCTL: after the budget control
Use this entry point to take control just after the standard budget control has been run in order to create additional custom checks.
Context and operating mode
Transaction
There is no transaction in progress.
Log file
A log file is not normally open (this can depend on the context).
Call cases
The AFTBUDCTL entry point is called just after calling the budget verification standard subprogram (VERF_BUD) used to control that the budget has not been exceeded.
When exiting the VERF_BUD standard program the OK2 variable is set to the following:
- '1' when the budgeted amounts have been exceeded;
- '2' when the budgeted quantities have been exceeded;
- '3' or '4' when an error during the conversion of rates prevented the budget control from being run.
If an error occurs (OK2=1, 2, 3 or 4), the MESSA variable is initialized in order to display the error message. This initialization is only done after calling the AFTBUDCTL entry point.
Available variables and masks
DEVBUD | Currency of the budget to control |
DEVISE | Currency of the upstream document |
DEVLED | Ledger currency |
MTBUD | Amount of the budget to be controlled in the DEVBUD currency |
QTBUD | Quantity of the budget to control |
MONTANT | Amount of the upstream document in the document currency |
QUANTITE | Quantity of the upstream document |
MTBLA, MTCMM, MTPRP | Amount already achieved, committed, pre-committed in ledger currency |
QTBLA, QTCMM, QTPRP | Quantity already achieved, committed, pre-committed |
Open tables
The [F:BUD] class is available and contains the budget that was just read.
The [F:BUP] class is available and contains the budget setup.
Other tables are open but their content is not relevant.
Other tables can be open according to the call context.