Skip to content

Custom GnuCash transaction report with ability to sort and subtotal by user-defined tags

License

Notifications You must be signed in to change notification settings

dawansv/gnucash-custom-reports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Reports for GnuCash 5.x

Introduction

This is repository contains a series of custom reports for GnuCash 5.x.

Transaction Report Extended

Filename: transaction-extended.scm

Description: Based on the built-in transaction report, it provides these additional features:

  • a Sort by Substring option which includes a regular expression match similar to the one offered for the transaction filter. That feature is the generic version of the Transaction Report with Tags.
  • a new option on the display tab called "Use More Permissive Match for Other Account Name and Code". This option enables a more permissive match for the other account name and code in order to reduce the number of "split transaction" account names with multisplits.

Transaction Report with Tags

Filename: transaction-tags.scm

Description: An earlier version of transaction-extended.scm that focusses on Sort by tags specifically. It was releases as a proof-of-concept to provide some basic features related to the long-discussed request of being able to use orthogonal categories, classes, tags or "analytical dimensions" to retrieve and group transactions across several general ledger accounts. See https://bugs.gnucash.org/show_bug.cgi?id=113772

Limitations: This custom report is not a feature-rich solution. It only provides one type of report (similar to the existing transaction report) and does not provide any feature to "bulk manage" existing or future user-defined tags. So there is no feature to bulk rename, bulk move or bulk delete tags for instance. All changes to the data file (adding and changing tags) are done manually by the user. This feature only provides a custom report that uses tags as created by the user.

Installation

Custom reports can be easily installed and uninstalled and do not modify the core GnuCash files nor the data file.

Specific instructions below are based on more generic instructions on how to load custom reports available on the wiki: https://wiki.gnucash.org/wiki/Custom_Reports#Loading_Your_Report

Step 1. Download and Unzip the files

Download the zip with the files from the Github Code button. Then unzip the files in a temporary directory.

image

Step 2. Copy transaction-tags.scm in the installation directory for custom reports

  1. Start GnuCash 5.0
  2. Go to menu Help - About
  3. In the About GnuCash dialog, locate the entry for GNC_USERDATA_DIR. It's the first entry in the list. Keep note of this directory. You can even click on the link to open it.
  4. Copy the [report-filename].scm files of your choosing extracted from the zip file into that directory.

Step 3. Locate the installation directory for the custom reports definition file (config-user.scm)

Custom reports need to be initialized in a config file called config-user.scm

Go back to the About GnuCash dialog from Step 2.

This time locate the second entry GNC_USERCONFIG_DIR. Click on the link to open the directory.

Step 4. Update or create config-user.scm

If there is already an existing file called config-user.scm in the directory from Step 3 then you need to edit that file and add whichever of these lines match the report(s) you want to enable:

(load (gnc-build-userdata-path "transaction-extended.scm"))

(load (gnc-build-userdata-path "transaction-tags.scm"))

If there isn't a file called config-user.scm in that directory, then you can either create one and put the above line in it or you can simply use the file that came with the zip file.

Step 5. Restart GnuCash

After restarting GnuCash, the custom "Transaction Report with Tags" should be available under the Reports - Experimental menu.

Report Features

Transaction Report Extended

(TO DO)

Transaction Report with Tags

A new tags sort key is made available in the primary and secondary key drop-down list, in the sorting options.

image

To see the transactions grouped by tags, one should select that key as well as enable the subtotal for the level selected.

More options are made available at the bottom of the sorting options.

image

Tag Prefix

  • By default, the sort engine will look for tags starting with #. However to accomodate the ability to tag multiple dimensions (meaning several tags per transaction), the user is able to change that prefix to any character (even the # could be changed). For instance you could use tags for a project dimension, for instance #P-XXX where XXX is your project reference, so #P-001 #P-002 etc. You could also use tags for different departments so #D for instance, #D-MKTING #D-FINANCE, etc. Then to run a report on the project dimension, set the tag to #P, for the department dimension set the tag to #D.
  • A checkbox allows to select the option to remove the prefix from the subtotal heading, so #D-FINANCE would simply show as FINANCE as the heading for instance (assuming #D- is entered as prefix)
  • The tag search is first applied to the split memo, then if no match the transaction notes, then if no match the transaction description. Only the first matched tag (as per the prefix) is considered.

No-Match Heading

This is the heading that will be used for the subtotal group listing transactions with no match. A checkbox allows to automatically add the prefix to it or not.

Examples

Here is an example of a report sorted with the defaults on first level. Second level is sorted by account. I am using 2 tags in this sample file: #P-Anna and #P-Bob. Untagged transactions are listed at the bottom in the No Match # section. image image

Here is an example where I change the headings with these options. image

Now my headings are a cleaner Anna, Bob and Nobody. image image

It is possible to remove the transactions with no matching tags by using the existing transaction filter (filter tab). Simply put the same tag prefix (# or whatever else you are using) in the Transaction Filter field. image

Here only Anna and Bob are listed. No-match "Nobody" is no longer there. image

Now I only want to see unmatched transactions. image

These are just transactions that are not assigned to anybody image

I could show Anna and Nobody, excluding Bob from the view (his transactions are excluded, not in nobody) image

Here is just Anna and Nobody image

Many more variations are possible, thanks to the wonderfull filter feature.

About

Custom GnuCash transaction report with ability to sort and subtotal by user-defined tags

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages