Agent context
Fortnox models
5 SQL models that turn the raw Fortnox tables into the reports people ask about. Deploy them in Weld and your agent queries the definitions behind every number.
How the set is built
- 6Raw tables
- 7Staging
- 6Core
- 5Analytics
Staging cleans each raw table once, core holds the logic, and analytics is the table dashboards and agents read.
- General ledgerThe general ledger (huvudbok): every booked voucher row with its voucher, account and financial year. Recreates the transaction list behind Fortnox's Huvudbok report.grain: one row per voucher row (financial year x voucher series x voucher number x row index) · 4 raw tables
- Payables agingAccounts payable aging (leverantörsreskontra): every supplier invoice with an open balance, bucketed by days past due as of today.grain: one row per open supplier invoice · 1 raw table
- Profit and loss by monthIncome statement by month (resultaträkning per månad), at account level with the BAS report line alongside so it can be rolled up to the statutory layout in BI.grain: one row per financial year x month x account, income statement accounts only (BAS 3000-8989) · 4 raw tables
- Receivables agingAccounts receivable aging (kundreskontra, förfallna fakturor): every customer invoice with an open balance, bucketed by days past due as of today.grain: one row per open customer invoice · 1 raw table
- Trial balanceTrial balance per financial year (saldobalans): opening balance, the year's debits and credits, and closing balance for every account.grain: one row per financial year x account · 4 raw tables
- Weld or dbt
- The same SQL in both dialects. Sync the folder with GitHub Sync, or copy the dbt models into your project.
- Check before you rely on it
- Reconcile a month against Fortnox's own reports first. Each model's notes say what the synced data can and can't support.
Connect Fortnox.
Your agents start with context.
Sync Fortnox to your warehouse, deploy these models, and query them from Claude, Cursor or ChatGPT over MCP. Free for 14 days, no credit card.