GnuCash
Contact   Instructions
Bug 796970 - Disable editing of currency retrieval settings for currencies.
Summary: Disable editing of currency retrieval settings for currencies.
Status: NEW
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Currency and Commodity (show other bugs)
Version: 3.3
Hardware: PC Linux
: Normal normal
Target Milestone: ---
Assignee: core
QA Contact: core
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-08 06:27 EST by Bertrand Marc
Modified: 2018-12-09 05:54 EST (History)
3 users (show)

See Also:


Attachments

Description Bertrand Marc 2018-12-08 06:27:20 EST
Hi,

(this was submitted to Debian as https://bugs.debian.org/893560 )

Gnucash fails to download the EUR/USD exchange rate, probably due to a wrong parameter being sent to gnc-fq-dump (EURUSD instead of EURUSD=X)

There are several ways to see the issue:
Procedure:
- ISSUE 1:
Start gnucash with :
        LANG=C gnucash
Tools / Security editor / Currency / Select USD / Edit
 Select Get Online Quote + Single + Currency
 Click on OK
Tool / Price Editor / Get quote
 On "Currencies / Euro" or "Currency / USD", there is no quote update
 => Issue


- ISSUE 2:
If I try to use an another currency source :
Tools / Security editor / Currency / Select USD / Edit
 Select Get Online Quote
 Select Multiple
 Select any possible source
 Click on OK
 Click on Edit
 => "Single + Currency" are still selected, instead of "Multiple + any source"
 Try to update currency : Same issue as upper, no currency updated


- ISSUE 3:
Start gnucash with :
        LANG=fr_FR.UTF-8 gnucash
Tool / Price Editor / Get quote
 On "Currencies / Euro" or "Currency / USD", there is no quote update
 A french dialog box error message with "Not possible to download quotes for
elements:
 CURRENCY:USD

Cheers,
Bertrand
Comment 1 John Ralls 2018-12-08 11:52:35 EST
Have you tried all of the steps in https://wiki.gnucash.org/wiki/FAQ#Q:_Why_doesn.27t_online_quoting_work.3F?
Comment 2 Bertrand Marc 2018-12-08 12:24:08 EST
Yes, gnc-fq-dump yahoo_json EURUSD=X works as expected.
Comment 3 John Ralls 2018-12-08 12:58:56 EST
That's utterly irrelevant. EURUSD=X is a Forex trading derivative quoted in USD. It's supposed to be the same rate, but it's not how GnuCash retrieves currency exchange rates, which is

gnc-fq-dump currency USD EUR

Although gnc-fq-dump is for human debugging; GnuCash uses gnc-fq-helper which returns scheme tuples for prices.scm to process. The equivalent on the command line looks like

echo '(currency "USD" "EUR")' | gnc-fq-helper

The currency source is hard-coded to Alphavantage in Finance::Quote, so you need to get an Alphavantage API key and configure GnuCash to use it, see the FAQ for the details. Note that to use gnc-fq-dump you also need to have $ALPHAVANTAGE_API_KEY set to your key in the shell environment.
Comment 4 Bertrand Marc 2018-12-08 13:46:14 EST
Ok thank you, it is a lot clearer. Indeed,
gnc-fq-dump currency USD EUR
doesn't give an exchange rate without my API key, and works with my API key. The command I mentioned in my previous post was taken from the FAQ (https://wiki.gnucash.org/wiki/FAQ#Q:_How_do_I_fix_a_.22system_error.22_or_.22unknown_error.22_when_getting_stock_quotes.3F), so I thought it was the one for exchange rates.

In the end, the main issue is fixed with my API key, but to my mind, there are 2 related issues:
1. It would be nice if GNUCash's error message could be more explicit ('no Alphavantage API key')
2. It is strange that the source for currencies is hardcoded, while one might think it can be set differently: if you edit the currency in Tools / Security editor / Currency / Select USD / Edit
 Select Get Online Quote
 Select Multiple
 Select any possible source
 Click on OK
Then you think you changed the source. But if you click again on "Edit" => "Single + Currency" are still selected, instead of "Multiple + any source"

Cheers,
Bertrand
Comment 5 John Ralls 2018-12-08 15:12:02 EST
Currency rate retrieval works differently from stock quote retrieval: Stocks and other traded securities trade on a particular exchange in a particular currency, so it's sufficient to just provide the symbol. For currencies rates you must specify both sides of the exchange rate, so it gets a different API in Finance::Quote.

The hard-coding of Alphavantage for currency rates is in Finance::Quote, not GnuCash. You'll have to take that up with them.

I agree that GnuCash should disable the quote source selection when editing currencies in the Securities Editor; in fact it should disable everything there except the display symbol field because everything else is set from an XML file derived from ISO-4217.
Comment 6 Frank H. Ellenberger 2018-12-09 05:54:38 EST
I have improved the gnc-fq-dump paragraph in the wiki section from above.

So the remaining part is in "edit currency" to disable the 
choice (single, multiple, unknown) for entries of type currencies.
I do not know, if timezone is relevant.

Note You need to log in before you can comment on or make changes to this bug.