r23490 - gnucash/trunk/src/business/business-gnome - Bug 630578 - current date instead of posting date in exchange rate, when posting a bill

Geert Janssens gjanssens at code.gnucash.org
Thu Dec 5 04:41:31 EST 2013


Author: gjanssens
Date: 2013-12-05 04:41:30 -0500 (Thu, 05 Dec 2013)
New Revision: 23490
Trac: http://svn.gnucash.org/trac/changeset/23490

Modified:
   gnucash/trunk/src/business/business-gnome/dialog-invoice.c
Log:
Bug 630578 - current date instead of posting date in exchange rate, when posting a bill

Modified: gnucash/trunk/src/business/business-gnome/dialog-invoice.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-invoice.c	2013-12-05 00:26:09 UTC (rev 23489)
+++ gnucash/trunk/src/business/business-gnome/dialog-invoice.c	2013-12-05 09:41:30 UTC (rev 23490)
@@ -842,7 +842,6 @@
         {
             XferDialog *xfer;
             gnc_numeric exch_rate;
-            Timespec date;
 
             /* Note some twisted logic here:
              * We ask the exchange rate
@@ -860,6 +859,7 @@
             xfer = gnc_xfer_dialog (iw_get_window(iw), acc);
             gnc_xfer_dialog_is_exchange_dialog(xfer, &exch_rate);
             gnc_xfer_dialog_select_to_currency(xfer, account_currency);
+            gnc_xfer_dialog_set_date (xfer, timespecToTime64 (postdate));
             /* Even if amount is 0 ask for an exchange rate. It's required
              * for the transaction generating code. Use an amount of 1 in
              * that case as the dialog won't allow to specify an exchange
@@ -885,9 +885,7 @@
                 gnc_price_begin_edit (convprice);
                 gnc_price_set_commodity (convprice, account_currency);
                 gnc_price_set_currency (convprice, gncInvoiceGetCurrency (invoice));
-                date.tv_sec = gnc_time (NULL);
-                date.tv_nsec = 0;
-                gnc_price_set_time (convprice, date);
+                gnc_price_set_time (convprice, postdate);
                 gnc_price_set_source (convprice, "user:invoice-post");
 
                 /* Yes, magic strings are evil but I can't find any defined constants



More information about the gnucash-changes mailing list