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

Arman Schwarz armanschwarz at gmail.com
Sun Jul 11 04:36:40 EDT 2021


Hi Frank, I'm not sure how this helps. Are you suggesting that I should
change the way the GUI renders the balances? I had hoped to instead just
find a way to programmatically know the sign of the balance from looking at
the XML. If that makes sense.

On Sun, 11 Jul 2021 at 14:33, Frank H. Ellenberger <
frank.h.ellenberger at gmail.com> wrote:

> Hi,
>
> see
> https://code.gnucash.org/docs/C/gnucash-help/set-prefs.html#prefs-accounts
> and
> https://wiki.gnucash.org/wiki/Configuration_Locations#GSettings
>
> HTH
> FrRank
>
> 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