Exclude Fixed Assets from Cashflow Report

Add "fixed" to the regex used to exclude asset accounts from cashflow
reports.  Assumes accounts are set up something like:
assets:fixed assets:equipment
assets:fixed assets:vehicles
assets:fixed assets:buildings
This commit is contained in:
Christian G. Warden 2017-07-13 06:57:57 -07:00 committed by Simon Michael
parent 6b6e185827
commit deaf9cfbef
2 changed files with 23 additions and 2 deletions

View File

@ -293,9 +293,9 @@ journalEquityAccountQuery _ = Acct "^equity(:|$)"
-- | A query for Cash (-equivalent) accounts in this journal (ie,
-- accounts which appear on the cashflow statement.) This is currently
-- hard-coded to be all the Asset accounts except for those containing the
-- case-insensitive regex @(receivable|A/R)@.
-- case-insensitive regex @(receivable|A/R|fixed)@.
journalCashAccountQuery :: Journal -> Query
journalCashAccountQuery j = And [journalAssetAccountQuery j, Not $ Acct "(receivable|A/R)"]
journalCashAccountQuery j = And [journalAssetAccountQuery j, Not $ Acct "(receivable|A/R|fixed)"]
-- Various kinds of filtering on journals. We do it differently depending
-- on the command.

View File

@ -239,3 +239,24 @@ Cashflow Statement
>>>2
>>>= 0
# 12. exclude fixed assets from cashflow
hledger -f - cashflow
<<<
2016/1/1
assets 1
b
2016/1/1
assets:fixed assets:equipment 1
b
>>>
Cashflow Statement
Cash flows:
1 assets
--------------------
1
>>>2
>>>= 0