On Jun 24, 2010, at 5:49 AM, ed wrote:

> Firstly ensuring that account names are spelt correctly (pre-declaring
> valid account names I guess).

The --strict option will warn you if an uncleared transaction contains a
never-before-seen account name.  Cleared transactions are assumed to be
correct -- since you cleared them.

> Second is declaring pairs of accounts between which transfers could
> validly occur, so that e.g money could not be transferred from a
> contingency account to the director's loan account.

You can do this with the "check" keyword and an automated transaction:

  = /Checking/
    check account =~ /Expense/

  2010-06-24 Sample
    Expenses:Food    $100
    Assets:Checking

Use "assert" instead of "check" if you want it to be an error.

> Third the imposition of sanity limits on transaction amounts, e.g.
> flag anything > £5000

Again, using an automated check:

  = true
    check abs(amount) < 5000

By comparing the amount to an integer, it ignores the commodity and only
compares the magnitude.

NOTE: Be sparing with how many automated transactions you create.  Each one
must be evaluated for every posting in your file, so the amount of time required
is N*Y, where N is the number of postings and Y is the number of automated
transactions.

John

Reply via email to