Bitcoin Forum
May 02, 2024, 12:01:02 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: GnuCash support for alternative/non-ISO currencies  (Read 8726 times)
FatherMcGruder (OP)
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250



View Profile WWW
July 18, 2011, 02:48:17 PM
 #1

"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.

Use my Trade Hill referral code: TH-R11519

Check out bitcoinity.org and Ripple.

Shameless display of my bitcoin address:
1Hio4bqPUZnhr2SWi4WgsnVU1ph3EkusvH
1714608062
Hero Member
*
Offline Offline

Posts: 1714608062

View Profile Personal Message (Offline)

Ignore
1714608062
Reply with quote  #2

1714608062
Report to moderator
1714608062
Hero Member
*
Offline Offline

Posts: 1714608062

View Profile Personal Message (Offline)

Ignore
1714608062
Reply with quote  #2

1714608062
Report to moderator
1714608062
Hero Member
*
Offline Offline

Posts: 1714608062

View Profile Personal Message (Offline)

Ignore
1714608062
Reply with quote  #2

1714608062
Report to moderator
The block chain is the main innovation of Bitcoin. It is the first distributed timestamping system.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714608062
Hero Member
*
Offline Offline

Posts: 1714608062

View Profile Personal Message (Offline)

Ignore
1714608062
Reply with quote  #2

1714608062
Report to moderator
1714608062
Hero Member
*
Offline Offline

Posts: 1714608062

View Profile Personal Message (Offline)

Ignore
1714608062
Reply with quote  #2

1714608062
Report to moderator
1714608062
Hero Member
*
Offline Offline

Posts: 1714608062

View Profile Personal Message (Offline)

Ignore
1714608062
Reply with quote  #2

1714608062
Report to moderator
FatherMcGruder (OP)
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250



View Profile WWW
September 20, 2011, 12:18:54 PM
 #2

Bump.

Use my Trade Hill referral code: TH-R11519

Check out bitcoinity.org and Ripple.

Shameless display of my bitcoin address:
1Hio4bqPUZnhr2SWi4WgsnVU1ph3EkusvH
FatherMcGruder (OP)
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250



View Profile WWW
September 29, 2011, 03:31:00 AM
 #3

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:
<iso_4217_entry letter_code="BTC" numeric_code="nil" currency_name="Bitcoin"/>
<iso_4217_entry letter_code="IHR" numeric_code="nil" currency_name="Ithaca HOUR"/>

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.

Use my Trade Hill referral code: TH-R11519

Check out bitcoinity.org and Ripple.

Shameless display of my bitcoin address:
1Hio4bqPUZnhr2SWi4WgsnVU1ph3EkusvH
julz
Legendary
*
Offline Offline

Activity: 1092
Merit: 1001



View Profile
September 29, 2011, 03:40:31 AM
 #4

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.

@electricwings   BM-GtyD5exuDJ2kvEbr41XchkC8x9hPxdFd
FatherMcGruder (OP)
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250



View Profile WWW
September 29, 2011, 01:10:04 PM
 #5

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.

Use my Trade Hill referral code: TH-R11519

Check out bitcoinity.org and Ripple.

Shameless display of my bitcoin address:
1Hio4bqPUZnhr2SWi4WgsnVU1ph3EkusvH
ne1
Member
**
Offline Offline

Activity: 84
Merit: 10


View Profile WWW
September 29, 2011, 04:10:27 PM
 #6

Thanks for that.  Awsome work.

ripper234
Legendary
*
Offline Offline

Activity: 1358
Merit: 1003


Ron Gross


View Profile WWW
December 19, 2012, 10:07:04 PM
 #7

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)?

Please do not pm me, use ron@bitcoin.org.il instead
Mastercoin Executive Director
Co-founder of the Israeli Bitcoin Association
EskimoBob
Legendary
*
Offline Offline

Activity: 910
Merit: 1000


Quality Printing Services by Federal Reserve Bank


View Profile
January 24, 2013, 09:06:43 PM
 #8

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)

 

While reading what I wrote, use the most friendliest and relaxing voice in your head.
BTW, Things in BTC bubble universes are getting ugly....
Sukrim
Legendary
*
Offline Offline

Activity: 2618
Merit: 1006


View Profile
January 24, 2013, 11:04:15 PM
 #9

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...

https://www.coinlend.org <-- automated lending at various exchanges.
https://www.bitfinex.com <-- Trade BTC for other currencies and vice versa.
bitcoinsrule
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
January 25, 2013, 01:37:27 AM
 #10

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.
EskimoBob
Legendary
*
Offline Offline

Activity: 910
Merit: 1000


Quality Printing Services by Federal Reserve Bank


View Profile
January 27, 2013, 08:45:57 PM
 #11

I am going to use FIM for LTC "place holder" because it ceased to be legal tender on 28 February 2002.
I think this is a really good example why gnucash developers obsession with ISO labels is a bit strange. Yes, those labels are useful but there is no need to exclude the option for adding a custom currencies to gnucash.

While reading what I wrote, use the most friendliest and relaxing voice in your head.
BTW, Things in BTC bubble universes are getting ugly....
Sukrim
Legendary
*
Offline Offline

Activity: 2618
Merit: 1006


View Profile
January 28, 2013, 07:44:24 PM
 #12

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.

...or just use this link:
http://www.ledger-cli.org/

It still is actively maintained + developed (https://github.com/ledger/ledger).

Anyways, seems VERY nice, if only there would be some nice frontends for reports, graphs and stuff. Also that text file approach sounds interesting, but might not be appealing to everyone.

https://www.coinlend.org <-- automated lending at various exchanges.
https://www.bitfinex.com <-- Trade BTC for other currencies and vice versa.
bitcoinsrule
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
January 28, 2013, 09:31:28 PM
 #13

...or just use this link:
http://www.ledger-cli.org/

It still is actively maintained + developed (https://github.com/ledger/ledger).

Anyways, seems VERY nice, if only there would be some nice frontends for reports, graphs and stuff. Also that text file approach sounds interesting, but might not be appealing to everyone.

It's VERY VERY nice actually, (for me anyway). Smiley At any rate, here is the subreddit that introduced it to me, it gives out a very though explanation on how to get started and might be easier than the docs.

http://www.reddit.com/r/Bitcoin/comments/155gw5/heres_how_you_use_ledger_to_account_for_bitcoin/

Also, there's a link to a python script that will pull spot prices for silver, gold and BTC.

As far as the frontend support goes, it supports GNUplot for graphs and such.
Rassah
Legendary
*
Offline Offline

Activity: 1680
Merit: 1035



View Profile WWW
January 29, 2013, 03:48:03 PM
 #14

I was totally blasting Ledger as a crappy tool only suited for Linux command-line geeks, and was using GNUCash only, but Ledger still eventually won me over. It's still a bit of a pain to have to remember some of the commands when running reports, but the text file approach does make it somewhat easier to be more precise, and so far I've been able to find every accounting function and report that I've needed from GNUCash. Currently using Ledger for Bitcoin100.org's finances.
EskimoBob
Legendary
*
Offline Offline

Activity: 910
Merit: 1000


Quality Printing Services by Federal Reserve Bank


View Profile
January 29, 2013, 08:47:45 PM
Last edit: January 29, 2013, 10:29:23 PM by EskimoBob
 #15

I am going to give up on gnucash unless I find a workaround for problems I have with reports in multiple currencies.
I actually got the books looking and doing what we needed in the ART project. When I wanted to generate reports, and this damn thing refused to use any of the exchange rates I had entered, I walked away.
To put it politely, cnugash is a joke when it comes to multiple currencies (and do not get me started on this "no user added currencies" BS they got going there!)

Rassah, thanks for the encouragement Smiley I think I am going to look in to Ledger too.  
We only have few transactions at the moment so this is a perfect time to test this stuff out.

While reading what I wrote, use the most friendliest and relaxing voice in your head.
BTW, Things in BTC bubble universes are getting ugly....
Rassah
Legendary
*
Offline Offline

Activity: 1680
Merit: 1035



View Profile WWW
January 30, 2013, 02:31:49 AM
 #16

Just a tip, whenever I exchange some USD into BTC, I do something like
Assets:BTCWallet ฿20 @@ $384

The @@ tells it the total you paid for the currency and calculates the exchange rate for you (I can also use just one @ to give it the exchange rate directly). Then if I run a Ledger command with a -G or something, it tells me my gains and losses on each account. A prices command will also give me a list of exchange rates for every date available.
EskimoBob
Legendary
*
Offline Offline

Activity: 910
Merit: 1000


Quality Printing Services by Federal Reserve Bank


View Profile
January 30, 2013, 09:31:59 AM
 #17

Just a tip, whenever I exchange some USD into BTC, I do something like
Assets:BTCWallet ฿20 @@ $384

The @@ tells it the total you paid for the currency and calculates the exchange rate for you (I can also use just one @ to give it the exchange rate directly). Then if I run a Ledger command with a -G or something, it tells me my gains and losses on each account. A prices command will also give me a list of exchange rates for every date available.

Lets move all Ledger related questions ad discussion here: https://bitcointalk.org/index.php?topic=139995.msg1489920

Thank you

While reading what I wrote, use the most friendliest and relaxing voice in your head.
BTW, Things in BTC bubble universes are getting ugly....
bitcoinsrule
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
January 30, 2013, 06:26:59 PM
 #18

Just a tip, whenever I exchange some USD into BTC, I do something like
Assets:BTCWallet  ฿20 @@ $384

What keystroke do you use to get "฿"?
Rassah
Legendary
*
Offline Offline

Activity: 1680
Merit: 1035



View Profile WWW
January 30, 2013, 06:36:01 PM
 #19

Just a tip, whenever I exchange some USD into BTC, I do something like
Assets:BTCWallet  ฿20 @@ $384

What keystroke do you use to get "฿"?

I google searched for Thai Baht, and copy/pasted the character. Sorry  Undecided
ErebusBat
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500

I am the one who knocks


View Profile
January 31, 2013, 03:45:49 AM
 #20

For what it's worth I spent 10 mins dinking around and think this might be possible without compiling your own version.

I downloaded GnuCash and created a new book (sqlite format).

Then I opened the file in my sqlite editor and ran:
Code:
insert into commodities
(guid, namespace, mnemonic, fullname, cusip, fraction, quote_flag, quote_source)
VALUES
('11f74daa3e324da18e8c1fb4871a0f70', 'CURRENCY', 'BTC', 'Bitcoin', '', 100000000, 1, 'currency')

The GUID is random, and the fraction doesn't appear to actually work as intendended; however this allows you to create accounts as BTC now.

Perhaps someone smarter than me can take this farther.  I used http://wiki.gnucash.org/wiki/SQL as inspiration.

░▒▓█ Coinroll.it - 1% House Edge Dice Game █▓▒░ • Coinroll Thread • *FREE* 100 BTC Raffle

Signup for CEX.io BitFury exchange and get GHS Instantly!  Don't wait for shipping, mine NOW!
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!