Jim's Avatar


03 Aug, 2020 10:40 PM

Hi, I've been trying to create a variation on the 'Income and Expenses, Detailed' report.
I wanted to show both the Income/Expense account ('category'), and also the account for the bank.
I'm grabbing all the account with getAccountType() == INCOME and then going through those transactions, In order to find out which bank account they are in I'm using txn.getFlipSide().getAccount().getAccountName() .

So to summarize:
txn.getAccount().getFullAccountName() gets me Income/expense category and
txn.getFlipSide().getAccount().getFullAccountName() gets me the bank account where the transaction was entered.

That seems to work fine, but I noticed here:
it states:
'This is experimental, so please don't use it for any extensions yet.' there a better or recommended way to do this other than using the getFlipSide() call?

Should have mentioned I'm using Python.

  1. Support Staff 1 Posted by Sean Reilly on 03 Aug, 2020 10:53 PM

    Sean Reilly's Avatar

    Hi Jim,

    That's a really good question. That comment should be removed as that API has been stable for many years now and I'm happy with how it works.

    The difference between that an getOtherTxn(int) is that getFlipSide() will return the reverse part of the SplitTxn, meaning that the amount it reports will be specific to that split, not the overall ParentTxn.


    Sean Reilly
    Developer, The Infinite Kind

  2. 2 Posted by Jim on 04 Aug, 2020 01:50 AM

    Jim's Avatar

    Thank for the reply. For what I'm doing...which is just looking for the bank account the transaction is in...either method works out the same all the time??

  3. Support Staff 3 Posted by Sean Reilly on 04 Aug, 2020 08:15 AM

    Sean Reilly's Avatar

    Yes, for that purpose these are identical.

  4. System closed this discussion on 03 Nov, 2020 08:20 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac