Add setter function for invoice Opening Date using GDate.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21705 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2011-12-10 21:10:05 +00:00
parent bb3642e6cf
commit 6a26cc3b85
2 changed files with 9 additions and 0 deletions

View File

@ -459,6 +459,12 @@ qofInvoiceSetBillTo (GncInvoice *invoice, QofInstance *ent)
gncInvoiceCommitEdit (invoice);
}
void gncInvoiceSetDateOpenedGDate (GncInvoice *invoice, const GDate *date)
{
g_assert (date);
gncInvoiceSetDateOpened(invoice, timespecCanonicalDayTime(gdate_to_timespec(*date)));
}
void gncInvoiceSetDateOpened (GncInvoice *invoice, Timespec date)
{
if (!invoice) return;

View File

@ -99,6 +99,9 @@ GncInvoice *gncInvoiceCopy (const GncInvoice *other_invoice);
@{ */
void gncInvoiceSetID (GncInvoice *invoice, const char *id);
void gncInvoiceSetOwner (GncInvoice *invoice, GncOwner *owner);
/** Set the DateOpened using a GDate argument. (Note: Internally this stores
the date in a Timespec as created through timespecCanonicalDayTime()). */
void gncInvoiceSetDateOpenedGDate (GncInvoice *invoice, const GDate *date);
void gncInvoiceSetDateOpened (GncInvoice *invoice, Timespec date);
void gncInvoiceSetDatePosted (GncInvoice *invoice, Timespec date);
void gncInvoiceSetTerms (GncInvoice *invoice, GncBillTerm *terms);