Live data from Hacker News

Ledger, a command-line accounting system

ledger-cli.org

121–130 of 169 posts

Re: Ledger, a command-line accounting system

#121
post #25

as a side note: both ledger [0] and hledger [1] support time tracking/keeping. of all the various tools I tried to use for personal stuff it has been the most convenient one for me (it helps that I also use it for accounting) and I'm using it consequently from day 1 on! you can apply the same reporting/balancing to your time keeping as you do to your accounting. [0] http://www.ledger-cli.org/3.0/doc/ledger3.html#Time…

Has anyone tried to marry the time tracking in ledger with org-mode in emacs? I haven't looked at the emacs mode for ledger yet, so forgive me if it is in there. I would really like to work in org-mode and somehow end up with ledger output without having to manually move all the data.

Re: Ledger, a command-line accounting system

#122

Earlier quoted context omitted.

I deal with multiple currencies in Ledger as well. Feel free to email me or join their IRC channel for some help! :)

You profile doesn't specify your email :) I'd be glad to get help here, but I think this is just an unsolved problem. Discussed it on google group. I think I understand it relatively well, and even wanted to fix it, therefore I doubt multiple currencies can be handled with the current version of ledger; but would be glad to find a workaround.

I don't have it installed now, so an example just out of my head: suppose I have 100 USD; I exchange 50 USD to EUR at 1.2 rate. Then I spend 20 EUR on food. Then I exchange remaining EUR to USD at 1.1 rate. Now, if we generate a balance report, do you say it will be balanced?

Re: Ledger, a command-line accounting system

#123

Earlier quoted context omitted.

You profile doesn't specify your email :) I'd be glad to get help here, but I think this is just an unsolved problem. Discussed it on google group. I think I understand it relatively well, and even wanted to fix it, therefore I doubt multiple currencies can be handled with the current version of ledger; but would be glad to find a workaround.

I don't have it installed now, so an example just out of my head: suppose I have 100 USD; I exchange 50 USD to EUR at 1.2 rate. Then I spend 20 EUR on food. Then I exchange remaining EUR to USD at 1.1 rate. Now, if we generate a balance report, do you say it will be balanced?

What do you mean 'it will be balanced'? In double entry accounting, every ledger entry needs to balance. You have three entries. Whether they balance depends on how you enter them. What is the specific problem in your example?

Re: Ledger, a command-line accounting system

#124

Earlier quoted context omitted.

Ledger deals with multiple currencies quite well in my experience, especially using a custom prices.db file. What is the problem you are having?

After currency exchange transactions it doesn't balance.

It can be done, but it is tricky, especially if you have to report capital gains as FIFO. The documentation is in ledger is misleading/wrong (or was the last time I looked). I have been meaning to write a blog post on this topic for ages (a year???).

Warning: This may be wrong. I just grabbed it randomly out of a test file I was using to try this out and I don't have time to verify it. However, I think it will put you on the right track even if it is wrong (also not sure how to get it formatted correctly here). Anyway this is the kind of thing you have to do:

  2014/09/04 Exchange Currency
    ; Note that the next line generates 20 GBP, not 10 GBP as you might expect
    ; This is so that the excess is captured by the capital gains account at the bottom
    ; Also note that the @ 0.50 GBP is not actually used by ledger in this case
    ; You could put @ 5000 GBP and it would do the same thing.  The rate is
    ; determined by the lot price.
    Assets:CDN                   -20.00 CDN {1.00 GBP} @ 0.50 GBP
    ; It is unfortunate that you can't get ledger to calculate or assert the next value
    Assets:GBP                    10.00 GBP ; Proceeds without commission
    Expenses:Commissions           0.20 GBP
    Assets:GBP                    -0.20 GBP ; Balance the commission
    Income:Capital Gains
The main things you have to understand are that you need to specify the lot price in the transaction. Second, you must specify the price of the transaction. The P line is only used for calculating current value -- it will not set the price of the transaction correctly (if you don't specify it, I think it sets it to whatever the P line is set to when you run the report, which is clearly wrong). Also, you have to calculate either the total proceeds for the balancing account or the capital gains. Also, very unfortunately, with this scheme you can not use the @@ method of specifying the price. I do the math and calculate the result and let ledger calculate capital gains, because that seems the most reasonable thing to do. Some people feel very strongly that a human should calculate the capital gains by hand and enter that value. Either way should work.

Hopefully the above should unstick you. If you are using average method for capital gains, it is dramatically simpler, but I don't have an example handy.

Printing reports with the lot prices is incredibly useful as the lots should balance out to zero. If they do not, then you have an error somewhere (and boy does that suck). It's also very frustrating when doing FIFO or LIFO that you constantly need to run the report to show you how much you have left in each lot, and then go and figure out which lots are the next ones to use. I think this can be automated, but I haven't gotten around to doing it.

Re: Ledger, a command-line accounting system

#125
post #60

Earlier quoted context omitted.

YNAB is not double-entry. In fact I interviewed with them one time and they asked me how I would design it, and I started outlining how I run my ledger-based YNAB-like system with double-entry accounting. Their response was something along the lines of "wish we had thought of that, it would have been easier."

Wait, it isn't? My understanding of double entry is that asset moves across accounts are recorded in both accounts, so if I were to, say, pay a credit card bill, I show a debit from my checking account and a credit to my card account. Is this incorrect?

You'd do the same in cash accounting. Otherwise you're recording wrong values, as compared to the actual account statements. Double entry means balancing active and passive sides for all activities, asset and debt. When you buy a laptop with a credit card, you add (for example - the details depend on legal requirements, how much detail you want to capture etc) an entry with 1000 on the passive side, in the cc account, 500 on the active side (asset it's not worth what you paid for it any more) and 500 under depreciaton. Then when you pay the bill, you reduce the cc account and the checking account. Each of these operations individually are balanced, ie they sum to 0.

Re: Ledger, a command-line accounting system

#126
post #123

Earlier quoted context omitted.

I don't have it installed now, so an example just out of my head: suppose I have 100 USD; I exchange 50 USD to EUR at 1.2 rate. Then I spend 20 EUR on food. Then I exchange remaining EUR to USD at 1.1 rate. Now, if we generate a balance report, do you say it will be balanced?

What do you mean 'it will be balanced'? In double entry accounting, every ledger entry needs to balance. You have three entries. Whether they balance depends on how you enter them. What is the specific problem in your example?

I mean that balance report had 0 total. More precisely, I want to convert everything to a single currency, and than have 0 balance. I.g. I want to check my net worth in USD, or my net worth in EUR. To see capital gains/losses.

Re: Ledger, a command-line accounting system

#127
post #60

Earlier quoted context omitted.

YNAB is not double-entry. In fact I interviewed with them one time and they asked me how I would design it, and I started outlining how I run my ledger-based YNAB-like system with double-entry accounting. Their response was something along the lines of "wish we had thought of that, it would have been easier."

Wait, it isn't? My understanding of double entry is that asset moves across accounts are recorded in both accounts, so if I were to, say, pay a credit card bill, I show a debit from my checking account and a credit to my card account. Is this incorrect?

YNAB is double-entry but not the way you would normally do it (note, I have no idea how it is implemented under the hood, I'm just referring to how I explain YNAB's system to myself). YNAB essentially puts your accounts (assets and liabilities) on one side of the balance sheet and the budgets on the other. It is double-entry in the sense that every transaction is either between two accounts, or between an account and a category (a budget account), so there are two sides to every transaction.

However, in "normal" double-entry accounting, you would not have assets and liabilities on the same side of the balance sheet, and the way YNAB does this leads to some strange behavior. For example, if your net wealth (assets and liabilities) is negative, you need a negative budget ("pre-YNAB debt"). So now you have in your budget both money you plan to spend on actual expenses, and debt.

You could, in principle, design a YNAB-like double-entry accounting system where your assets balance against equity and debt, and where the money that is "available to budget" matches the actual money you have available, regardless of whether that money originates from equity or debt. That would be closer to the normal understanding of double-entry accounting.

Re: Ledger, a command-line accounting system

#128
I've used ledger for years, but it's not a 'real' double entry system, despite what the manual says. It's more halfway between cash and double entry. The 'auto balancing' for example, which is sold as its big feature, doesn't make sense from a double accounting perspective - the whole point is to not have it be 'auto'. Other basic things are missing - the difference balance and profit/loss accounts, for example. It's fine for personal and small business accounting, but if you've had training in real accounting some things will be confusing (because of terms meaning something else) and don't expect your accountant to be able to work with your reports if you haven't set up your system in cooperation with him/her.

Re: Ledger, a command-line accounting system

#130

Earlier quoted context omitted.

After currency exchange transactions it doesn't balance.

It can be done, but it is tricky, especially if you have to report capital gains as FIFO. The documentation is in ledger is misleading/wrong (or was the last time I looked). I have been meaning to write a blog post on this topic for ages (a year???). Warning: This may be wrong. I just grabbed it randomly out of a test file I was using to try this out and I don't have time to verify it. However, I think it will put yo…

Thanks, I will try. Can you drop me an email, so I will share my results or other ideas I have about this later?
Post reply on HN