Not sure about this but I have tracked this down as follows...

in dialog-invoice.c we start with this in the dialog

iw->opened_date = gnc_date_edit_new (gnc_time (NULL), FALSE, FALSE);

looking at the time64 number this starts of correct, i.e. today's value.

At some point this function gets called 'gnc_invoice_update_window' and on
line 1766 we have

time = gncInvoiceGetDateOpened (invoice);

and time is 9223372036854775807 which is INT64_MAX which is what is
returned for null invoice

following that we have...

if (!time)
{
        gnc_date_edit_set_time (GNC_DATE_EDIT (iw->opened_date),  gnc_time
(NULL));
}
else
{
         gnc_date_edit_set_time (GNC_DATE_EDIT (iw->opened_date), time);
}

So, should that be 'if(time == INT64_MAX)', is this the invalid date value
now ?
and I noticed when I searched for gnc_date_edit_new, some used
gnc_time(NULL) while others used time(NULL)
what's preferred, should they be changed ?

Regards,

Bob
_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to