I'm using the latest version of ledger from the git master branch.
I run the following command and get an error
$ ~/personal/workspaces/ledger/ledger -f ledger.dat bal
While parsing file "ledger.dat", line 37:
While balancing transaction from "ledger.dat", lines 35-37:
> 2010/01/22 Marketing B
> Expenses:Marketing 55EUR {=$1.81818181818}
> Liabilities:Accounts Payable -$100
Unbalanced remainder is:
$10
Amount to balance against:
$110
Error: Transaction does not balance
From what I understand I should be using the rate 1.81818181818 to
convert the 55 euros into 100 dollars.
However this doesn't seem to be happening.
Here is the full ledger file
2009/01/01 Invoice A
Assets:Accounts Payable $1000
Income:Sales
2009/01/21 Payment Invoice A
Assets:NAB $1000
Assets:Accounts Receivable
2009/01/22 Pay expenses
Expenses:Payroll $800
Assets:NAB
2009/01/22 Marketing A
Expenses:Marketing 50EUR {=$2}
Liabilities:Accounts Payable -$100
2009/01/23 Pay MC Marketing
Assets:NAB -$100
Liabilities:Accounts Payable
;-------------------------------------------------------
2010/01/01 Invoice B
Assets:Accounts Payable $1000
Income:Sales
2010/01/21 Payment Invoice B
Assets:NAB $1000
Assets:Accounts Receivable
2010/01/22 Pay expenses
Expenses:Payroll $800
Assets:NAB
2010/01/22 Marketing B
Expenses:Marketing 55EUR {=$1.81818181818}
Liabilities:Accounts Payable -$101
2010/02/23 Pay MC Marketing
Assets:NAB -$100
Liabilities:Accounts Payable
Hope someone can explain to me what I'm doing wrong.
I also tried to use the fixed syntax
fixed EUR $1.81818181818
....
end fixed
but that always reported a parse error.
Pete
> From what I understand I should be using the rate 1.81818181818 to
> convert the 55 euros into 100 dollars.
Your problem is with rounding. Put this at the top of your file:
D $1,000.00
Then your problem should go away. It's not that your transaction didn't balance, it's that the *display value* of the transaction didn't balance; and since you never use decimal points in any of your dollar amounts, Ledger rounds all display value to the nearest dollar.
There is a bug here, in that it should round the 55*1.818 after the multiplication, not before. I'll add an issue for this.
John
That did solve the problem.
> I run the following command and get an error
>
> $ ~/personal/workspaces/ledger/ledger -f ledger.dat bal
> While parsing file "ledger.dat", line 37:
> While balancing transaction from "ledger.dat", lines 35-37:
>> 2010/01/22 Marketing B
>> Expenses:Marketing 55EUR {=$1.81818181818}
>> Liabilities:Accounts Payable -$100
> Unbalanced remainder is:
> $10
> Amount to balance against:
> $110
> Error: Transaction does not balance
>
> From what I understand I should be using the rate 1.81818181818 to
> convert the 55 euros into 100 dollars.
>
> However this doesn't seem to be happening.
Peter, this should work for you now. I just tested again the 'next' branch.
John