I am currently using the API (Manager.dll) to attempt to generate a custom report my accountant would like. The main part of this report involves iterating all the Receipt and Payment objects, and logging details about each transaction. Each Receipt/Payment has one or more TransactionLine objects which describe the break up of each transaction.
The TransactionLine class has a field ‘Account’ which is a Guid that can be looked up, and most of the time (for me) this will be a GeneralLedgerAccount. From the GeneralLedgerAccount I can access the Name field, which will tell me what type of income/expense the transaction is (for example ‘Postage’, ‘Travel’, ‘Software Sales’, etc.) this is how the line has been categorised by the user (these categories are what appear in the P&L account).
Sometimes, instead of the Account being a GeneralLedgerAccount, it is instead a ControlAccount. In the case I am currently debugging it is a movement of money from our bank account into a ‘Tax payable’ liability. However, I am unable to find the ‘Tax payable’ string anywhere (I know it is this because I looked it up in the web-interface). So my question is:
Given a Receipt, which has a single TransactionLine, where the TransactionLine.Account is a ControlAccount, how can I find out what category (in this case Tax payable) the TransactionLine refers to.
EDIT: It is worth noting, the ControlAccount.Name field is an empty string.