Scheduled invoices - Books and twins

Lionel Elie Mamane lionel at mamane.lu
Sun Dec 21 07:21:15 CST 2003


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)

I took inspiration from

GncInvoice *
gncCloneInvoice (GncInvoice *from, QofBook *book)

I think I have found a bug in the former, by the way:

  invoice->entries = NULL;
  /* LEM: node->next should be node->previous */
  for (node = g_list_last(from->entries); node; node=node->next)
  {
    GncEntry *entry = node->data;
    entry = gncEntryObtainTwin (entry, book);
    invoice->entries = g_list_prepend (invoice->entries, entry);
  }

-- 
Lionel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20031221/dbe22290/attachment-0001.pgp


More information about the gnucash-devel mailing list