The following does seems to work

2012/10/09 t
   a  € 2
   b

2012/10/09 t
  a  € 4
  b

2012/10/09 t
  c  € 5
  a

2012/10/09 assertion
  a  € 0 = € 1

2012/10/09 t
  a:1  € 3
  z

2012/10/09 assertion
  a  € 0 = € 1
  a:1  € 0 = € 3


but it feels like a hack since the assert and check statements are, I 
think, designed for such tasks.

comments? Idea?

with kind regard

Jeroen

On Sunday, June 13, 2010 6:50:08 AM UTC+2, John Wiegley wrote:
>
> These can occur in many places:
>     
>       ; Within an automated transaction, the assert is evaluated every time
>       ; a posting is matched, with the expression context set to the
>       ; matched posting.
>       = /Food/
>         assert account("Expenses:Food").total >= $100
>     
>       2010-06-12 Sample
>         Expenses:Food                $100
>         Assets:Checking
>     
>       ; At file scope, the expression is evaluated within "global" scope.
>       assert account("Expenses:Food").total == $100
>     
>       ; At the top of a transction, the assertion's scope is the
>       ; transaction.  After a posting, the scope is that posting.  Note
>       ; however that account totals are only adjusted after successful
>       ; parsing of a transaction, which means that all the assertions below
>       ; are true, even though it appears as though the first posting should
>       ; affect the total immediately, which is not the case.
>       2010-06-12 Sample 2
>         assert account("Expenses:Food").total == $100
>         Expenses:Food                $50
>         assert account("Expenses:Food").total == $100
>         Assets:Checking
>         assert account("Expenses:Food").total == $100
>
> John
>

Reply via email to