Re: Balance assertion for a top level account

2016-02-15 Thread Pascal Fleury
On Sun, Feb 14, 2016 at 3:52 AM, John Wiegley wrote: > > Chris Bennett writes: > > > Assertions (both balance and assert) appear to apply prior to > calculation of > > automated transactions. e.g. > > The related automated transactions should be

Re: Balance assertion for a top level account

2016-02-14 Thread Chris Bennett
> The related automated transactions should be applied before the assertion, > since they are computed "as we parse". That it's not happening sounds like a > bug to me, since it certainly could affect balances through the use of > unbalancing virtual postings. I've ended up using asserts as

Re: Balance assertion for a top level account

2016-02-14 Thread John Wiegley
> Chris Bennett writes: > Assertions (both balance and assert) appear to apply prior to calculation of > automated transactions. e.g. The related automated transactions should be applied before the assertion, since they are computed "as we parse". That it's not

Re: Balance assertion for a top level account

2016-02-12 Thread Chris Bennett
Hi John, > You could use a general assert with a value expression: > > assert account("Expenses").total == $0.00 > > "total", as opposed to "amount", specifies the total sum of all child > accounts, include anything in the given account itself. Thanks, that works. However I found a

Re: Balance assertion for a top level account

2016-02-09 Thread Martin Blais
On Tue, Feb 9, 2016 at 8:16 AM, Chris Bennett wrote: > > I remember this coming up in the ML in the past, but can't find a > > reference. I want to refactor some of my accounts & transactions, but > > want to avoid breaking the resultant value for top level accounts > >

Re: Balance assertion for a top level account

2016-02-09 Thread Chris Bennett
> I remember this coming up in the ML in the past, but can't find a > reference. I want to refactor some of my accounts & transactions, but > want to avoid breaking the resultant value for top level accounts > (since the data has already been reported to the government and I > don't want that to

Re: Balance assertion for a top level account

2016-02-09 Thread John Wiegley
> Martin Blais writes: > I'm not sure what how Ledger handles balances for parent accounts, would > love to hear how it works. You could use a general assert with a value expression: assert account("Expenses").total == $0.00 "total", as opposed to "amount", specifies

Re: Balance assertion for a top level account

2016-02-04 Thread Ben Finney
Ben Finney writes: > Chris Bennett writes: > > > 2015/12/31 MyCompany:Expenses closing balance > > MyCompany:Expenses $0.00 = $4.55 > > Equity:Dummy > > You're asserting “After this transaction that moves

Re: Balance assertion for a top level account

2016-02-04 Thread Chris Bennett
Hi Ben, Thanks for your reply. > Yes. You're asserting ???After this transaction that moves $0.00, the > balance should be $4.55???. Yep, that's how I've been using that expression for beginning and end of statement balance assertions, to pre & post declare what the balance must be at beginning

Re: Balance assertion for a top level account

2016-02-04 Thread Ben Finney
Chris Bennett writes: > But when I assert a balance for the Expense account, it errors: > > 2015/12/31 MyCompany:Expenses closing balance > MyCompany:Expenses $0.00 = $4.55 > Equity:Dummy > > > $ ledger -f test.ledger bal > While parsing