Bug 336843 - Attach files to Transactions

Christian Stimming christian at cstimming.de
Sat Nov 9 17:19:26 EST 2013

Hi Patrick,

thanks for the patch and for working on this! I think it is great to see some 
development on this feature at last.

As John has already pointed out, directly adding a new field in the data 
structures should be avoided, but storing the data in kvp frames will probably 
work for you just as well.

The right-click menu is probably rather easy: As you already have the action 
implemented, IIRC it's just a matter of adding it to the respective -ui.xml 
files or something similar, where just the same action should be called. I 
might be wrong on this, though.

I'm looking forward to giving it a try even though I don't have time for this 
right now. But the feature has been asked for by a lot of people and for a 
long time by now. Thanks a lot for the first step. 



Am Freitag, 8. November 2013, 14:34:23 schrieb Patrick:
> 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
> handled.)
> 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.
> Regards,
> Patrick

More information about the gnucash-devel mailing list