Originally created by: grynn-in
Found reviewing [#158] (PR [#168]).
Actuals are signed (period_net_amount = debit โ credit, enforced by a test). Budgets have no defined sign convention:
silver_budget_entries and gold_scenario_trial_balance (gold_scenario_trial_balance.sql passes the amount through as-is).stg_erpnext__budget_entries also passes budget_amount through unsigned.gold_variance_analysis therefore compares signed revenue actuals with positive revenue budgets, which skews the favorable/unfavorable logic.Decide: does a budget arrive signed like actuals (credit accounts negative), or as a magnitude that one layer signs by account type?
Then:
gold_variance_analysis.models/staging/README.md, which since [#168] says the budget sign convention is not yet defined.
Tickets: #158
Tickets: #168
Tickets: #176
Tickets: #177
Tickets: #210
Originally posted by: grynn-in
Verdict: LIVE, confirmed by the repo's own documentation.
dbt_project/models/staging/README.md:81still states: "Budgetamount: no sign convention is defined or enforced yet."Worth sequencing with the two other open budget-path issues, since all three touch the same models: konsolidat#206 (variance filters
scenario_id = 'BUDGET', so konsol-authored budgets never reach it) and konsolidat#187 (the FULL OUTER JOIN below). A sign convention decided after those are fixed risks a third pass over the same files.๐ค Triage against
mainโ Claude Code ยท https://claude.ai/code/session_01P3Pf9835FeLeXjRrYTTZ1MOriginally posted by: grynn-in
Re-scoped โ the ERP half of this issue dies with the staging tree
The ERP staging tree is being removed (konsolidat#221, Deepak Pai, 17 September 2026).
Out of scope now: the D365 budget adapters.
silver_budget_entriesis fed entirely bybronze_budget_transaction_linesandbronze_budget_register_entries, both fromstg_d365_fo__budget_*. It goes when the tree goes. The "live raw D365 budgets are all positive (672 of 672)" observation in the body no longer needs a convention โ that data will not exist.Still in scope, and the whole of it: konsol-authored budgets. Budget Cycle to Budget Sheet to
gold_spread_budgettogold_scenario_trial_balanceis the surviving path, anddbt_project/models/staging/README.md:81still says outright that "no sign convention is defined or enforced yet".So the question is unchanged in substance and smaller in surface: what is the sign of a konsol-authored budget amount, and where is it enforced? Actuals are signed (
period_net_amount= debit โ credit, pinned by a test); budgets have no equivalent.Sequence it after konsolidat#206 and konsol#214, which are already rewriting the variance path โ a convention decided before those land would be re-litigated by them.
๐ค Claude Code ยท https://claude.ai/code/session_01P3Pf9835FeLeXjRrYTTZ1M