Scheduled invoices - Books and twins

Derek Atkins warlord at MIT.EDU
Thu Dec 25 22:40:51 CST 2003


Hi,

Lionel Elie Mamane <lionel at mamane.lu> writes:

> 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)

Please use the existant naming scheme:  gnc<Object><Operation>
i.e. gncInvoiceInstantiate().  Although I must admit that I don't
know what "Instantiate" means exactly, but that's ok...

> I took inspiration from
>
> GncInvoice *
> gncCloneInvoice (GncInvoice *from, QofBook *book)

I have no idea what this function does -- I didn't write it.

> 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);
>   }

Indeed, this looks like a bug, however:

1) I didn't write it
2) I don't know how this function is used
3) I have no idea what this function is SUPPOSED to do

But yes, it does look like this is a bug.  Maybe Linas can speak up
and comment on the potential bug here.

> Lionel

-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


More information about the gnucash-devel mailing list