After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 553902 - gnucash "price editor" logs stocks ( shares ) but not funds
gnucash "price editor" logs stocks ( shares ) but not funds
Status: VERIFIED NOTGNOME
Product: GnuCash
Classification: Other
Component: General
2.2.x
Other All
: Normal normal
: ---
Assigned To: Andreas Köhler
Andreas Köhler
Depends on:
Blocks:
 
 
Reported: 2008-09-26 08:52 UTC by Dr. Edgar Alwers
Modified: 2018-06-29 22:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dr. Edgar Alwers 2008-09-26 08:52:44 UTC
Please describe the problem:
"gnc-fq-dump" delivers correct values for stocks ( Aktien ) as well as for funds ( Anleihen, Rentenfonds, etc.) . However, funds-data is not recorded  when searched through gnucash's "price editor".  Price editor seems to find the fund-data as well, as no errors are reported, but no data is neither shown in price editor nor written down to a file. 
The problem does not  occur with normal shares, only with funds,  see examples.

Steps to reproduce:
1. gnc-fq-dump yahoo_europe A0GFY7.SG -> delivers price 87.70 for Unilever fund
2. "Get Quotes" ( price editor ) for A0GFY7.SG (Unilever) does not write anything down. No errors are reported.
3. Same procedures 1 and 2 for BAS.DE ( BASF schares ) works perfect, price editor reports a price of 34.370000 for the source "Finance::Quote"


Actual results:
No actual values for the Unilever paper are delivered by "Get Quotes" in the price editor of gnucash

Expected results:
price editor should  not only show the user:price-editor value ( entered by the user ) for funds like Unilever, but also the "Finance::Quote" values, as these are beeing correctly found by gnc-fq-dump.
I expect the same behaviour as e.g. for the BASF share.

Does this happen every time?
Yes. Tested with aprox. 20 different shares and funds 

Other information:
See discussions in http://news.gmane.org/gmane.comp.gnome.apps.gnucash.german
Comment 1 Andreas Köhler 2008-09-27 14:03:48 UTC
I think I do not understand.  Here is what I do:

* gnucash --nofile
* Tools > Security Editor
* Add
- Full name: Unilever
- Symbol: A0GFY7.SG
- Type: FUND
- [x] Get online quotes
* OK
* Close
* Tools > Price Editor
* Get Quotes
-> FUND > A0GFY7.SG > A0GFY7.SG appears:
Currency: EUR, Date: 09/26/2008, Source: Finance::Quote, Type: Last, Price: 89.500000.
* Close
* File > Quit
* Save <some.gnc>
* gnucash
* Tools > Price Editor -> Tada
Comment 2 Frank H. Ellenberger 2008-09-27 16:24:52 UTC
I believe, this command, I sent yesterday or the day before:
> gnc-fq-dump yahoo_europe A0GFY7.SG
Finance::Quote fields Gnucash uses:
    symbol: A0GFY7.SG            <=== required
      date: 09/16/2008           <=== required
  currency: EUR                  <=== required
      last: 92.10                <=\
       nav:                      <=== one of these
     price: 92.10                <=/
  timezone:                      <=== optional

Assuming, I sent it yesterday, there were 9 days difference between price date and request date.

Is there any restriction in the allowed date range?
Some "drop outdated rates"?
Comment 3 Dr. Edgar Alwers 2008-09-27 16:47:17 UTC
Hi Andreas,
that is exactly what I would like to have. Please see _my_ results below.

(In reply to comment #1)
> I think I do not understand.  Here is what I do:
> 
> * gnucash --nofile
> * Tools > Security Editor
> * Add
> - Full name: Unilever
> - Symbol: A0GFY7.SG
> - Type: FUND
> - [x] Get online quotes
> * OK
> * Close
> * Tools > Price Editor
> * Get Quotes
> -> FUND > A0GFY7.SG > A0GFY7.SG appears:
> Currency: EUR, Date: 09/26/2008, Source: Finance::Quote, Type: Last, Price:
> 89.500000.
> * Close
> * File > Quit
> * Save <some.gnc>
> * gnucash
> * Tools > Price Editor -> Tada
> 

What I do:

gnucash --nofile
Tools > Security Editor
Add
Full Name: Unilever
Symbol: A0GFY.SG
Type: FUND
[x] Get online quotes
OK
Close
Tools > Price Editor
Get Quotes
Unable to retrieve quotes for these items:
  FUND:A0GFY7.SG

OK. That is the result repeating what you did. Now, let us change the procedure a little:
......
....Symbol: A0GFY.SG
Type:FUND
[x] Get online quotes
Type of quote source: [x] single yahoo europe
OK
Close
Tools > Price Editor
Get Quotes
 -> FUND > A0GFY7.SG > A0GFY7.SG appears:
Security A0GFY7.SG (Unilever) Currency: EUR, Date: 27/09/2008, Source:user:price-editor , Type: unknown, Price:0.000000

And exactly this is my problem. Just as a matter of information, here the results of gnc-fq-dump:
edgar@edgar2:~$ gnc-fq-dump yahoo_europe A0GFY7.SG
Finance::Quote fields Gnucash uses:
    symbol: A0GFY7.SG            <=== required
      date: 09/26/2008           <=== required
  currency: EUR                  <=== required
      last: 89.50                <=\
       nav:                      <=== one of these
     price: 89.50                <=/
  timezone:                      <=== optional

As a last information: gnucash V. 2.2.6, Finance::Quote 1.13

I am sure, we shall go through together. Thank you very much in the meantime for your help !
Edgar
Comment 4 Andreas Köhler 2008-09-27 21:39:20 UTC
Ok, somehow I ignored that we were talking about Yahoo _Europe_.
So I applied Frank's patch to make F::Q parse the web sites result with the correct date.  Unfortunately, the European server also adds a trailing white space (to the first/last/every line, I do not know).

You can see this by running:
$ echo '(yahoo_europe "A0GFY7.SG")' | ./gnc-fq-helper
(("A0GFY7.SG" (symbol . "A0GFY7.SG") (gnc:time-no-zone . "2008-09-26 16:58:00") (last . 89.50) (currency . "EUR ")))

"EUR " is not a valid currency and the price entry not added subsequently.  I think that is a F::Q bug, possible fixable by adding a line to Finance/Quote/Yahoo/Europe.pm to make it look like

    foreach my $symbol (@symbols) {
        next unless $info{$symbol,"success"};
        $info{$symbol,"method"} = "yahoo_europe";
        $info{$symbol,"currency"} =~ s/\s+$//;
    }

maybe with an additional comment.

Anyway, I think this is not a GnuCash bug.
Thanks for reporting nonetheless!
Comment 5 Dr. Edgar Alwers 2008-09-29 13:16:12 UTC
(In reply to comment #4)

> "EUR " is not a valid currency and the price entry not added subsequently.  I
> think that is a F::Q bug, possible fixable by adding a line to
> Finance/Quote/Yahoo/Europe.pm to make it look like
> 
>     foreach my $symbol (@symbols) {
>         next unless $info{$symbol,"success"};
>         $info{$symbol,"method"} = "yahoo_europe";
>         $info{$symbol,"currency"} =~ s/\s+$//;
>     }
> 
Hi Andreas,

thank you very much for the final solution. I can now confirm, that your patch to Europe.pm solved the problem. Now, price editor is working for funds as well as shares.
However, I do not understand why Europe.pm was retrieving a bad string for funds but not for shares. I am happy, the problem is solved, and I hope for a definitive solution from the Finance::Quote side, but the issue seems to be a little weak, isn't it ?

Kind regards,
Edgar
Comment 6 Andreas Köhler 2009-01-01 13:41:08 UTC
Well, if Yahoo Europe decides to add whitespace to certain results of its own service, I guess there is not much we (the service users) can do but change our libraries accordingly.

BTW, is there a bug report for F::Q and if there is, can we link to it?
Thanks.
Comment 7 Frank H. Ellenberger 2009-01-19 00:45:25 UTC
The official bugtracker is  https://rt.cpan.org/Public/Dist/Display.html?Name=Finance-quote

Further Information about the how to can be found on http://finance-quote.sourceforge.net/developer.html

In 2008-10-26 they released 1.14 + 1.15

Had anybody of you the opportunity to test 1.15 - I just arrived and hadn't.
Comment 8 Frank H. Ellenberger 2009-02-11 13:59:57 UTC
I just watched the following, when I cleaned my directory:
diff -u Base.pm.orig Base.pm
--- Base.pm.orig        2006-07-28 00:38:41.000000000 +0200
+++ Base.pm     2008-10-26 09:15:50.000000000 +0100
@@ -44,7 +44,7 @@
 @EXPORT = qw//;
 @EXPORT_OK = qw/yahoo_request base_yahoo_labels/;

-$VERSION = '1.03';
+$VERSION = '1.15';

 # This is the maximum number of stocks we'll batch into one operation.
 # If this gets too big (>50 or thereabouts) things will break because
@@ -204,6 +204,11 @@
                                # retrieval, Yahoo will drop in an
                                # undefined field
                                next unless (defined $q[$i] && length $q[$i]);
+                                # remove trailing spaces added for
+                                # yahoo::europe quotes, since currency
+                                # is returned with a trailing white
+                                # space
+                                $q[$i] =~ s/\s*$// ;
                                $info{$symbol,$FIELDS[$i]} = $q[$i];
                        }
:

So, it is also fixed in FQ 1.15. :-)
Comment 9 John Ralls 2018-06-29 22:10:32 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=553902. Please update any external references or bookmarks.