GNOME Bugzilla – Bug 570042
Better default for book-closing entries in Income Statement Report Options
Last modified: 2018-06-29 22:17:15 UTC
Currently, if I use the "Close Books" feature on December 31 to close out 2008's income/expense accounts, and then I run a normal Income Statement from 1/1 through 12/31, income/expense will show zero across the board because the income statement is including the book-closing entry in its calculations. The income statement should know to ignore the book-closing entry in order to correctly be showing the period's income. Other information:
The report options of the Income Statement have a tab called "Entries". I guess if you make sure that the pattern string matches the description of your book-closing entries this will solve your problem?
You're right, I just played with that and it does work. So perhaps a usability tweak to make this more intuitive to users like me, would be to have a default string in the "Close Books" feature to describe the entries, and then have that same default string in the "Entire" area you described in Income Statement options. That way if the user doesn't monkey with the description, then they will still get the income statement they expected. Or even, if the description entered in the "Close Books" feature automatically updates what the "Entries" section looks for to filter out in the Income Statement options, it'd be even better.
Any proposal for a default string in the "Close Books" feature and also in the "Entries" option? The second idea would indeed be nicer, but is virtually impossible to be implemented.
I have an alternative suggestion. In short: Update the database schema to include a boolean flag at transaction (or split) level to identify the transaction as a book-closing transaction. At a minimum: * Update the database schema (sqlite, postgres, mysql) to add a column to the transactions table called "closing_entry". * Update the XML schema to add an element called "<trn:closing-entry>". * Update income/expense related reports to exclude any transactions where the closing entry flag is set to 'y'. * Update the Close Books routine to set the closing entry flag to 'y' for each transaction created by the routine. Possible addition: * Update the report customization screens to give users an option to exclude the closing entries from the report. * The default for the option would be 'exclude'. Honestly, I have a hard time envisioning a use case for the include/exclude option, but users (myself included) seem to prefer customization over the application making a choice for you.
(In reply to comment #4) > In short: Update the database schema to include a boolean flag at transaction > (or split) level to identify the transaction as a book-closing transaction. At first sight, I thought this is way too much overhead. After thinking about it for a moment, I think your suggestion is indeed the correct solution to this problem. After all, the book closing transactions *are* special and different from the normal ones, so we need a boolean criterion that comes from somewhere anyway. Hence, the most obvious solution is to add exactly this boolean option directly into the database. I agree with that proposal. However, someone "just" needs to put this into code...
Actually, this boolean flag has been there for a while.. You installed it on 2010-03-02, Christian. Just today I added two APIs to make it a little more official. I added xaccTransGetIsClosingTxn(txn) and xaccTransSetIsClosingTxn(txn,flag). I re-used the same slot value, so we should be compatible with any closings that used this field. Of course closings done with 2.2.x or versions of 2.3.x prior to March 2nd wont have this flag set. Updating the reports to ignore these transactions is left as a future exercise.
Created attachment 182031 [details] [review] Proposed patch: make reports ignore book-closing entries I chose to: - Change the reports' default behavior to have them ignore the book-closing entries. - Do not change anything in reports that deal explicitly with them. Here is the content of this patch (everything is under gnucash/src/report): - In function gnc:account-get-trans-type-balance-interval, depending on an argument, closing entries can be ignored (they are identified by xaccTransGetIsClosingTxn). - Some report utility functions are duplicated (with a "-with closing" suffix) to provide the legacy feature. - Equity statement and Profit & Loss reports are modified to call the *-with-closing functions. It tested this patch against SVN head (rev 30345) with a linux OS (Ubuntu 10.10 x86_64). This is only my second contribution, so it should be taken with all due prudence. Let me know if I can improve something.
Comment on attachment 182031 [details] [review] Proposed patch: make reports ignore book-closing entries I think the patch is fine and should be committed. (It was good to note it on gnucash-devel additionally. Thanks!)
Comment on attachment 182031 [details] [review] Proposed patch: make reports ignore book-closing entries r20404, thanks a lot!
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=570042. Please update any external references or bookmarks.