A custom hledger script to check postings.
Clone this repository.
git clone git@github.com:aaditmshah/hledger-check-postings.git
Switch to the project directory.
cd hledger-check-postings
Build the executable.
cabal build
Install the executable.
cabal install
If you have set a $LEDGER_FILE
environment variable then you can simply run the program as follows.
hledger check-postings
This add-on command will check whether you have any postings which credit expense accounts or debit revenue accounts. Expense accounts should only be debited and revenue accounts should only be credited. Hence, if you credit an expense account or debit a revenue account then check-postings
flags the transaction and fails.