Issue #362: pad fails, takes amount from unrelated account into account (blais/beancount)

9 views
Skip to first unread message

Martin Michlmayr

unread,
Jan 19, 2019, 12:01:45 PM1/19/19
to bean...@googlegroups.com
New issue 362: pad fails, takes amount from unrelated account into account
https://bitbucket.org/blais/beancount/issues/362/pad-fails-takes-amount-from-unrelated

Martin Michlmayr:

I have account `Assets:Bank` and `Assets:Bank-Two`: a `pad` statement for `Assets:Bank` also takes the amount from `Assets:Bank-Two`, leading to the wrong balance.

```
1970-01-01 open Assets:Bank
1970-01-01 open Assets:Bank-Two
1970-01-01 open Equity:Opening-Balance
1970-01-01 open Equity:Adjustments
1970-01-01 open Expenses:Food

2019-01-01 * "Opening balance"
Assets:Bank 20.00 GBP
Equity:Opening-Balance -20.00 GBP

2019-01-03 * "Tesco" "Buy food"
Expenses:Food 30.00 GBP
Assets:Bank -30.00 GBP

2019-01-04 balance Assets:Bank -10.00 GBP

2019-01-03 * "Tesco" "Buy food"
Expenses:Food 6.00 GBP
Assets:Bank-Two -6.00 GBP

; Get rid of overdraft somehow and get a £50 balance

2019-01-04 pad Assets:Bank Equity:Adjustments
2019-01-05 balance Assets:Bank 50.00 GBP
```

```
bean-query ~/t.beancount "Select * where account ~ 'Bank$'"
/home/tbm/t.beancount:25: Balance failed for 'Assets:Bank': expected 50.00 GBP != accumulated 56.00 GBP (6.00 too much)

2019-01-05 balance Assets:Bank 50.00 GBP


date f payee narration position
---------- - ----- -------------------------------------------------------------------- ----------
2019-01-01 * Opening balance 20.00 GBP
2019-01-03 * Tesco Buy food -30.00 GBP
2019-01-04 P (Padding inserted for Balance of 50.00 GBP for difference 66.00 GBP) 66.00 GBP
```

To go from -10 to +50, we should pad by 60. The 6 comes from `Assets:Bank-Two`, which is completely unrelated.


Reply all
Reply to author
Forward
0 new messages