On Mon, Jun 30, 2014 at 4:56 PM, John Wiegley <[email protected]> wrote:

> >>>>> Simon Michael <[email protected]> writes:
>
> > I find this a little harder to understand and explain, and unsatisfying
> that
> > a balance assertion doesn't definitively nail down (programmatically and
> > visually) what's in an account. You can add more postings, with 0 amount
> if
> > necessary, to assert the balance of each individual commodity:
>
> >   some:account  $1 = $4
> >   some:account   0 = EUR 10
> >   some:account   0 = FRF 15
>
> > but you're still not absolutely sure of the account's balance - new
> > commodities can show up there and the assertions won't notice.
>
> You are right, there should be a way to "close" the set of assertions
> within a
> transaction.  That is, each individual commodity must balance, but if at
> the
> end we have anything left over, then the group of assertions has failed.
>  This
> would then necessity adding 0 = FOO X declarations for all the other
> commodities.
>

On a related note: why are balance assertions tied to a transaction?
In Beancount I treat them as a distinct directive, e.g.:

  2014-06-30 balance  Assets:Some:Account    10 EUR

The advantage is that you can have assertions in between transactions, at
any point in time - balance assertions have their own date - they exist
without a corresponding transaction. I also prefer the dissociation of
these two directives; they represent different actions, the balance
assertion corresponds to the "Statement Balance" line of a monthly
statement, for instance, and if a statement is empty because of a lack of
activity, it still makes sense for a user to be able to insert an
assertion. That's often how I know I've checked and updated the balance for
a dormant account (e.g. credit-line, which I use only for short-lived
cash-flow needs).

The disadvantage is that it cannot insert a balance assertion between
transactions within the same day on the same account, because Beancount
does not support the notion of "time" (I know that Ledger does, I chose to
remove time on purpose, as I did imposing that ordering of directives
should not matter). The semantics of the balance assertion is well-defined:
it performs the check at the beginning of the day (before any other
directives that occur during tha today). In practice, this limitation has
not been an issue, it is pretty rare that you would have so many
transactions on (1) the same account (2) during the same day and that (3)
you would want to assert the balance in-between. But it is a limitation,
nonetheless.

Thoughts welcome,

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to