Plan: making GnuCash usable for Swedish businesses (account merge by code, SIE, templates)

John Ralls jralls at ceridwen.us
Thu Nov 26 08:49:31 EST 2026


Isak,

Please remember to copy the list on all replies. Reply-all works well; some mail clients also offer a reply-list option that also works.

I agree that the mismatch is a bug and that your choice is the correct one. You can just submit a PR on stable, no need for a bug report.

I think Alex monitors this list so he’ll probably chime in when you start discussing income tax handling in more detail. If not we can always ping him on the PR.

Just to be sure you’re on track with the SIE code, the PR’s placement is fine. There’s no need for a locale-specific directory in gnucash/import-export.

Regards,
John Ralls

> On Nov 26, 2026, at 05:01, Isak Adamssvärd <isak.adamssvard at witsig.se> wrote:
> 
> John,
> 
> Thank you for the welcome and for the detailed answers. Adjusted plan:
> 
> 1. Account merge. 
> I'll drop matching by code and experiment with it in my own repo.
> 
> One thing remains that I think is a bug: The preview in the hierarchy assistant matches by full name, while account_trees_merge searches all descendants by name. With Assets:Current Assets:Bank in the book and Assets:Bank in the template, the preview says the account will be created and offers an opening balance field, but the merge finds the deeper Bank and creates nothing. I'll file it in Bugzilla. My fix would make both use the same rule, name among the direct children of the matched parent, which is what the preview shows today. That changes what the merge does in cases like the one above.
> 
> Is that acceptable for stable, or should it go to future?
> 
> 2. SIE. 
> Thanks, I'll do it that way: alfs's commits rebased on future, with his authorship kept, and my work on top, as a new PR against future. I'll give him until early December to answer first since I won't have time to finish it before then anyway.
> 
> 3. Tax reporting. 
> Got it. Starting from the sales tax tables and look into the VAT and GST pages in the wiki and the gnucash-user threads before proposing anything for VAT. Income tax reporting can wait until after 6.0. I'll try to reach Alex to discuss it then.
> 
> 4. Lock date and numbering. 
> Understood. I won't pursue them in GnuCash and keep experimenting with it in a separate repo.
> 
> 5. Answered, thanks. The question "Where do you want the line for country-specific code in the main repository?" was referring to code related to SIE 4 export and import (the Swedish interchange format) and VAT report with the Swedish boxes. Your answers to questions 2,3 and 5 was enough for me to understand the structure and what to look at next.
> 
> About the account templates. The content will be the BAS chart itself, generated from the files BAS publishes (it is maintained by the Swedish accounting profession through BAS-intressenternas Förening). It's basically a revision on the existing 2019 templates and I'm just making a conversion of the newer version. The generator will be checked against the source files, and the new template test covers loading them, so I don't think independent review should be neccessary.
> 
> Best regards,
> Isak Adamssvärd
> 
> IA Capital Group AB
> Web & IT-Service
> https://witsig.se <https://witsig.se/> https://witsig.se/
> 
> Tel: 072-7157270 tel:+46727157270
> E-post: isak.adamssvard at witsig.se <mailto:isak.adamssvard at witsig.se> mailto:isak.adamssvard at witsig.se
> 
> 
> 
> 
> 26 november 2026 kl. 03:13, "John Ralls" <jralls at ceridwen.us <mailto:jralls at ceridwen.us> mailto:jralls at ceridwen.us?to=%22John%20Ralls%22%20%3Cjralls%40ceridwen.us%3E > skrev:
> 
> 
>> 
>> Isak,
>> Welcome to GnuCash!
>> 
>> I’ll get to the account template fixes in the next few days.
>> 
>> Question 1: I’m not sure this is a good idea. It seemed reasonable at first blush provided that there was a requirement that the chain of parent accounts matched all the way down, but it occurred to me that matches could still be possible even if the book’s accounts coded Active and Passive as 100000 and 20000 respectively and the template did the opposite. I don’t think there’s a way to resolve that reliably without getting the user involved. It’s a new feature so it would go on the future branch.
>> 
>> Question 2:  I don’t think there’s a way to transfer authorship of a PR so the simplest way would be to fetch alfa’s branch, rebase it on current future (that way git won’t be able to tell that it’s the same) and resubmit it as a new PR. At this point that’s also a new feature so it would need to go on the future branch.
>> 
>> Question 3: GnuCash currently has two separate tax reporting schemes: TXF for US personal income tax reporting, and sales tax tables for the invoicing system. We have a lot of users in various countries using the sales tax tables for collecting VAT. There are several articles in the wiki about handling VAT in various countries; you can access them by typing VAT in the wiki’s search bar. You might also search for GST as that’s what VAT is called in Australia and Canada (and probably other places). It also comes up pretty often on the user mailing list so do a web search for site:lists.gnucash.org/pipermail/gnucash-user <https://lists.gnucash.org/pipermail/gnucash-user> https://lists.gnucash.org/pipermail/gnucash-user  VAT. 
>> 
>> If you want to do something about income tax reporting I think that will require a substantial redesign because the current design is very closely coupled to the US TXF format. We’ll need to include Alex Acinena, the creator and maintainer of the TXF report and its engine pieces, in that discussion. I doubt that there’s time to get that into 6.0 before feature freeze next February.
>> 
>> Question 4: I don’t think that lock date and transaction numbering are feasible with GnuCash’s overall design. We’ve always advised businesses that require that level of built-in controls that GnuCash isn’t suitable for them.
>> 
>> Question 5: I don’t understand what you’re asking. The only locale-specific code is for the TXF reports and it’s divided between libgnucash/tax and gnucash/report/reports/locale-specific. If you’re asking about where to put income tax reporting code, that’s where. If it’s about something else we’ll have to create a new directory in the appropriate place for the code that you’re writing.
>> 
>> New account templates are no problem. I can’t check them for correctness so it will be completely up to you. I suggest that you have them reviewed by an accountant licensed in Sweden to ensure that you get them right.
>> 
>> Regards,
>> John Ralls
>> 
>>> 
>>> On Nov 24, 2026, at 04:59, Isak Adamssvärd <isak.adamssvard at witsig.se <mailto:isak.adamssvard at witsig.se>> wrote:
>>> 
>>> Hello,
>>> 
>>> I'm Isak Adamssvärd, a developer in Sweden. I'd like to make GnuCash a
>>> realistic choice for small Swedish companies and sole traders, and I
>>> intend to maintain what I contribute, including the yearly updates this
>>> kind of thing needs. Following John's advice to sketch larger changes
>>> here first, this is the outline. I'd rather hear "no" or "not like
>>> that" now than after writing code.
>>> 
>>> Disclosure: I work with an AI coding assistant and follow the draft AI
>>> policy on the wiki. I review and can explain everything I submit, and I
>>> will keep the pull requests small enough for that to be true.
>>> 
>>> Already submitted:
>>> 
>>>   PR #2369  Three small fixes in the sv_SE account templates.
>>>   PR #2370  A test that reads the account templates of every locale.
>>>             It found one of the errors fixed in #2369.
>>> 
>>> What I'd like to do, general things first.
>>> 
>>> Generally useful:
>>> 
>>>   * Match accounts by account code when merging a template into an
>>>     existing book.
>>>   * Per-account reporting codes (tax form field, VAT box) behind an
>>>     accessor.
>>>   * A fixed period lock date and gapless transaction numbering.
>>> 
>>> Sweden-specific:
>>> 
>>>   * Updated BAS account templates, built from the chart of accounts
>>>     published at bas.se <https://bas.se/> like the current 2019 ones.
>>>   * SIE 4 export and import (the Swedish interchange format).
>>>   * A VAT report with the Swedish boxes.
>>> 
>>> Questions:
>>> 
>>> 1. Account merge. account_trees_merge matches by name, recursively
>>>    among all descendants, while the preview in the hierarchy assistant
>>>    matches by full name, so the two can disagree. I'd like to make both
>>>    use one rule: a unique account code if the template account has one,
>>>    otherwise the name among direct children. Templates without codes
>>>    would behave as today. Is that welcome, and for future or stable?
>>> 
>>> 2. SIE. PR #2217 exports SIE 4 but stalled in review. I've asked its
>>>    author about cooperating. I'd propose an import/export module rather
>>>    than a report: the format requires CP437, it has a symmetric import,
>>>    and a plain C++ core (codec, model, writer, parser) can be unit
>>>    tested, which was the main review objection. If the author doesn't
>>>    return, may I supersede the PR with proper attribution?
>>> 
>>> 3. Reporting codes. Swedish accounts need both a tax form code (SRU)
>>>    and a VAT box, and tax-US/code holds one code. Would an accessor
>>>    like xaccAccountGetReportingCode (account, scheme) be acceptable,
>>>    given the 6.0 goal of hiding KVP? It would also fit German
>>>    Kennzahlen or UK VAT boxes.
>>> 
>>> 4. Locking and numbering. Swedish rules (like German GoBD) require
>>>    that posted entries are locked, corrected only by reversing entries,
>>>    and numbered without gaps. Is there interest in a fixed lock date
>>>    per book in addition to the rolling read-only threshold, and in an
>>>    "assign numbers" action? I would not touch the engine before 6.0;
>>>    I'm asking about direction and timing.
>>> 
>>> 5. Where do you want the line for country-specific code in the main
>>>    repository?
>>> 
>>> Non-goals: no network code or filing with authorities from GnuCash, no
>>> new dependencies, no schema changes, nothing in po/.
>>> 
>>> Order of work: account merge by code for 6.0 if you agree, SIE export
>>> after that in small pieces, the rest in 6.x.
>>> 
>>> Thanks for reading,
>>> Isak Adamssvärd
>>> 
>>> IA Capital Group AB
>>> Web & IT-Service
>>> https://witsig.se/ https://witsig.se/
>>> 
>>> Tel: 072-7157270 tel:+46727157270
>>> E-post: isak.adamssvard at witsig.se <mailto:isak.adamssvard at witsig.se> mailto:isak.adamssvard at witsig.se
>>> 
>>> _______________________________________________
>>> gnucash-devel mailing list
>>> gnucash-devel at gnucash.org <mailto:gnucash-devel at gnucash.org>
>>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20261126/a1aaceaf/attachment-0001.htm>


More information about the gnucash-devel mailing list