Generate reports
Generate the three PDF bookkeeping reports (kontokort, journal, bilagsoversigt) for the year. Trigger when the user asks to "generate reports", "lav PDF rapporter", "run the reports", "make the kontokort", or after build-workbook completes. Runs scripts/run_reports.py which imports the latest xlsx into SQLite and renders the three PDFs.From its SKILL.md
npx -y skills add NOGIT007/holding-accounting --skill generate-reportsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.0 KB, 989 tokens by cl100k_base, as published. Nobody here has run it
Generate the year's PDF reports
The three PDF reports are the deliverables a human reviews before approving the year. They are deterministic Python scripts — no LLM in the loop — built on top of reportlab.
Reports produced
In regnskab{YYYY}/output/:
{YYYY}_kontokort.pdf— account statement. Per account in the period: opening balance, every line chronologically with running total, closing balance. Only accounts with movement OR non-zero primo. Grouped by account type.{YYYY}_journal.pdf— bookkeeping journal. All entries chronologically, grouped byBilag, with per-bilag and grand totals (debet must equal kredit).{YYYY}_bilagsoversigt.pdf— document-centric pre-posting check. Four sections:- Documents in
input/linked to journal lines. - Documents not yet linked.
- Real journal lines without an attached document (orphans — must be resolved).
- System-generated entries where no document is expected.
- Documents in
Prerequisites
scripts/is installed (uv pip install -e .from the scripts folder).- The latest
{YYYY} {Company}-vN.xlsxexists inregnskab{YYYY}/. regnskab{YYYY}/input/contains the source documents (the bilagsoversigt scans this folder).
Command
cd scripts
python run_reports.py {YYYY}
This:
- Imports the highest-versioned workbook into
regnskab{YYYY}/ledger.db. - Renders all three PDFs into
regnskab{YYYY}/output/. - Prints the path to each PDF on stdout.
For a partial period:
python run_reports.py {YYYY} --from {YYYY}-01-01 --to {YYYY}-06-30
For a different root folder:
HOLDING_ROOT=/path/to/data python run_reports.py {YYYY}
# or:
python run_reports.py {YYYY} --root /path/to/data
When to re-run
- Every time the workbook version is bumped (
-v3→-v4). - After new files are added to
input/(the bilagsoversigt scan picks them up). - Before any approval gate.
Report-specific notes
Kontokort
- Accounts grouped by
Typecolumn (AKTIV, PASSIV, EGENKAPITAL, RESULTAT). The import script readsTypefrom theSaldobalancesheet. - "Konto nr." includes any dimensions (e.g.
6480-MAINBANK-FOLIO). The aggregate parent (e.g.6480) is not collapsed in this report — that is intentional.
Journal
- Sorted by date, then by Bilag number. Within a Bilag, lines preserve their input order.
- Per-bilag totals shown at the end of each Bilag block.
- Grand totals at the end.
Σdebet − Σkredit = 0is the test.
Bilagsoversigt
- The control that catches missing documents before the user approves the year.
- Section 3 (real lines without a document) is the load-bearing list. It must be empty (or every entry must be explicitly system-generated) before approval.
- The link sources are: explicit
Bilag-filcolumn (preferred), fallback to filename stem == Bilag.
Output for the approval gate
After running, present the user with:
- The three
computer://links to the PDFs inregnskab{YYYY}/output/. - The summary numbers: total bilag, total debet/kredit, number of orphan lines, number of unlinked documents.
- The reconciliation summary from the workbook's
Recon {Bank}sheets.
HARD STOP. Do not proceed to statutory annual report or ERP push until the user explicitly approves.
Customizing the PDF look
Title, colour, font are in scripts/_pdf.py. The company name in the title comes from settings/business.md (first H1) or the COMPANY_NAME environment variable. To change:
- Branding: edit
_pdf.pyconstants (INK,MUTED,H1,H2). - Title text: edit the
Paragraph(...)call near the top of eachreport_*.py. - Page size / orientation: each report sets
landscape_orientationondoc(...).
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.