r20801 - gnucash/branches/2.4/src/business/business-ledger - [20800] Bug #646541: new invoice line items default to invoice open date

Geert Janssens gjanssens at code.gnucash.org
Sat Jun 25 10:39:00 EDT 2011


Author: gjanssens
Date: 2011-06-25 10:39:00 -0400 (Sat, 25 Jun 2011)
New Revision: 20801
Trac: http://svn.gnucash.org/trac/changeset/20801

Modified:
   gnucash/branches/2.4/src/business/business-ledger/gncEntryLedger.c
Log:
[20800] Bug #646541: new invoice line items default to invoice open date
instead of current date
This commit partially reverts the changes in r19134 so that
customer invoices and employee vouchers default to the current date.
Vendor bills still default to the invoice open date.

Modified: gnucash/branches/2.4/src/business/business-ledger/gncEntryLedger.c
===================================================================
--- gnucash/branches/2.4/src/business/business-ledger/gncEntryLedger.c	2011-06-25 14:31:26 UTC (rev 20800)
+++ gnucash/branches/2.4/src/business/business-ledger/gncEntryLedger.c	2011-06-25 14:39:00 UTC (rev 20801)
@@ -523,8 +523,18 @@
 {
     if (!ledger) return;
     ledger->invoice = invoice;
-    ledger->last_date_entered = gncInvoiceGetDateOpened (invoice);
 
+    /* For bills only, set the default date for new entries
+     * to the bill's opened date. This saves a lot of typing when
+     * adding bills on a day different from the bill's own date.
+     * Note this is for bills only, because for (customer's) invoices
+     * it makes more sense to use the current date.
+     * Consult https://bugzilla.gnome.org/show_bug.cgi?id=646541
+     * to understand why.
+     */
+    if (gncInvoiceGetOwnerType (invoice) == GNC_OWNER_VENDOR)
+        ledger->last_date_entered = gncInvoiceGetDateOpened (invoice);
+
     if (!ledger->query && invoice)
         create_invoice_query (ledger);
 



More information about the gnucash-changes mailing list