Bug 336843 - Attach files to Transactions

Patrick patrick at setsuid.net
Fri Nov 8 14:34:23 EST 2013

Hi folks,

I've been a gnucash user for several years and have always wanted the
ability to attach my scanned invoices or receipts to transactions.

Lurking about for some time, I'd been following bug #336843 and several
threads of others wanting similar functionality. Rather than wait
patiently, I found a few free hours last weekend and decided to attempt to
implement this myself.

Attached you'll find a patch which works adequately for my needs, but I
wanted to share with the larger community.

Primary functionality:
 - User selects a file via a dialog, the URI is stored in a new char* in
the Transaction structure.
 - User can similarly launch the associated file via the Transaction menu.
(Launches via gtk viewer, so filetypes such as .JPG, .PDF, etc are already

The functionality works under Linux with the XML backend, however there are
a few untested areas and TODOs:
- SQL backend (untested), I added a column which of course would cause
issues for existing tables.
- Code to execute the associate file is modeled after gnc_gnome_help() -
which is platform dependent. I have no objective C experience so the Mac
functionality is completely not implemented. Windows is untested and likely
needs a tweak or two.
- Lastly, and a minor tweak - I intended to find the menu for the
right-click menu on a transaction and add similar menu options to what I
added in the Transaction menu.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnucash_336843-1.diff
Type: text/x-patch
Size: 25532 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20131108/5b3c5d35/attachment.bin>

More information about the gnucash-devel mailing list