API questions

John Ralls jralls at ceridwen.us
Fri Jun 10 09:59:38 EDT 2016


> On Jun 10, 2016, at 2:05 AM, David Goodenough <david.goodenough at linkchoose.co.uk> wrote:
> 
> I notice when looking at the API pages that a method is defined as starting
> at a given line, and then the code below always starts on the next line, i.e.
> missing out the prototype.  For example:-
> 
> Definition at line 116 of file print-session.c.
> 
>  117 {
>  118     return print_settings;
>  119 }
> 
> Would it not be possible to show line 116 as well?  This seems to be a
> consistent problem throughout the docs.


The prototype is in very large print above the description. Repeating it in the listing would be redundant.

> 
> The reason I was looking was to generate customer reports via the API.
> I would like to be able to generate a report for each customer who either
> has a non-zero balance or where some transaction (invoice or receipt of
> payment) happened last month (or since rather since I last ran the program).
> I then want to export the report as a PDF.  I have looked my way through
> the API docs but could not see how to generate reports, or to check for
> the balance or the presence of transactions since a date.
> 
> I found docs on how to create invoices, but also need to be able to 
> export them as PDFs and could not locate the API for that either.  I notice
> in the gnucash XML files that the last direcorty to which invoices ( and I 
> guess customer reports ) were exported is stored, is this available from
> the API.
> 
> What I want to be able to write is a program that will generate reports
> for all relevant customers, and then send an email to each customer who
> has either an invoice and/or a report containing both.
> 
> Any pointers gratefully received.

PDF generation is provided by (IIRC) libgtk as part of printing support. You won't find the code for that in GnuCash itself.

Regards,
John Ralls


More information about the gnucash-user mailing list