[Bug 570042] Book-closing entries in reports: proposed patch

Tristan Faujour tristan.faujour at gmail.com
Sun Feb 27 05:01:17 EST 2011

Hi all,

I submitted a patch for bug #570042.
See https://bugzilla.gnome.org/show_bug.cgi?id=570042

Here is the trouble: The book-closing entries pollute some reports (e.g. 
Income over time or Income/Expense chart). Other reports are explicitly 
dealing  with book-closing entries (usually, the reports that are 
related to equities: Equity statement, Profit & Loss).

Thanks to Christian and Derek, there already are APIs to deal with an 
"is-closing-transaction?" flag. So most of the work was already done. 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 
- 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 20345) with a Linux OS 
(Ubuntu 10.10 x86_64).

This is only my second contribution, so it should be taken with all due 
Let me know if I can improve something.

More information about the gnucash-devel mailing list