Budget & Expense Reporting
Module: budget. The budget side of Cost Control: a budget per project laid out on the WBS tree, frozen as snapshots, compared with the actual and forecast figures from Cost Control, and printed as the month and year comparison reports.
How this page was verified
Written from master on 2026-09-06 and compared with the big five the same day. No earlier page existed. A map, not a line-by-line trace: 27 files, about 300 database calls. Only master has the module installed.
Where it sits
WBS (ts_cbs) + AFE → Budget (ts_budget, ts_budget_snapshot lines)
Cost Control transactions → Actual & Forecast snapshots (ts_actual_forecast_snapshot)
both → Report snapshots (ts_report_snapshot) → BvCM, PMvCM, RBC, YTD, TAC printsThe data
| Table | Holds |
|---|---|
ts_budget | the header: budget_desc, budget_approve_date, project_id |
ts_budget_snapshot | the budget lines, one per WBS node and line item: cbs_* copied from the WBS, budget_lineitem_qty, budget_lineitem_unit, budget_lineitem_value, budget_lineitem_execdate, budget_lineitem_prog, pertamina_afe_id, jv_afe_id, acc_id. Despite the name this is the live budget, not only a copy. |
ts_actual_forecast, ts_actual_forecast_snapshot | frozen copies of the Cost Control transactions, written by the Snapshot tab there and read here |
ts_report_snapshot, ts_map_report_snapshot | a saved report: per WBS node the budget and accrual sums for previous, current, next and later years, plus report_snap_comments |
ts_cm_report_comments | comments on any line: keyed by budget, snapshot, WBS, line item, contract, transaction, invoice, expediting row or report, with a date range |
The screen
budget.php with budget_expense_browse.htm and three tabs: Budget, Actual & Forecast, Report. Toolbar: New Budget, Edit Budget, Edit Budget Title, Delete Budget, New Lineitem, Edit Lineitem, Delete Lineitem, Save as Budget, Save as New, Save as Snapshot, Edit Snapshot Title, View Snapshot, Delete Snapshot, AFE Filter, View Comments, Report, Print, Export CSV, Refresh.
Actions in budget_handler_post.php: add, addnew, edit, delete, addline, editline, delline, moveline, movelineExp, deleteExp, copytobudget, copytosnapshot, edit_budget_title, edit_snapshot_title, edit_af_comments, saveAsReport, editReport, and the report-form pairs bvcmAdd / bvcmEdit, pmcmAdd / pmcmEdit, rbcAdd / rbcEdit, ytdsAdd / ytdsEdit.
The reports
| Script | State where the legacy helper throws | |
|---|---|---|
| Budget versus Current Month (BvCM) | budget_handler_print_bvcm.php | on $pdo, works |
| Report Budget Comparison (RBC), two layouts | print_rbc.php, print_rbc2.php | on $pdo, work |
| RBC Excel | print_rbcxls.php | dead |
| Previous Month versus Current Month (PMvCM) | print_pmcm.php | dead |
| Year to Date Summary (YTDS) | print_ytds.php | dead |
| Total Accrual Cost (TAC) | print_tac.php | dead |
| Actual and forecast | print_actcast.php | dead |
| Budget comments, AF comments | print_budget_comment.php, print_af_comment.php | dead |
| Ad hoc 1 | print_adhoc1.php | dead |
Only BvCM is in the Report menu; the others are reached from the Report button. The two empty items under the menu's Cost Control & Budgeting heading are the legacy budget and procurement header rows the Reporting page describes.
What still runs on the legacy helper
Counted on 2026-09-06: 178 calls to iw_mysql_query() against 128 uses of $pdo.
| Path | State where the legacy helper throws |
|---|---|
budget.php | on $pdo, works |
budget.inc.php (11 legacy, 35 PDO), budget_handler_post.php (29 legacy, 48 PDO) | mixed |
budget_handler_ajaxform.php (31 legacy, 4 PDO) | mostly dead |
file_explorer.php, seven of the ten prints | dead |
Gotchas
- "Snapshot" means three things here: a budget snapshot (
ts_budget_snapshot, the live lines), an actual-and-forecast snapshot (from Cost Control) and a report snapshot (ts_report_snapshot). Read the table name before you reason about a bug. - Deleting a budget leaves its comments.
ts_cm_report_commentshas no cascade. - The AFE filter on the toolbar filters by
pertamina_afe_idon the budget lines, not by the AFE of the transactions.
Instance differences
Checked on 2026-09-06.
| Instance | Difference |
|---|---|
| Master | The only instance with the module installed, for QA. |
| Jadestone, Medco, JOTRE, Timas | Not installed in their QA databases. Code identical to master, byte for byte. |
Related
- Cost Control: the transactions the reports compare against.
- Cost Control settings: WBS, AFE, budget progress types.
- Reporting.