[GNC-dev] How do I get the "sign" (or side) of the transaction from the account or transaction element in xml?

Frank H. Ellenberger frank.h.ellenberger at gmail.com
Sun Jul 11 00:33:19 EDT 2021




Am 11.07.21 um 03:00 schrieb Arman Schwarz:
> Hi,
> I probably didn't use the right terminology in the title. I've implemented
> balance assertions for gnucash myself since I couldn't find that feature in
> gnucash (https://github.com/armanschwarz/gnc_tools). This allows me to put
> expected balances into the ledger and ensure that they remain that way even
> if I make changes later on.
> This works fine except for the fact that I have to put my assertions in as
> negative numbers, e.g. if they're in a liability account. This makes sense
> from an accounting equation perspective but it's counterintuitive to see a
> negative balance assertion in the ledger against a positive "balance"
> (since gnucash GUI shows a liability as a "balance" while the sum of the
> transaction values in the XML file will be negative).
> It would be helpful if I could somehow look in the transaction element in
> XML and figure out whether the "balance" value should be multitplied by 1
> or -1 before comparing it with the sum of the individual transactions.
> Looking at the XML file though, I didn't see any values that would tell me
> this. I could construct a dictionary of "act:type" to "sign", but then I'd
> have to manually maintain a possibly large dictionary. That's not the end
> of the world, but if that's the solution, is there an exhaustive list of
> account types and their sign that I could get access to?
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel

More information about the gnucash-devel mailing list