GNOME Bugzilla – Bug 541541
RFE: auto-hide unused accounts
Last modified: 2018-06-29 22:06:38 UTC
Large account trees like those used in German business accounting would profit if there was an option to hide all unused accounts (those without any transactions)
You can configure gnucash to hide zero-value accounts. Is that not sufficient?
Something that is reasonably close although not the same View -> Filter By -> Other
well, some accounts are meant to have zero balance (I have some accounts like that to check if payments have been made). They should of course be shown. So it certainly is a helper, but not 100% the same.
a minor detail in that regard. a zero-balance account that becomes non-zero is not shown until the view is refreshed.
Created attachment 275750 [details] [review] Patch to implement that RFE Added a checkbox on "Filter by -> Others" to show (default) or hide accounts that don't have any transactions. If an account does not have any transactions, but its children do, it will still be shown (unlike the zero total amount). Default behavior is same as current.
Comment on attachment 275750 [details] [review] Patch to implement that RFE Thank you for your patch. I have committed it after I fixed a compiler warning (which is converted in an error in my configuration): The call to g_return_val_if_fail in your new function xaccAccountGetNrSplits will expand to "return NULL" if acc is not a valid Account. Since your function returns a gint64 this is a type mismatch. I have changed it to return 0 which I what you probably meant. I have a few comments I like to add also: * I have noticed git am frequently complains about whitespace errors in your patches. I usually eliminate them by calling git am --whitespace=fix so they're not really a big deal except that now your local commit doesn't match my pushed commit anymore. Perhaps you can configure your editor to avoid these white-space issues proactively. Most whitespace errors are trailing whitespace or mixing tabs and spaces to indent your code. Some editors can be configured to correct these automatically. * I have taken the liberty to rename xaccAccountGetNrSplits to xaccAccountCountSplits in a follow-up commit. I have done so to get a more consistent api because there is also a function xaccTransactionCountSplits. More consistency == easier to work with. * I have also slightly modified the documentation for the new function. Specifically I changed your \note construct to explain the parameters into using @param which is the construct specifically designed for that. * For completeness I'll note that the first time a book is opened after this commit a warning will be printed in gnucash.trace: WARN <gnc.gui> error reading group Page 1 key ShowUnused: Key file does not have key 'ShowUnused' It's harmless in itself as the next restart the new key will be in the state file anyway. But I mention it here so bug followers are aware this will happen. Thanks again for the patch
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=541541. Please update any external references or bookmarks.