Skip to content

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 prints

The data

TableHolds
ts_budgetthe header: budget_desc, budget_approve_date, project_id
ts_budget_snapshotthe 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_snapshotfrozen copies of the Cost Control transactions, written by the Snapshot tab there and read here
ts_report_snapshot, ts_map_report_snapshota saved report: per WBS node the budget and accrual sums for previous, current, next and later years, plus report_snap_comments
ts_cm_report_commentscomments 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

PrintScriptState where the legacy helper throws
Budget versus Current Month (BvCM)budget_handler_print_bvcm.phpon $pdo, works
Report Budget Comparison (RBC), two layoutsprint_rbc.php, print_rbc2.phpon $pdo, work
RBC Excelprint_rbcxls.phpdead
Previous Month versus Current Month (PMvCM)print_pmcm.phpdead
Year to Date Summary (YTDS)print_ytds.phpdead
Total Accrual Cost (TAC)print_tac.phpdead
Actual and forecastprint_actcast.phpdead
Budget comments, AF commentsprint_budget_comment.php, print_af_comment.phpdead
Ad hoc 1print_adhoc1.phpdead

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.

PathState where the legacy helper throws
budget.phpon $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 printsdead

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_comments has no cascade.
  • The AFE filter on the toolbar filters by pertamina_afe_id on the budget lines, not by the AFE of the transactions.

Instance differences

Checked on 2026-09-06.

InstanceDifference
MasterThe only instance with the module installed, for QA.
Jadestone, Medco, JOTRE, TimasNot installed in their QA databases. Code identical to master, byte for byte.