Pages:
Author

Topic: GnuCash support for alternative/non-ISO currencies - page 2. (Read 8762 times)

newbie
Activity: 26
Merit: 0
Ledger.

Do a search for "ledger" on the reddit subereddit /r/bitcoin. Works great for bitcoin, has a script that pulls spot price from mtgox and has gotten me to get off gnucash completely. Takes some getting used to but is awesome.  Won't be for everyone.
legendary
Activity: 2618
Merit: 1007
Please just mirror the sourcecode on github + create a branch that includes your "fix". Ideally also provide some compiled versions.

Also to make the patch cleaner you might wanna look into extending GnuCash to include http://tools.ietf.org/html/draft-stanish-x-iso4217-a3-01 instead of just ISO4217, which would be the preferred solution by the BTC (BTCX) community anyways. Having a patch ready once the gnuCash developers decide to go along with that would be great.

It's OpenSource after all...
legendary
Activity: 910
Merit: 1000
Quality Printing Services by Federal Reserve Bank
Looks like people just did not get it over at http://gnucash.1415818.n4.nabble.com/For-The-Love-Of-Bitcoin-td4348895i20.html and wasted more time on arguing about ISO or not ISO, than it have taken to write the cod and get the BTC on the currency list.

FatherMcGruder, maybe you can write a batch and get it included in the next version?
If you do not mind, can you please add Litecoin too Smiley

(actually, add your own currency "module" is even better)

 
legendary
Activity: 1358
Merit: 1003
Ron Gross
Reviving thread - there's also a Bitcoin specific ticket on UserVoice, please vote.

Any other alternatives that are better suited for Bitcoin? Any of those support price import from Mt. Gox (to view an entire account that's composed of BTC & USD)?
ne1
member
Activity: 84
Merit: 10
Thanks for that.  Awsome work.
sr. member
Activity: 322
Merit: 250
I hope the changes get integrated into the main builds.
Well, if the GnuCash developers decide to do so, and I doubt they will, they won't take my route. I had to modify a system file, iso_4217.xml, after all. Furthermore, it works by pretending that the target non-ISO4217 currencies do qualify as ISO4217. That just strikes me as an undignified kludge.

I doubt that the developers will update GnuCash to include the bitcoin or any non-ISO4217 currency because they've stated that they won't include currencies that ISO4217 doesn't recognize. They also seem content with forcing users to make do, rather than coding a proper feature that would users to easily define their own non-standard currencies. Someone needs to actually code the feature and submit it. If the developers reject it then we can just fork the project.
legendary
Activity: 1092
Merit: 1001
Thanks for drawing my attention to GnuCash - I'll be giving it a whirl for sure.

Upvoted.

I hope the changes get integrated into the main builds.
sr. member
Activity: 322
Merit: 250
Well, I decided to make GnuCash treat the bitcoin like a regular currency myself. I downloaded the source code and modified two files, iso-4217-currencies.scm and iso-4217-currencies.c, both in '/gnucash-2.4.7.1b/src/engine/'. To the former I added the following lines:
Code:
;; non-standard/private - Not ISO4217, but we designate it as such so that Gnucash will treat it as such.

( "Bitcoin" "bitcoin" "satoshi" "ISO4217" "BTC" "nil" 100000000 100000000 "BTC" ) ;; Would have used XBC as the mnemonic to conform with ISO4217, but it appears to have been taken.

( "Ithaca HOUR" "hour" "hour" "ISO4217" "IHR" "nil" 6 10 "" )
";;" indicates a comment.

To the latter I added:
Code:
  {
    const char *fullname = "Bitcoin";
    gnc_commodity *c = gnc_commodity_new(book,
CUR_I18N(fullname),
                                         "ISO4217",
                                         "BTC",
                                         "nil",
                                         100000000);

    if(!c) {
      PWARN("failed to create commodity for currency %s", fullname);
    } else {
      if(!gnc_commodity_table_insert(table, c)) {
        PWARN("failed to insert %s into commodity table", fullname);
      }
    }
  }

  {
    const char *fullname = "Ithaca HOUR";
    gnc_commodity *c = gnc_commodity_new(book,
CUR_I18N(fullname),
                                         "ISO4217",
                                         "IHR",
                                         "nil",
                                         10);

    if(!c) {
      PWARN("failed to create commodity for currency %s", fullname);
    } else {
      if(!gnc_commodity_table_insert(table, c)) {
        PWARN("failed to insert %s into commodity table", fullname);
      }
    }
Although I'm not sure if I needed to do so.

I also made sure to add the following lines to '/usr/share/xml/iso-codes/iso_4217.xml':
Code:


Then, I compiled GnuCash:
Code:
sudo apt-get build-dep gnucash
sudo sh configure --prefix=/opt/gnucash
sudo make
sudo make install

That puts an executable here: /opt/gnucash/bin/gnucash

Ta da!

Keep in mind that I started with GnuCash 2.4.7 and that I am running it on Ubuntu 11.04. YMMV.
sr. member
Activity: 322
Merit: 250
Bump.
sr. member
Activity: 322
Merit: 250
"Make it easier for users to work with alternative/non-ISO/private currencies. (http://uservoice.com/a/35yKe)"

Folks, I made the above suggestion to the GnuCash developers to include better support for currencies that do not meet ISO requirements, like the bitcoin. I hope you'll all up vote it.
Pages:
Jump to: