incorrect coding in financequote.pl
timothyp
egroegboyle at gmail.com
Mon Sep 15 13:49:02 BST 2025
Debian 13 Trixie
Kmymoney appimage 4767
Hi
I have a problem with Finance:quote:
When I run Update Stock and Currency Prices I get 1)
From the command line I get 2)
The source code with the offending line is 3).
The command line actually gives the correct quote, but this is not
evident in the output from
the normal KMM.
I cannot get in to edit the code to see if there is anything else, but
it appears to get the quote correctly.
Please help as I have reverted back to 5.1.3 which does not have this
test line.
Many thanks;
Timothy
--------------------------------------------------------------------------------------------------------------------------------
1) Executing perl
/tmp/.mount_kmymonlcGKjc/usr/share/alkimia6/misc/financequote.pl
za_unittrusts PTST ...
Symbol found: 'PTST'
Price found: '2025' (2,025)
Date found: ' and anything following them is
considered non-numeric.
Argument "09/12/2025" isn't numeric in numeric ne (!=) at
/tmp/.mount_kmymonlcGKjc/usr/share/alkimia6/misc/financequote.pl line 92
(#1)
"PTST"'
Received an invalid price for PTST, unable to update.
(Debug) symbol=PTST id=E000001...
Fetching URL
/tmp/.mount_kmymonlcGKjc/usr/share/alkimia6/misc/financequote.pl...
Unable to fetch URL for PTST
------------------------------------------------------------------------------------------------------------------------------------
2) Run from the command line I get the following response:
timothy at tim:~$ perl
/tmp/.mount_kmymonlcGKjc/usr/share/alkimia6/misc/financequote.pl
za_unittrusts AGSF
Argument "" isn't numeric in numeric ne (!=) at
/tmp/.mount_kmymonlcGKjc/usr/share/alkimia6/misc/financequote.pl
line 92 (#1)
(W numeric) The indicated string was fed as an argument to an operator
that expected a numeric value instead. If you're fortunate the message
will identify which operator was so unfortunate.
Note that for the Inf and NaN (infinity and not-a-number) the
definition of "numeric" is somewhat unusual: the strings themselves
(like "Inf") are considered numeric, and anything following them is
considered non-numeric.
Argument "09/12/2025" isn't numeric in numeric ne (!=) at
/tmp/.mount_kmymonlcGKjc/usr/share/alkimia6/misc/financequote.pl
line 92 (#1)
"AGSF","2025-09-12","51.00"
--------------------------------------------------------------------------------------------------------------------------------
3) The source code from the appimage is:
if (!%qhash) { $errcode = 1;} # no data from fq (?bad exchange?)
elsif ($qhash {$symbol, "success"} != 1) {$errcode = 2;} # got data
but quote failed (?bad symbol?)
elsif (!$qhash{$symbol, "last"} and !$qhash{$symbol, "price"} )
{$errcode = 3;} # can't find a price (?hmmm?)
if ($errcode != 0) {
print "Error " => "$errcode";
} else {
# extract the date and convert from m/d/yyyy to yyyy-mm-dd
my ($usdate, $month, $day, $year, $yyyymmdd);
$usdate = $qhash{$symbol, "date"};
if ($usdate != "") {
<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!!
($month,$day,$year) = ($usdate =~ /([0-9]+)\/([0-9]+)\/([0-9]+)/);
# i'm sure I can do the following with a regex but I'm just too
idle...
$month = "0$month" if ($month < 9);
$day = "0$day" if ($day < 9);
$yyyymmdd = "$year-$month-$day";
} else {
$yyyymmdd = strftime "%Y-%m-%d", localtime
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney/attachments/20250915/d80a04cc/attachment.htm>
More information about the KMyMoney
mailing list