Originally created by: grynn-in
Declared configuration instead of literals. Closes konsolidat#209 (step 1), [#208], [#206] and [#207].
Pairs with konsol PR [#217] (konsol#214). Deploy this first, then [#217]. [#217]'s variance readers filter on the new budget_scenario_id column.
What changes
materiality_floor() macro replaces 45 copies of 0.005 across 12 models and tests. The build result is identical (live clone PASS=204/WARN=1/ERROR=0 before and after). A python test keeps the literal out of the project.nci_account, the same account the acquisition journal uses. A group that hasn't declared one still posts to the NCI placeholder, and the new warn test assert_ic_nci_account_declared names it. The unused var('ic_nci_account') is gone.gold_variance_analysis, gold_variance_quarterly and gold_variance_ytd pick actuals and budgets by the scenario's declared scenario_type (active only), not by the codes 'ACTUAL'/'BUDGET'. Budgets authored in konsol now reach variance. Each budget scenario keeps its own rows, with a new last column budget_scenario_id. gold_variance_at_hierarchy_node groups by it too, so actuals are no longer counted once per budget scenario. The hierarchy node models alias hierarchy_dimension (it was output as lc.hierarchy_dimension).budget_amount / ytd_budget are NULL, not 0, where a budget scenario has no line for that grain. A missing budget is not treated as a budget of zero.erp_sources is empty.erp_sources now defaults to [], matching the user's decision that the trial-balance upload is the canonical source. List d365_fo or erpnext to build a connector.Verified
dbt parse with erp_sources: [] finds 0 compilation errors.Review round 1 fixes
''.assert_scenario_rows_declared (error) names rows under an undeclared or inactive scenario. On the live data it passes: only ACTUAL from the GL, which is declared and active.'ACTUAL' when none or several are declared.🤖 Generated with Claude Code
Tickets: #206
Tickets: #207
Tickets: #208
Tickets: #209
Tickets: #217
Originally posted by: grynn-in
Review round 1. Point 1 (konsol's hierarchy variance sums across budget scenarios) is already fixed in konsol PR [#217], which merges right after this one. Points 2–4 are accepted as rows:
'ACTUAL'.Related
Tickets:
#217Originally posted by: grynn-in
Round 1 fixed:
assert_scenario_rows_declared.Live-clone build PASS=189 WARN=1 ERROR=0.
Originally posted by: grynn-in
CI: the fresh TB-only site fixture has no
scenario_definitionsrows, so D7a's new test fails there. A real site gets ACTUAL/BUDGET/FORECAST from konsol's Scenario fixtures. Row D7c makes the CI fixture declare them; the test is not loosened.Review round 2: points 2–4 hold. Test gaps accepted as rows:
assert_scenario_rows_declarednames several active actual scenarios; its header is clarified about forecasts.''variance rows are checked.Originally posted by: grynn-in
Round 2 fixed: D7c (CI fixture declares its scenarios; fresh-site job green), D7d (several active actual scenarios named), D9b (uncovered
''variance rows checked).Ticket changed by: grynn-in