Scheduled invoices

Lionel Elie Mamane lionel at
Sun Dec 21 09:06:23 CST 2003

On Sun, Dec 21, 2003 at 02:21:08PM +0100, Lionel Elie Mamane wrote:
> On Tue, Dec 16, 2003 at 11:26:55AM -0500, Derek Atkins wrote:

>> The first thing you need to do is add a function that duplicates an
>> invoice: GncInvoice * gncInvoiceCopy(const GncInvoice *invoice)

> I've started to add a function that creates a copy of an invoice,
> except with another date:

> GncInvoice *
> gncInstantiateInvoice (GncInvoice *from, Timespec inst_date)

1) I'm starting to wonder why I shouldn't take a book* argument,
   too. After all, even gncInvoiceCreate takes one.

   If I don't have to take a book* argument, what do I put in the inst
   field of the new invoice?

2) What does this do?

     gnc_engine_gen_event (&invoice->inst.entity, GNC_EVENT_CREATE);

   (No, I'm not expecting "generate the event 'A new entity is
    created'" as an answer, but rather what happens when this event is

   In particular, I'm trying to understand if I should first generate
   the event and then post, or first post and then generate the

3) I have to call gncInvoicePostToAccount in the process. But it takes
   non-const pointers for posted_date and due_date. Does it *change*
   them in some cases? Will it be confused if they are equal?

4) The GUI callback for the "post" button calls gncInvoiceBeginEdit
   before gncInvoicePostToAccount. Should I do that too, or am I off
   the hook because it is an invoice I'm busy creating (linked with
   question 2, I guess)?

Thanks for your help,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url :

More information about the gnucash-devel mailing list