* Helmut Grohne <hel...@subdivi.de> [2014-12-30 22:31]:
> | 2014/12/28 Insert
> |   Source
> |   Target  2 Foo
> | 
> | 2014/12/28 Insert
> |   Source
> |   Target  1 Bar
> | 
> | 2014/12/29 Check
> |   Target  = 2 Bar
> |   Target  = 2 Foo
> 
> The third transaction contains a balance assertion on the Target account
> and asserts that it contains 2 Bar.> The account actually contains only 1
> Bar.

That's actually not correct.  see
https://www.ledger-cli.org/3.0/doc/ledger3.html#Balance-verification
in particular 5.10.3 Resetting a balance

The "= 2 Bar" syntax means that you reset the balance to 2 Bar.  And
ledger does this correctly, but the problem is that both postings
contain Target, so ledger adds +1 Bar (to get from 1 Bar to 2 Bar)
but then also does a -1 Bar to Target.

You'd want something like this:

2014/12/28 Insert
  Source
  Target  2 Foo

2014/12/28 Insert
  Source
  Target  1 Bar

2014/12/29 Check
  Target  = 2 Bar
  Source

There are some bugs though.  I will comment on GitHub:
https://github.com/ledger/ledger/issues/1094

-- 
Martin Michlmayr
https://www.cyrius.com/

Reply via email to