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

Geert Janssens geert.gnucash at kobaltwit.be
Sun Jul 11 07:50:49 EDT 2021


Op zondag 11 juli 2021 13:38:43 CEST schreef Arman Schwarz:
> Thanks Geert,
> 
> I'm aware of the need to think in terms of debit/credit signs, but my
> question was how I could know whether a positive value in the split element
> in the XML will increase or decrease the "balance" that the user sees in
> gnucash.
> 
> This depends on the side of the accounting equation the account is on, e.g.
> positive split values increase the balance of an asset account, but
> decrease the balance of an income account. Rather than manually maintaining
> a mapping of account types and whether the sign is positive or negative, I
> was hoping there'd be something in the XML or perhaps in those bindings you
> mentioned that would do this for me.
> 

I don't think this is stored in the xml file as the net representation in the 
gui is a combination of account type and the user preference. The former is 
hard-coded, the latter can be changed by the user. I don't know if we can 
access either information via the python bindings. I don't use them myself.

Regards,

Geert




More information about the gnucash-devel mailing list