Using the Notes from a specific account in a report

Philip Haynes philip.john.haynes at gmail.com
Tue Sep 20 09:56:01 EDT 2011


On Tue, Sep 20, 2011 at 11:20 PM, Derek Atkins <warlord at mit.edu> wrote:
> Hi,
>
> Philip Haynes <philip.john.haynes at gmail.com> writes:
>
>> Hi All,
>> I am struggling to find the right scheme code to extract the data from
>> a specific account (say "Assets:Current Assets:Transaction Account")
>> for use in my report. I cannot find the right code to get a reference
>> to this account. Once I have such a reference, I want to access the
>> Notes data and use it in my report. I have the code to put the data I
>> will eventually get in place, but I just cannot get my head around
>> what calls I need to get the account reference from some string
>> representation of its name.
>
> Where are you getting the 'string representation of its name'?
> Generally reports use an account picker option to allow the user to
> select an account (or set of accounts).  Then you get, effectively, a
> list of account objects.
I will hard code the string name of the right account into the
invoice. I don't want to have to select the account for each invoice
because it will be the same each time, there is only one transaction
account at the moment and in the event that there is more then I have
other issues to manage and a different approach might be needed. I
don't know how to make this representation, I suspect that it is a
token;

`("Assets" "Current Assets" "Transaction Account")

But I cannot be sure and this is kind of the help for which I am searching.

>
> There are the gnc_account_lookup_by_name() and
> gnc_account_lookup_by_full_name() C APIs which should be wrapped into
> Scheme.
Indeed, I thing they are, but I can't seem to get the right
combination of scheme magic to pull out the right account. Everything
I try gets a "Error generating report" message in the subsequent
invoice. Hence my posting here.

>
>> Any help much appreciated. I have trawled much scheme code in the
>> shared resources, other reports and even the source of gnucash but I
>> just can't find something to do what i want
>>
>> I recognize that this approach has issues, but I still prefer it for
>> the problem I am solving (putting banking details on an invoice BTW)
>
> What exactly are you trying to do?  I don't understand your issue about
> "putting banking details on an invoice".  Why can't you just put this
> info into the invoice template?
I want to provide actual account details on the bottom of my invoice
to allow people to transfer money to my account directly, this is
increasingly common as a means of paying bills for me and having my
invoices paid (I have never been paid by cheque yet). So I have placed
the text I want to display in the Notes field of my Transaction
Account in the Current Assets section of my Asset accounts (the Bank,
branch, BSB and A/C numbers) and I want my invoice to pull that data
out of that account and place it in the output.

>
>> Thanks,
>> Philip
>
> -derek
>
> --
>       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>       Member, MIT Student Information Processing Board  (SIPB)
>       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
>       warlord at MIT.EDU                        PGP key available
>



-- 
Philip Haynes
Address: 2/33 Oakley Road. North Bondi. NSW. 2026. Australia
Email: philip.john.haynes at googlemail.com
Mobile: +61411050016



More information about the gnucash-devel mailing list