Gold Models
Business-ready models in the epm_gold schema, consumed by the Frappe API and Excel reports.
Trial Balance & GL
gold_trial_balance
Period-level trial balance aggregated from GL entries. Primary model for the actuals scenario.
| Column | Type | Description | Test |
|---|---|---|---|
data_area_id | String | Legal entity identifier | not_null |
fiscal_year | UInt16 | Fiscal year | not_null |
fiscal_period | UInt8 | Fiscal period (1–12) | not_null |
main_account | String | Main account ID from chart of accounts | not_null |
dim_cost_center | String | Cost center dimension | — |
dim_department | String | Department dimension | — |
dim_business_unit | String | Business unit dimension | — |
period_debit | Decimal | sum(debit_amount) | — |
period_credit | Decimal | sum(credit_amount) | — |
period_net_amount | Decimal | sum(accounting_currency_amount) | — |
transaction_count | UInt64 | count(*) | — |
API mapping: scenario=actuals → queries this table.
gold_ytd_trial_balance
Year-to-date running totals over gold_trial_balance.
| Column | Type | Description | Test |
|---|---|---|---|
data_area_id | String | Legal entity identifier | not_null |
fiscal_year | UInt16 | Fiscal year | — |
fiscal_period | UInt8 | Fiscal period | — |
main_account | String | Main account ID | — |
dim_cost_center | String | Cost center | — |
dim_department | String | Department | — |
dim_business_unit | String | Business unit | — |
ytd_debit | Decimal | Cumulative debit through period | — |
ytd_credit | Decimal | Cumulative credit through period | — |
ytd_net_amount | Decimal | Cumulative net amount through period | not_null desc |
Test: assert_ytd_p12_equals_annual — YTD at period 12 must equal sum of all 12 periods.
P&L Models
gold_pnl_by_period
P&L view — revenue and expense accounts only.
| Column | Type | Description | Test |
|---|---|---|---|
data_area_id | String | Legal entity | not_null |
fiscal_year | UInt16 | Fiscal year | — |
fiscal_period | UInt8 | Fiscal period | — |
main_account | String | Account (revenue/expense only) | not_null |
account_type | String | Revenue or Expense | — |
period_net_amount | Decimal | Net amount for period | — |
Test: assert_pnl_only_pnl_accounts — only P&L account types present.
gold_pnl_quarterly
Quarterly P&L aggregation for P&L accounts.
| Column | Type | Description | Test |
|---|---|---|---|
data_area_id | String | Legal entity | — |
fiscal_year | UInt16 | Fiscal year | — |
fiscal_quarter | String | Quarter label (Q1–Q4) | not_null |
main_account | String | Account | — |
quarter_net_amount | Decimal | Sum of period_net_amount for the quarter | — |
gold_pnl_half_yearly
Half-yearly P&L aggregation for P&L accounts.
| Column | Type | Description | Test |
|---|---|---|---|
data_area_id | String | Legal entity | — |
fiscal_year | UInt16 | Fiscal year | — |
fiscal_half | String | Half label (H1, H2) | not_null |
main_account | String | Account | — |
half_net_amount | Decimal | Sum of period_net_amount for the half | — |
Balance Sheet Models
gold_balance_sheet
Balance sheet view — cumulative balances for BS accounts.
| Column | Type | Description | Test |
|---|---|---|---|
data_area_id | String | Legal entity | not_null |
fiscal_year | UInt16 | Fiscal year | — |
fiscal_period | UInt8 | Fiscal period | — |
main_account | String | Account (asset/liability/equity only) | not_null |
account_type | String | Asset, Liability, or Equity | — |
cumulative_balance | Decimal | Running sum of period_net_amount within the year | — |
Test: assert_bs_only_bs_accounts — only BS account types present.
gold_bs_movement
Balance sheet movement schedule: opening, movement, closing.
| Column | Type | Description | Test |
|---|---|---|---|
data_area_id | String | Legal entity |