Commit Graph

10719 Commits

Author SHA1 Message Date
Simon Michael
807717805a feat: accounts: --types shows account types (#1820) 2022-02-01 18:06:19 -10:00
Simon Michael
dbbd300aa2 ;dev: accounts: test cleanup 2022-02-01 18:03:46 -10:00
Simon Michael
0f8ede3038 ;doc: document how aliases can break account types (#1820) 2022-02-01 14:47:30 -10:00
Simon Michael
cb040dbe29 imp: type: forgot the tests 2022-01-31 16:44:13 -10:00
Simon Michael
336c4a7b33 imp: cleaner error messages when parsing cli (less "user error") 2022-01-31 16:44:13 -10:00
Simon Michael
a22068a556 imp: better error messages for type:'s argument 2022-01-31 16:44:13 -10:00
Simon Michael
9c872c2d9c imp: areg: clearer, more consistent error messages 2022-01-31 16:44:13 -10:00
Simon Michael
45127dc5f5 feat: new type: query for easy matching by account type
type:TYPES, where TYPES is any of the (case insensitive) letters
ALERXCV, matches accounts by their declared or inferred type.
(See https://hledger.org/hledger.html#account-types.)
This should work with most commands, eg:

    hledger bal type:al
    hledger reg type:x

API changes:

Journal has a new jaccounttypes map.
The journalAccountType lookup function makes it easy to check an account's type.
The journalTags and journalInheritedTags functions look up an account's tags.
Functions like journalFilterPostings and journalFilterTransactions,
and new matching functions matchesAccountExtra, matchesPostingExtra
and matchesTransactionExtra, use these to allow more powerful matching
that is aware of account types and tags.
2022-01-31 16:44:13 -10:00
Simon Michael
885a4fcfec ref: journalFinalise: clarify sequence, top to bottom 2022-01-31 16:44:13 -10:00
Stephen Morgan
91441bad8f test: Make sure --today is passed to --forecast tests so they keep
working.
2022-01-31 15:12:04 -10:00
Simon Michael
248ddf9378 dev: more thorough Journal anonymisation, and a note (#1817) 2022-01-30 09:47:52 -10:00
Simon Michael
3472c3cb6d ;dev: number anon tests 2022-01-30 09:47:52 -10:00
Simon Michael
3d57fa32c2 ;doc: querying by tags, on accounts and generally (#1817) 2022-01-30 09:47:52 -10:00
Simon Michael
56be63e6f1 feat: queries can now match account tags (#1817)
Accounts, postings, and transactions can now all be filtered by the
tags in an account's declaration. In particular it's now possible to
more reliably select accounts by type, using their type: tag rather
than their name:

    account myasset       ; type:Asset
    account myliability   ; type:Liability

    $ hledger accounts tag:type=^a
    myasset

Accounts inherit tags from their parents.

API changes:
A finalised Journal has a new jdeclaredaccounttags field
for easy lookup of account tags.
Query.matchesTaggedAccount is a tag-aware version of matchesAccount.
2022-01-30 09:47:52 -10:00
Simon Michael
2f48307c63 dev: query-tag.test -> format 3 2022-01-30 09:47:52 -10:00
Simon Michael
4ed80d4069 ;doc: update journalFinalise haddock 2022-01-30 09:47:52 -10:00
Stephen Morgan
df4949ad1a imp!: journal: Remove deprecated account type code syntax from account
directives.

Previously, you declare an account type with the following format:
account assets  A
This has been deprecated since 1.13, and should now be declared with one
of:
account assets  ; type:A
account assets  ; type:asset
2022-01-28 12:38:38 -10:00
Simon Michael
929f13ec03 fix: warning (#1799) 2022-01-26 09:00:40 -10:00
Simon Michael
27b6e1d111 imp: nicer invalid balance assignment errors (tweak) 2022-01-26 08:59:19 -10:00
Stephen Morgan
bcaa6ac3c8 test: Run all tests with --fast compilation, not just functests. 2022-01-26 08:10:59 -10:00
Stephen Morgan
1d9be4c2de cln: print, close: Check the show_costs_ option instead of directly
checking the --show-costs flag.
2022-01-26 08:07:11 -10:00
Stephen Morgan
ba0eec9132 ref: Return the interval split in reportSpan, to reduce the number
of different places we call splitSpan and ease refactoring.
2022-01-26 08:05:37 -10:00
Stephen Morgan
e33de3585b ref: Clean up splitSpan, to make the logic clearer and more extensible.
Previously the helper functions splitspan and splitspan' would calculate
each span from the start point of the previous span. This meant we had
to be very careful not to lose any relevant information (e.g. what day
of the week it was) about the original start date. We now calculate each
span from the original start date, so there's no risk of losing
information. This simplifies many of the calculations.
2022-01-26 08:05:37 -10:00
Stephen Morgan
ea51a87bd0 cln: Remove under-used maybePeriod, which is only used as a stand-in for
Just . parsePeriodExpr' in tests.
2022-01-26 08:05:37 -10:00
Stephen Morgan
43b7e849c7 cln: Remove some explicit Text packing. 2022-01-26 08:05:37 -10:00
Stephen Morgan
2a51b6e9a4 fix: layout: Commodity symbols should be omitted in --layout=bare when
all amounts are zero. (#1789)
2022-01-26 07:58:14 -10:00
Stephen Morgan
55a022a941 fix: strict: Make sure forecast transactions and auto postings are
checked with --strict. (#1810)
2022-01-26 07:57:13 -10:00
Patrik Keller
2cf4c221de Manual: clarify reference from --strict to check 2022-01-26 07:45:13 -10:00
Simon Michael
e16fa51dd5 imp: nicer invalid balance assignment errors (fix tests) 2022-01-21 17:45:23 -10:00
Simon Michael
30080a9aa1 imp: nicer invalid balance assignment errors 2022-01-21 17:33:19 -10:00
Simon Michael
3135753e94 tools: make: clean up stack command defs 2022-01-21 17:33:19 -10:00
Simon Michael
5ca5f2f875 stack: bump to ghc 9.0.2, with mac m1 workaround 2022-01-21 17:33:19 -10:00
Stephen Morgan
8cd9e81c34 fix: budget: Make sure boring parents of unbudgeted accounts are not
elided if they have a budget. (#1800)

This only affects calls with --budget and -E, but not with --no-elide.
2022-01-21 09:11:04 -10:00
Simon Michael
d9b0184720 ;doc: changeslogs: edit 2022-01-21 08:38:59 -10:00
Simon Michael
41b68714ff ;doc: update manuals 2022-01-21 08:32:29 -10:00
Simon Michael
fbf826a813 ;doc: update CLI usage texts 2022-01-21 08:32:29 -10:00
Simon Michael
8daef36c29 ;doc: update changelogs 2022-01-21 08:32:29 -10:00
Simon Michael
1716a3e55c ;doc: roi: dear lord fix links again 2022-01-21 08:20:05 -10:00
Simon Michael
209a726e26 ;doc: roi: make links useful in plain text docs
And update how-to url.
2022-01-21 08:17:55 -10:00
Simon Michael
beeb7b157c ;doc: roi: fix link 2022-01-21 08:13:26 -10:00
Simon Michael
bf2ac4f18b ;doc: roi: formatting 2022-01-21 08:13:26 -10:00
Simon Michael
f36ab179c4 ;doc: add interim note re ConversionOp (#1808) 2022-01-16 18:43:40 -10:00
Stephen Morgan
57d055b643 fix: cost: Add inferred equity postings during journal finalisation, so
they can be matched by queries.
2022-01-16 18:37:18 -10:00
Simon Michael
f7a3f510be ;doc: describe no-symbol commodity checking (#1772) 2022-01-16 08:24:30 -10:00
Stephen Morgan
5006e26995 imp: check: Do not check commodities for zero amounts with empty
commodity. (#1767)
2022-01-16 08:11:02 -10:00
Simon Michael
dbcd235f9e ;doc: update manuals 2022-01-15 08:56:45 -10:00
Simon Michael
6e12be15df ;doc: update CLI usage texts 2022-01-15 08:56:45 -10:00
Simon Michael
9444e20c3d ;doc: update changelogs 2022-01-15 08:56:45 -10:00
Simon Michael
fb834777a6 ;fix: doc: update help/help-feedback links (#1807) 2022-01-15 08:53:48 -10:00
Simon Michael
f511aaf3b3 stack: note 9.0.2 blocker 2022-01-14 09:32:37 -10:00