Issue 86 in hledger: Unbalanced transactions involving multiple currencies are not reported as an error.

22 views
Skip to first unread message

hle...@googlecode.com

unread,
May 8, 2012, 12:10:01 PM5/8/12
to hle...@googlegroups.com
Status: New
Owner: ----
Labels: Priority-Medium

New issue 86 by rocon...@r6.ca: Unbalanced transactions involving multiple
currencies are not reported as an error.
http://code.google.com/p/hledger/issues/detail?id=86

What steps will reproduce the problem?
1. create a file called /tmp/hledger.test with the following data:

2012/01/01 Initial
accounts:bank 100 EUR
equity:initial

2012/04/21 Test
expenses:test1 1.78 EUR
expenses:test2 $44.00
accounts:bank -45.78 EUR

2. execute hledger bal -f /tmp/hledger.test

What is the expected output? What do you see instead?

I expect there to be an error because the Test transaction does not balance
to 0. Instead I made an error where I entered $44 dollars instead of 44
EUR.

Instead the command succeeds and I'm oblivious to error in the entry.

What version of the product are you using?

hledger-0.16.1

On what operating system?

linux

Please provide any additional information below.

Some people on IRC were arguing that there is nothing that can be done to
catch this error. However I disagree. Any time that sum of all the
currencies of a transaction do not sum to 0 the entry is in error. The
fact that all the ledger entries sum to 0 is the fundamental property of
double entry bookkeeping that makes it so effective at catching errors.
Removing this property in any situation makes the ledger program useless
for catching mistakes. For currency conversions a "trading" account should
be used as described in:
http://www.mscs.dal.ca/~selinger/accounting/tutorial.html



Attachments:
hledger.test 192 bytes

hle...@googlecode.com

unread,
May 11, 2012, 10:20:17 AM5/11/12
to hle...@googlegroups.com
Updates:
Status: Accepted
Labels: Component-hledger Type-Enhancement

Comment #1 on issue 86 by si...@joyful.com: Unbalanced transactions
involving multiple currencies are not reported as an error.
http://code.google.com/p/hledger/issues/detail?id=86

Thanks for the report. As we discussed, this is the implicit conversion
ledger and hledger do when a transaction has exactly two commodities and no
unspecified amounts (http://hledger.org/MANUAL.html#transaction-prices),
often convenient but also a possible cause of undetected error (throwing
off one of your expense balances for two weeks). Currently my feeling is it
should log a warning when parsing such transactions, and/or have some
option that disallows (or permits) it. It would be good to find out if
ledger's strictness options affect this.

hle...@googlecode.com

unread,
Nov 10, 2012, 5:54:49 AM11/10/12
to hle...@googlegroups.com

Comment #2 on issue 86 by thierry....@gmail.com: Unbalanced transactions
involving multiple currencies are not reported as an error.
http://code.google.com/p/hledger/issues/detail?id=86

This issue is for me what generated the most errors and it took a long time
for me to realize that, even if ledger and hledger are permissive for
multiple currencies, actually it is a very bad practise to have multiple
currencies that do not balance in the same transaction.
The suggestion of simon, printing a warning, is for me a good idea.

hle...@googlecode.com

unread,
Jul 27, 2013, 5:04:10 PM7/27/13
to hle...@googlegroups.com

Comment #3 on issue 86 by thomasha...@gmail.com: Unbalanced transactions
involving multiple currencies are not reported as an error.
http://code.google.com/p/hledger/issues/detail?id=86

As someone using hledger for multicurrency accounting, I would like to
throw strong support behind Thierry's proposal.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

hle...@googlecode.com

unread,
Jul 27, 2013, 5:15:02 PM7/27/13
to hle...@googlegroups.com

Comment #4 on issue 86 by thomasha...@gmail.com: Unbalanced transactions
involving multiple currencies are not reported as an error.
http://code.google.com/p/hledger/issues/detail?id=86

I think current bug should be closed as dupe of

https://github.com/simonmichael/hledger/issues/115

which is now more blessed bug tracker.
Reply all
Reply to author
Forward
0 new messages