r21705 - gnucash/trunk/src/engine - Add setter function for invoice Opening Date using GDate.

Christian Stimming cstim at code.gnucash.org
Sat Dec 10 16:10:05 EST 2011


Author: cstim
Date: 2011-12-10 16:10:05 -0500 (Sat, 10 Dec 2011)
New Revision: 21705
Trac: http://svn.gnucash.org/trac/changeset/21705

Modified:
   gnucash/trunk/src/engine/gncInvoice.c
   gnucash/trunk/src/engine/gncInvoice.h
Log:
Add setter function for invoice Opening Date using GDate.

Modified: gnucash/trunk/src/engine/gncInvoice.c
===================================================================
--- gnucash/trunk/src/engine/gncInvoice.c	2011-12-10 21:09:53 UTC (rev 21704)
+++ gnucash/trunk/src/engine/gncInvoice.c	2011-12-10 21:10:05 UTC (rev 21705)
@@ -459,6 +459,12 @@
     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;

Modified: gnucash/trunk/src/engine/gncInvoice.h
===================================================================
--- gnucash/trunk/src/engine/gncInvoice.h	2011-12-10 21:09:53 UTC (rev 21704)
+++ gnucash/trunk/src/engine/gncInvoice.h	2011-12-10 21:10:05 UTC (rev 21705)
@@ -99,6 +99,9 @@
  @{ */
 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);



More information about the gnucash-changes mailing list