From 361a803de55eb56a1eb45fe0dc5e437c8840ad67 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Thu, 5 Dec 2013 09:41:30 +0000 Subject: [PATCH] Bug 630578 - current date instead of posting date in exchange rate, when posting a bill git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23490 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/business/business-gnome/dialog-invoice.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/business/business-gnome/dialog-invoice.c b/src/business/business-gnome/dialog-invoice.c index e466ab7995..9fa483c306 100644 --- a/src/business/business-gnome/dialog-invoice.c +++ b/src/business/business-gnome/dialog-invoice.c @@ -842,7 +842,6 @@ gnc_invoice_post(InvoiceWindow *iw, struct post_invoice_params *post_params) { XferDialog *xfer; gnc_numeric exch_rate; - Timespec date; /* Note some twisted logic here: * We ask the exchange rate @@ -860,6 +859,7 @@ gnc_invoice_post(InvoiceWindow *iw, struct post_invoice_params *post_params) 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_invoice_post(InvoiceWindow *iw, struct post_invoice_params *post_params) 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