[GNC-dev] Report with Fiscal Year

john jralls at ceridwen.us
Mon Sep 6 02:05:25 EDT 2021

OK. I know what the general definition of a fiscal year is. I used to be a US Navy supply officer and had to keep books "the Navy way" (as in "the right way, the wrong way, and the Navy way"). The US Government operates on a fiscal year running from 1 Oct to 30 Sept. (It used to be 1 July to 30 June but in 1974 Congress tried to give itself 3 extra months to get a budget and appropriations passed. The extra time didn't help, but there was a special 3-month fiscal year in 1976 called the T-year... funded under continuing resolution authority, of course). Flywire's bug reports and request here suggested to me that that wasn't what they meant so I asked.

GnuCash uses the term Accounting Period for non-calendar fiscal years. There are two problems with this: First, it's in Preferences instead of File properties so a user can't have different books with different fiscal years and two users of the same book have to set their preferences to the same Accounting Period. Second and maybe worse it sets specific dates that don't roll over.

Unfortunately Chris's PR attempts to address this in Scheme. While the options (but not preferences) including the file properties are partly implemented in Scheme (I have a substantial feature branch for the next major release that fixes that) for the most part Scheme code isn't visible to the C parts of the program and some of those (the summary bar and some Accounts page columns come immediately to mind) will also need to be adjusted to accommodate the change and of course the date stuff has to be somewhere that's visible to the C code. date-utilities.scm isn't that place. Moreover Chris's PR leaves the accounting period preference in place because as I said preferences are in C and Chris hadn't learned C when he wrote that PR. He's since--to his very great credit indeed--learned C and done some really good work fixing some long-standing memory leaks. 

Aside from the options code change that will be mostly invisible to users changing the Accounting Period from preferences to book options will be a breaking change for those who make use of it and will have to be guarded with a feature-flag: If you set a non-calendar-year repeating accounting period in GnuCash 5 it won't be loadable in GnuCash earlier than the last 4.x release.

Until we can get all of that implemented I'm afraid that the best option is to continue to change the accounting period every year.

Since this is the developer list it's worthwhile to discuss how a good rolling accounting period UI would look. If we assume that short years are exceptional and can be accommodated with absolute dates like the 1 July 1976 - 30 September 1976 T-year then we can also assume accounting periods are otherwise a full year, they just don't start 1 January. I see a lot of websites that use two combo boxes for this, the first with 1-31 for the day of the month and the other with the 12 months. Does that seem reasonable for GnuCash?

The current Accounting Period UI allows for less than a year accounting periods with what to my eye are a bit weird alternatives: One can select independently an accounting period that e.g. begins at the beginning of last quarter and ends at the end of this month. IIUC that will create an accounting period that will vary in length from 3 to 6 months depending on the current month, which seems a good way to drive oneself nuts. I propose to remove that. Does anyone find it useful and if so how?

John Ralls

> On Sep 5, 2021, at 7:23 PM, flywire <flywire0 at gmail.com> wrote:
> I see Chris has pushed a PR through which appears to provide this
> functionality. I'd like to work on other reports too and this was a
> learning exercise as much as anything. What it doesn't do is help me as a
> community member develop skills with reports so I can work on those parts
> of the software I see as a priority that others aren't interested in.
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel

More information about the gnucash-devel mailing list