GNOME Bugzilla – Bug 492417
currency mapping of New Israeli Shekel
Last modified: 2018-06-29 21:53:37 UTC
summary: currency USD/NIS with F::Q doesn't work, USD/ILS does. the ISO4217 code is ILS for the israeli shekel, therefore all sites return error when trying to convert NIS but work with ILS (06:12:28 PM) c0m4: hey, I'm having problem with multiply currency feature, any one care to help? (06:13:05 PM) c0m4: I'm getting an error on the Price editor "Unable to retrieve quotes for these items: (06:13:05 PM) c0m4: CURRENCY:USD" (06:13:18 PM) c0m4: any one? (06:14:30 PM) warlord: What's your main currency? (06:14:37 PM) c0m4: NIS (06:14:52 PM) c0m4: New Israeli Shekel (06:14:55 PM) warlord: Yeah. (06:15:48 PM) warlord: Umm.. I wish I knew what to tell you. I barely know anything about quote retrieval, and even less about currency quotes. (06:16:29 PM) c0m4: does it use the gnc-fq-dump command in the background? (06:17:00 PM) warlord: I think so. (06:17:13 PM) warlord: But I dont know how it does it specifically for currencies. (06:21:17 PM) c0m4: that the command: gnc-fq-dump yahoo USDGBP=x , but to make it work with NIS... that another story (06:22:42 PM) warlord: It's possible that there just isn't a USD/NIS quote source there. (06:23:49 PM) c0m4: gnc-fq-dump yahoo USDILS=X err... ok so now the big question... why doesn't it work (06:26:27 PM) Lauren [~franz@96.232.30.86] entered the room. (06:26:29 PM) c0m4: should I be able to find some log of it somewhere? (06:27:38 PM) andi5 left the room (quit: Leaving.). (06:30:08 PM) c0m4: ... how do I enable debug for the gnucash (06:30:08 PM) c0m4: ? (06:30:20 PM) c0m4: do I have to strace it ? (06:30:21 PM) warlord: --debug (06:30:30 PM) c0m4: yeah where are the log files (06:30:30 PM) c0m4: ? (06:30:37 PM) warlord: in /tmp/gnucash.trace (06:30:48 PM) jsled: Or, use {--logto stderr} (06:30:57 PM) warlord: http://wiki.gnucash.org/wiki/Logging (06:31:40 PM) c0m4: that it (06:32:07 PM) c0m4: hehe (06:32:23 PM) c0m4: no debug info when I press get quotes (06:33:35 PM) warlord: Not surprising -- F::Q is a separate application. (06:33:49 PM) c0m4: yeah , I installed it (06:33:49 PM) warlord: you're welcome to instrument gnc-fq-helper (06:33:56 PM) c0m4: but I can't even see the call to it (06:35:14 PM) c0m4: in the debug information should be something when I press the get quotes (how do I know what log-domain for it? (06:35:36 PM) jsled: well, you're presuming that there are debugging statements in the relevant code. (06:35:53 PM) c0m4: well yeaj (06:35:56 PM) warlord: Yeah, I have no idea if there's a debug statement there. (06:36:38 PM) jsled: but, the quotes-getting code is in src/scm/price-quotes.scm ... (06:36:48 PM) jsled: and there are some logging statements. (06:36:57 PM) jsled: Try running with `--log gnc.scm=debug` as well. (06:37:31 PM) jsled: It looks like there are 3 gnc:debug statements in the whole file. (06:38:06 PM) c0m4: ok I'll check it now (06:39:14 PM) c0m4: that what I get : (06:39:14 PM) c0m4: * 18:38:47 DEBUG <gnc.scm> (handling-request (currency USD NIS)) (06:39:14 PM) c0m4: * 18:38:47 DEBUG <gnc.scm> (results (#f)) (06:39:20 PM) c0m4: err... (06:39:32 PM) c0m4: ok its time to dig in the code... (06:42:32 PM) jsled: http://pastebin.com/m4a761006 (06:43:01 PM) ErKa [~keryell@keryell.pck.nerim.net] entered the room. (06:44:57 PM) c0m4: jsled: sorry about the stupid question but is this the correction ? (06:45:42 PM) jsled: Sorry for the lack of context. That was just my output using gnc-fq-helper here. (currency "USD" "NIS") doesn't work, but (currency "USD" "ILS") does. (06:45:56 PM) c0m4: oh (06:46:07 PM) jsled: I'm not sure what quote source was used there, and/or if forcing another would support the currency code "NIS". (06:46:52 PM) c0m4: I guess that it is the problem, the currency is called NIS but at yahoo it is called ILS (06:47:03 PM) jsled: looks like, yeah. (06:47:26 PM) jsled: Maybe gnucash need to separate/know the "currency name" from the "lookup alias"...? (06:50:50 PM) jsled: hampton might have encountered this before/already, and have an opinion about it. (06:51:10 PM) c0m4: I really don't know gnucash and I haven't yet looked at the code, it it a configurable option? I though about patching the gnc-fq-* (06:51:30 PM) c0m4: ^it it^is it (06:52:02 PM) jsled: If you Just Want This Damn Thing To Work! ™®© :), then I'd just have a mapping in gnc-fq-helper; that'll be the easiest thing to modify. (06:53:21 PM) c0m4: yeah that what I'll do myself (06:53:44 PM) c0m4: but what about the other poor Israelis that want to use gnucash :D (06:54:47 PM) warlord: You're the first person to ask about this.. But honestly you might try asking on the F::Q email list. (06:55:21 PM) c0m4: ok tnx a bunch :D (06:55:48 PM) warlord: http://finance-quote.sourceforge.net/ (07:02:52 PM) benoitg left the room (quit: Ping timeout: 600 seconds). (07:03:31 PM) c0m4: acutaly I though about it and its not a bug in finace-quote (07:04:02 PM) c0m4: they are doing there job, you give then a currency couple and the return the result (07:04:20 PM) c0m4: NIS does not exist ... ILS exist (07:04:30 PM) c0m4: it the mapping in the gnucash that it wrong (07:04:42 PM) c0m4: .. don't you think? (07:05:11 PM) jsled: perhaps. Another argument says that F::Q should shield GnuCash from such details. :) (07:05:18 PM) c0m4: why? (07:05:43 PM) jsled: i.e., the detail that in order to get a quote for NIS you realy need to look it up as ILS because Yahoo hasn't updated their site, yet (07:05:59 PM) jsled: For instance, another currency-quote provider might understand "NIS" correctly. (07:06:15 PM) c0m4: ...ok (07:06:18 PM) jsled: In that case, GnuCash shouldn't try to retreive a quote for ILS. (07:06:26 PM) c0m4: is it the case? (07:06:51 PM) warlord: jsled: according to http://www.xe.com/iso4217.php it is ILS (07:07:17 PM) jsled: Oh, do I have it backwards? (07:07:28 PM) jsled: What's the current/correct currency, then? (07:07:31 PM) warlord: According to http://www.oanda.com/site/help/iso_code.shtml#I is it ALSO ILS (07:07:35 PM) c0m4: ... (07:07:37 PM) c0m4: :D (07:08:15 PM) c0m4: stange... it should be NIS but if the iso code is ILS, I can't blame yahoo for not being updated (07:08:19 PM) jsled: Oh. So we just need to update iso-4217-currencies.scm , and pre-2.2.2 users will need to convert their datafile. (07:08:59 PM) warlord: My guess: It went from ILS->NIS for a while, and then went back. (07:09:47 PM) jsled: Hmm. http://en.wikipedia.org/wiki/Israel still says NIS. (07:10:04 PM) jsled: Though <http://en.wikipedia.org/wiki/Israeli_new_sheqel> says it's ILS. (07:10:09 PM) c0m4: yeah we are too small to get it correctly :D (07:11:08 PM) c0m4: we switched from IsraeLi Shekel to New Israeli Shekel in the 70's if I'm not mistaking (07:11:18 PM) warlord: The latter calls it both! (07:11:25 PM) warlord: <http://en.wikipedia.org/wiki/Israeli_new_sheqel> (07:11:34 PM) jsled: warlord: yeah ... It calls it NIS, but it's clear the ISO4217 code is ILS. (07:11:37 PM) warlord: It's abbreviated NIS, but ILS is the ISO code. (07:11:43 PM) warlord: Yeah... VERY weird. (07:12:57 PM) c0m4: :) any way, tnx again for your help. (07:13:05 PM) warlord: We changed from ILS->NIS in 2004. (07:13:44 PM) warlord: c0m4: can you file a bug report against gnucash, please? (07:13:51 PM) c0m4: yes (07:13:55 PM) c0m4: I do that (07:13:58 PM) warlord: (feel free to copy and paste this full conversation) (07:14:04 PM) jsled: http://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash
Created attachment 117480 [details] [review] old and new sheqel according ISO 4217 This patch 1. replaces the abbreviation "NIS" by the ISO symbol "ILS"; 2. removes "new" in the subunit - as ILS is the 3. currency with the subunit agora, "new" is dropped for the subunit; 3. includes, for completeness and better understanding, a line with the precessor currency "ILR". Possible problems: 1. I couldn't find a numeric code for ILR and left it empty. 2. I don't know, how it behaves with old data files. Some really dev should write something, to replace the mistyped <cmdty:id>NIS</cmdty:id> by <cmdty:id>ILS</cmdty:id> in all old datafiles.
Cause of this bug was the, at least in my eyes, invalid bug 152755. The results of some trials we made, can be found in http://lists.gnucash.org/logs/2008/08/2008-08-31.html#T00:14:06.
If the change done at my request (issue #152755) causes bugs, I'm fine with reverting it. Is there any way to still mention NIS with regards to ILS? Something like ILS (NIS).
Re #3: In the current state gnucash has a table with * the ISO symbol (should be ILS as it is used by FinaceQuote) * long names of unit and subunit * ISO code from other sources (local settings) a currency symbol etc. in he.po a currency symbols $, which seems to be used in the business features. It is untranslated. If you watch the $ sign in your invoices or somewhere else in the business features, it should be translated to the shah symbol ₪. Then you should contact your translator Ori Hoch <ori AT uumpa.com> for that. At least I do not see, where the NIS could be introduced on the fly. So I suggest, you open a new bug "Enhancement request for national currency abbreviations" and answer the following questions: Why should it be done? Where should it be used? Other Points, to obey. Imagine, you had a bank account in Nicaragua and Nicaragua would replace the Oro by something like Sandina or Sol. Then this currency would become the official "NIS" and you would have 2 currencies with the same abbreviation. So it would be a bad idea to have it in the Chart of accounts.
(In reply to comment #1) > Created an attachment (id=117480) [edit] > old and new sheqel according ISO 4217 Thanks for the patch. Could you please resubmit with the following changes: - Don't include the very old currency - nobody has asked for it and it only confuses matters - Add the NIS -> ILS change to src/engine/gnc-commodity.c i.e. remove the NIS -> ILS line there and replace it with a ILS -> NIS line. It sucks that the reporter in bug#152755 didn't give a reference for his request and I didn't insist on getting one. Duh.
Just for completeness: Basically we'll revert http://svn.gnucash.org/trac/changeset/10331 ... oh wait, I just go ahead and commit this myself. Committed to trunk, r17660. Awaiting back-port.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=492417. Please update any external references or bookmarks.