diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-12 21:43:03 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-13 01:03:48 -0400 |
commit | 6ef755c1330c6e11476ea2e63b8388ad29efb4ef (patch) | |
tree | ad006748fff38a2748087514908ef370495ec791 /src/account.cc | |
parent | 6f56a7443fea165c73d00029437530d567556994 (diff) | |
download | fork-ledger-6ef755c1330c6e11476ea2e63b8388ad29efb4ef.tar.gz fork-ledger-6ef755c1330c6e11476ea2e63b8388ad29efb4ef.tar.bz2 fork-ledger-6ef755c1330c6e11476ea2e63b8388ad29efb4ef.zip |
Added support for assert, check and expr directives
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
; matching posting.
= /Food/
assert account("Expenses:Food").total >= $100
2010-06-12 Sample
Expenses:Food $100
Assets:Checking
; At file scope, the expression is evaluated with "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 middle 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
Diffstat (limited to 'src/account.cc')
0 files changed, 0 insertions, 0 deletions