Dear Gnucash Developer Team,

I'm sometimes confronted with questions about how the memo fields of imported 
transactions in apps are generated and how this could be modified by the user.

IMHO the current way this work is divided between apps and AqBanking is the 
best possible. AqBanking provides the relevant information in AB_TRANSACTION 
and the app must decide for itself if and how it wants to use or combine that 
information to generate memo strings.

To help with this I just added a basic function to AqBanking which creates memo 
strings for transactions using template strings. Such a string could be stored 
e.g. with account settings.

A template string in context of this function can contain fixed text and/or names of variables of a 
AB_TRANSACTION object (e.g. "$(purpose)" or "$(remoteName)").

A template string of "$(purpose)" would just return the value returned by 
AB_Transaction_GetPurpose().
More complex strings like "$(purpose) $(transactionText) $(ultimateCreditor)" 
could combine multiple fields.

The function is "AB_Banking_ConstructMemoFromTemplate()" in AqBanking's 
src/libs/aqbanking/banking_transaction.c" (less than 30 lines of raw code, so easily 
usable as code basis for your own implementation).


Regards
Martin Preuss


--
"Things are only impossible until they're not"

_______________________________________________
gnucash-devel mailing list
[email protected]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to