GNOME Bugzilla – Bug 504257
Need to replace old Afghanistan Afghani (AFA) with new Afghanistan Afghani (AFN)
Last modified: 2018-06-29 21:56:49 UTC
The Afghanistan Afghani (AFA) cannot be subdivided. One Afghani is the smallest unit of currency used (equal to approximately 0.02 USD). However, by default GnuCash uses a fraction of 1/100 for AFA. This can be observed by opening the "Edit currency" window for AFA - the fraction traded will be 100, but should be 1.
Created attachment 101197 [details] [review] Change the fraction for AFA from 100 to 1.
per http://en.wikipedia.org/wiki/Afghan_afghani (as of today...) the Afghani has a sub-unit called the "pul" at 100 pul to 1 Afghani. I'm not up on currency issues, but this seems to indicate that gnucash is correct to use the 1/100 fraction in this case.
OK, I should have done a little more research. You are right, AFA was in fact subdivided into 100 pul. My mistake was not realizing that AFA has now been replaced by AFN, which does not have subdivisions. From the Wikipedia article you referenced, in the section "Second afghani, 2002-": "Between October 7, 2002, and January 2, 2003, a new afghani was introduced with the ISO 4217 code AFN. No subdivisions have been issued." So, AFA is actually obsolete and my patch is incorrect. Instead, the AFN currency should be added, using a fraction of 1/1. I'll need to research how GnuCash deals with obsolete currencies (for AFA) and see if I can't put together a new patch in the next day or two bringing all this up-to-date. Changing the summary of this bug (was "Smallest fraction traded for AFA currency should be 1 instead of 100") to reflect this.
Created attachment 101403 [details] [review] Adds new Afganistan Afghani (AFN) to the currency list New patch: left the old Afghanistan Afghani (AFA) unchanged, except that it is now renamed to "Afghanistan Afghani (old)". Added the new Afghanistan Afghani with ISO 4217 code AFN and code number 971 (see http://en.wikipedia.org/wiki/ISO_4217#Active_codes), and a fraction of 1/1.
Applied r16690 In the future, please diff from the top level (you diffed from src/). I see that the past practice has been to leave the old currency in place, just renaming it and noting the change. Derek has asked if we need both in place. I say yes: many others are still in place and this one is more recent than those. Thanks for this!
branches/2.2 @ r16788 for GnuCash 2.2.3. Thanks a lot!
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=504257. Please update any external references or bookmarks.