Silver Models
10 models in the epm_silver schema. Silver joins and cleans bronze, and brings in the governed reference data konsol writes to epm_staging.
silver_gl_entries
One GL-shaped row per posting, from two sources in one UNION ALL:
- ERP lines:
bronze_general_journal_account_entriesjoined tobronze_general_journal_entries(journal header, ongeneral_journal_entry_recidanddata_area_id) and tosilver_main_accounts(account name, type, P&L / balance-sheet flags). The fiscal year and period come from the entity's own calendar:epm_gold.entity_fiscal_calendarsmaps the entity to a calendar ('Fiscal'when it has no row) andsilver_fiscal_periodsis expanded to one row per calendar date; an entity whose calendar is not loaded falls back to the calendar year and month ofaccounting_date. - Submitted trial balances:
silver_tb_movements, one synthetic entry per (entity, period, account, partner, dimensions) movement,recida negative hash so it never collides with an ERP id,posting_typeandjournal_category=Trial Balance Submission,journal_number=TBS-<batch_id>.accounting_dateis the first day of the entity's own fiscal period. The year-end close rowssilver_tb_movementssynthesizes carryposting_layer = 'Year-end close'(konsolidat#259).
Debit and credit are derived from the sign of accounting_currency_amount (konsolidat#112): positive is debit, negative is credit. The ERP's own debit/credit flag (is_credit) is retired.
| Column | Type | Description |
|---|---|---|
recid | Int64 | ERP record id; negative hash for submitted rows |
data_area_id | String | Legal entity |
accounting_date | Date | Posting date |
fiscal_year, fiscal_period | UInt16, UInt8 | From the entity's fiscal calendar |
main_account | String | Account code |
account_name, account_type_name | String | From silver_main_accounts |
is_balance_sheet, is_pnl | UInt8 | From the governed chart's statement_section |
accounting_currency_amount | Decimal | Signed amount (debit − credit) |
reporting_currency_amount | Decimal | D365's translated figure; 0 for submitted rows |
transaction_currency_amount, transaction_currency_code | Decimal, String | Transaction currency |
credit_amount, debit_amount | Decimal | Split from the sign |
posting_type, description | String | |
partner_data_area_id | String | Intercompany partner, '' when none |
dim_* | String | One column per declared dimension |
journal_number, journal_category, document_number, document_date, posting_layer | Journal header |
Tests: assert_silver_gl_debit_credit_balance (error), assert_is_credit_retired, assert_fiscal_calendar_is_loaded.
silver_main_accounts
What each account is, from one source: the group chart governed in konsol (Main Account, Published, non-group rows), written through to epm_staging.main_accounts (konsol#182). No ERP chart is read. An account not declared in konsol is not here, so its trial-balance rows reach neither statement; assert_undeclared_accounts_in_trial_balance (warn) names each one.
A pre_hook, governed_chart_guard(), refuses the build before the table is replaced when a Published declaration is unusable: duplicate rows that disagree, a statement_section or fx_method outside the vocabulary, a P&L account at the historical rate or a balance-sheet account at the average rate. When the table does not exist yet (konsol not upgraded) the model is empty with its full set of columns.
| Column | Type | Description |
|---|---|---|
main_account_id | String | Account code |
account_name | String | |
account_type, account_type_name | String | konsol's vocabulary: Revenue, Expense, Asset, Liability, Equity, Profit and loss, Balance sheet, Total |
is_pnl, is_balance_sheet | UInt8 | statement_section = 'Profit and Loss' / 'Balance Sheet' |
is_equity | UInt8 | account_type = 'Equity' (konsolidat#213: what the account is) |
uses_historical_rate | UInt8 | fx_method = 'historical' (konsolidat#213: what the chart declares about translation; a separate fact) |
fx_method | String | closing, average or historical; decides the rate gold_consolidated_trial_balance translates at |
is_retained_earnings | UInt8 | The account the year-end close posts the year's result to (konsolidat#199); 0 on a table that predates the column |
main_account_category, debit_credit_default, chart_of_accounts, is_suspended, statement_section, sub_section, normal_balance, time_balance, is_posting, parent_account, allow_ic, cf_category, cf_line_item, is_cash | The rest of the declaration |
Tests: assert_governed_chart_declarations_usable (warn, lists every problem), assert_governed_chart_grain_unique (warn), assert_every_account_is_pnl_or_balance_sheet (warn), assert_is_equity_is_account_type_equity.
silver_entity_currencies
The currency each entity keeps its books in: anyIf(accounting_currency, != '') per data_area_id from epm_staging.entities (konsol's Entity master, is_group = 0), grouped so a duplicate row cannot fan a join out. No ERP fallback (konsolidat#255, decided 11 Oct 2026): a blank Functional Currency stays ''; consolidation joins only resolved currencies and assert_every_tb_entity_has_a_currency names an entity with trial-balance rows and none.
Columns: data_area_id, accounting_currency.
silver_legal_entities
The ERP company master, from bronze_legal_entities. Columns: data_area, entity_name, accounting_currency, reporting_currency, party_number, country_region. Not read by the consolidation models since konsolidat#255.
silver_fiscal_periods
Monthly periods generated from the ERP's fiscal calendar years (bronze_fiscal_calendar_years): twelve rows per year, addMonths(start_date, 0..11), while the month start is within the year. Read by silver_gl_entries and silver_budget_entries to date rows into periods.
Columns: calendar_id, fiscal_year_name, year_start_date, year_end_date, calendar_year, calendar_month, period_start_date, period_end_date, year_recid, period_recid (always 0).
konsol's own declared calendar is a different table, epm_staging.fiscal_periods (Regular and Closing periods), read by the gold models.