Commit Graph

2664 Commits

Author SHA1 Message Date
Stephen Morgan
31fdcdb8ef !imp: type: Change the default account inference for Cash accounts to only match
^assets?(:.+)?:(cash|bank|che(ck|que?)(ing)?|savings?|current)(:|$)

This should have no effect outside the cash report.

The rule for auto-detecting "Cash" (liquid assets) from account names
has changed in this release - see [Account types]. This is to simplify
how account types are detected and configured. If you use the cashflow
report without explicitly declaring accounts as Cash, you might notice a
change, and might need to add explicit account type: tags.
2022-02-03 15:32:00 -10:00
Stephen Morgan
2e4cfccf1b fix: types: Make sure type: query will correctly match subtypes, so
type:a will also match cash accounts, and type:e will also match
conversion accounts.
2022-02-03 15:32:00 -10:00
Stephen Morgan
73925ae965 fix: types: Ensure auto postings can match against and be matched by type: queries.
This requires checking parent accounts for any new accounts introduced by auto postings which do not exist in the original journal.

Also refactor journalFinalise to only call journalPostingsAddAccountTags once, and use fewer intermediate variables.
2022-02-03 15:32:00 -10:00
Stephen Morgan
a16c88b1b1 fix: Make sure cash and conversion account types are correctly
determined when there are no explicit declarations.
2022-02-03 15:32:00 -10:00
Simon Michael
4aa06d7920 ;doc: account types: edits 2022-02-02 17:40:47 -10:00
Simon Michael
b96b6c406e ;doc: account types: rewrite/expand 2022-02-02 17:15:39 -10:00
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
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
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
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
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
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
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
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
Stephen Morgan
f13ac2812f imp: smartdates: Simplify and generalise the SmartDate constructor and
parsers to allow for arbitrary numbers of periods in relative dates.

We now accept smart dates like “in 5 days, 5 weeks ahead, in -6 months, 2 quarters ago”.
2022-01-11 13:31:29 -10:00
Simon Michael
0e5ae2baac ;doc: update changelogs 2022-01-06 06:42:34 -10:00
Simon Michael
d82210cea9 ;doc: update changelogs 2022-01-05 18:09:23 -10:00
Simon Michael
757c548c17 ;doc: update changelogs 2022-01-05 08:12:44 -10:00
Simon Michael
d1bc3bbb32 ;doc: update changelogs 2022-01-01 15:55:08 -10:00
Simon Michael
326b2309bc ;doc: csv: tweak 2021-12-30 09:22:57 -10:00
Dmitry Astapov
ce54fb8ae9 ;roi: fixes #1791 (fix TWR when investment=0, several pnls per day) 2021-12-27 08:10:22 -10:00
Simon Michael
737ab13284 journal: doc updates for aliases corrupting account names (#1788) 2021-12-22 15:14:37 -10:00
Simon Michael
713f7eab65 journal: doc updates for aliases corrupting account names (#1788) 2021-12-22 15:08:01 -10:00
Simon Michael
9c173bc18b journal: tests/docs for aliases corrupting account names (#1788) 2021-12-22 14:59:13 -10:00
Simon Michael
cfee37ab36 ;doc: fix conversion & cost lists 2021-12-21 11:01:39 -10:00
Simon Michael
e92a266064 ;doc: update manuals 2021-12-21 10:55:05 -10:00
Simon Michael
d10f3df27b ;doc: fix conversion & cost depth 2021-12-21 10:54:47 -10:00
Simon Michael
4bf0d76a1f ;doc: update manuals 2021-12-21 10:53:19 -10:00
Simon Michael
82cd81c066 doc: new CONVERSION & COST section after #1554 2021-12-21 10:50:13 -10:00
Stephen Morgan
8eedbbbe87 imp: cost: Generate totally balanced conversion postings for amounts with costs.
Introduce --infer-equity option which will generate conversion postings.
--cost will override --infer-equity.

This means there will no longer be unbalanced transactions, but will be
offsetting conversion postings to balance things out. For example.

2000-01-01
  a   1 AAA @@ 2 BBB
  b  -2 BBB

When converting to cost, this is treated the same as before.
When used with --infer-equity, this is now treated as:

2000-01-01
  a                               1 AAA
  equity:conversion:AAA-BBB:AAA  -1 AAA
  equity:conversion:AAA-BBB:BBB   2 BBB
  b                              -2 BBB

There is a new account type, Conversion/V, which is a subtype of Equity/E.
The first account declared with this type, if any, is used as the base account
for inferred equity postings in conversion transactions, overriding the default
"equity:conversion".

API changes:

Costing has been changed to ConversionOp with three options:
NoConversionOp, ToCost, and InferEquity.
The first correspond to the previous NoCost and Cost options, while the
third corresponds to the --infer-equity flag.  This converts transactions with costs
(one or more transaction prices) to transactions with equity:conversion postings.
It is in ConversionOp because converting to cost with -B/--cost and inferring conversion
equity postings with --infer-equity are mutually exclusive.

Correspondingly, the cost_ record of ReportOpts has been changed to
conversionop_.

This also removes show_costs_ option in ReportOpts, as its functionality
has been replaced by the richer cost_ option.
2021-12-21 10:50:13 -10:00
Simon Michael
5561eeb8a4 ;doc: fix two unlinked urls 2021-12-17 10:00:19 -10:00
Simon Michael
c23808a163 ;doc: queries: fix "rewriting accounts" links 2021-12-15 11:14:01 -10:00
Simon Michael
45db32b84f ;doc: update changelogs 2021-12-10 12:50:21 -10:00
Simon Michael
a98e6125f1 ;doc: changelogs: 1.24.1 2021-12-10 12:47:43 -10:00
Simon Michael
1ef8f329c6 lib: simpler more robust version strings, with date/without patchlevel
We no longer rely on git tags and git describe output, since it's
hard to reliably select the correct tag eg for minor releases.
We might use them again in future for dev builds, but it requires
adding git describe --match support to githash. For now,

* Program name, OS and architecture are always shown.
* The package version is always shown.
* If there is git info at build time, the latest commit hash and commit date are shown.

Example outputs:
A homebrew binary, not built in git repo: hledger-ui 1.24, mac-aarch64
A CI release build, built in git repo:    hledger 1.24.1-g455b35293-20211210, mac-x86_64

API changes:

* new type synonyms ProgramName, PackageVersion, VersionString
* versionStringForProgname -> versionString with extra argument
* versionStringFor -> versionStringWith with extra argument
2021-12-10 12:42:40 -10:00
Simon Michael
1a646cd092 ;doc: changelogs: 1.24.1 2021-12-09 14:52:23 -10:00
Simon Michael
f111274f25 ;doc: update changelogs 2021-12-09 14:25:42 -10:00
Simon Michael
e532b7be49 ;doc: update manuals 2021-12-09 14:03:58 -10:00
Simon Michael
d1a0d37bd1 fix: bal: --declared now respects not:ACCT (fix #1783) 2021-12-09 12:58:22 -10:00
Simon Michael
08b72ae9f7 dev: bal: note yet another --declared issue 2021-12-08 18:21:32 -10:00
Simon Michael
2e79e53f12 ;dev: bal: note possible --declared issue 2021-12-08 18:14:23 -10:00
Simon Michael
e76cb1ae8c ;doc: csv: note hyphenated field names, fix formatting 2021-12-08 09:55:06 -10:00
Simon Michael
9c1c7aca83 ;doc: csv: mention disabling of digit group marks in csv output (#1771) 2021-12-06 15:23:35 -10:00
Stephen Morgan
c4004fca28 imp: csv: Do not display thousands separators when outputting csv. 2021-12-06 15:17:46 -10:00
Simon Michael
76b5c5f2ac ;doc: update manuals 2021-12-06 15:04:17 -10:00
Simon Michael
763d171108 ;doc: update CLI usage texts 2021-12-06 15:04:07 -10:00
Simon Michael
4d6f1ed0bf ;doc: bal: update tidy description, example 2021-12-06 15:03:40 -10:00
Simon Michael
ca44e092fd ;doc: update manuals 2021-12-06 14:50:49 -10:00
Simon Michael
5c597750fb ;doc: update CLI usage texts 2021-12-06 14:50:43 -10:00
Simon Michael
872bce55ef ;doc: bal: mention tidy's disabling of totals/averages (#1773, #1775) 2021-12-06 14:49:59 -10:00
Stephen Morgan
29ee0c331f imp: csv: Ignore --row-totals with tidy csv output. 2021-12-06 14:43:43 -10:00
Stephen Morgan
fb0472e0e9 imp: csv: Handle --layout=tidy with the legacy balance report.
Note that this gives output compatible with the multi balance report,
which means it is different from the csv with the legacy balance report.
This means tools only need to be able to handle one tidy csv format.
2021-12-06 13:49:01 -10:00
Stephen Morgan
71646f993c imp: csv: Include the start and end dates of intervals, as well as
string representation of the period, in tidy csv output, and never
include row totals or averages.
2021-12-06 13:49:01 -10:00
Simon Michael
35c1c9b6a2 pkg: progress towards supporting GHC 9.2 and newer libs (#1774)
hledger-lib builds, hledger's deps don't (shakespeare).
2021-12-06 12:32:50 -10:00
Simon Michael
642102e291 ;doc: update manuals 2021-12-05 16:34:01 -10:00
Simon Michael
ca0d9e2a0e ;doc: update CLI usage texts 2021-12-05 16:34:01 -10:00
Simon Michael
c250be1bb9 ;doc: bal: document tidy; commodity -> data layout (#1768) 2021-12-05 16:33:56 -10:00
Stephen Morgan
e42120da26 ;test: Rename commodity-column.test to layout.test, and replace
--commodity-column with --layout=bare in tests.
2021-12-05 16:06:44 -10:00
Stephen Morgan
7ccf7430d0 imp: csv: Allow for generating tidy csv with --layout=tidy.
This puts every date in a separate row, which is more suitable for
many graphing programs.
2021-12-05 16:06:44 -10:00
Stephen Morgan
3884f90cc6 lib!: Rename CommodityLayout to Layout and rename constructors.
Their scope is more than just commodities.
2021-12-05 16:06:44 -10:00
Simon Michael
6ce70351fd ;doc: cli, bal: improve table layout in non-html docs 2021-12-05 12:27:20 -10:00
Simon Michael
e5b924c390 ;doc: update manuals 2021-12-05 12:25:49 -10:00
Simon Michael
ee9894f59e ;doc: update CLI usage texts 2021-12-05 12:25:44 -10:00
Simon Michael
08f95d051e ;doc: update manuals 2021-12-05 11:23:18 -10:00
Simon Michael
7b9cad6cdc ;doc: update CLI usage texts 2021-12-05 11:23:11 -10:00
Simon Michael
76f8ed1514 ;doc: cli, bal: clarify output formats, layouts more 2021-12-05 11:23:00 -10:00
Simon Michael
2a58331024 ;doc: update manuals 2021-12-05 10:56:41 -10:00
Simon Michael
fdc373f45c ;doc: update CLI usage texts 2021-12-05 10:56:38 -10:00
Simon Michael
371539e085 ;doc: bal: clarify --layout a little 2021-12-05 10:56:17 -10:00
Simon Michael
1ba25f9714 ;doc: cli: document which commands support which output formats 2021-12-05 10:24:24 -10:00
Simon Michael
ce3ec28e3d ;cabal: update cabal files 2021-12-01 22:16:37 -10:00
Simon Michael
66619803b7 ;pkg: bump version to 1.24.99 2021-12-01 22:16:37 -10:00
Simon Michael
5648db0fd5 doc: update manuals 2021-12-01 20:59:33 -10:00
Simon Michael
2382fe5db8 ;doc: finalise changelogs 2021-12-01 18:23:16 -10:00
Simon Michael
0c4b820111 ;cabal: update cabal files 2021-12-01 17:16:28 -10:00
Simon Michael
387325b59e ;pkg: bump version to 1.24 2021-12-01 17:16:28 -10:00
Simon Michael
1d3f7a2aad ;doc: update manuals 2021-12-01 17:16:04 -10:00
Simon Michael
55f5aa9238 ;doc: changelog edits 2021-11-26 21:06:52 -10:00
Simon Michael
4933b9fc45 ;doc: draft changelogs 2021-11-26 12:02:36 -10:00
Simon Michael
cda693a94f imp: stats: run time and throughput on one line 2021-11-26 07:13:20 -10:00
Simon Michael
791f4655df ;doc: update manuals 2021-11-26 05:58:55 -10:00
Simon Michael
308c554603 ;doc: update CLI usage texts 2021-11-26 05:57:12 -10:00
Simon Michael
aba46874f2 ;dev: is: code notes 2021-11-25 11:55:58 -10:00
Simon Michael
4504c173fb ;cln: clarify #1698 test 2021-11-25 11:55:58 -10:00
Simon Michael
7f320ebfa9 imp: balcmds: support --declared on bs/cf/is also (#1765) 2021-11-25 11:55:58 -10:00
Simon Michael
6319d6148f feat: bal: with --declared, include declared leaf accounts (#1765)
Together with -E, this shows a balance for both used and declared
accounts (excluding empty parent accounts, which are usually not
wanted in list-mode reports).

This is somewhat consistent with --declared in the accounts and payees
commands, except for the leaf account restriction.

The idea of this is to be able to see a useful "complete" balance
report, even when you don't have transactions in all of your declared
accounts yet. I mainly want this for hledger-ui, but there's no harm
in exposing it in the balance CLI as well.
2021-11-23 09:47:04 -10:00
Simon Michael
94d92b9760 Revert "feat: bal: with --declared, include all declared accounts (#1765)"
This reverts commit a5e19b7391.
(It breaks filtering by account.)
2021-11-22 12:06:23 -10:00
Simon Michael
a5e19b7391
feat: bal: with --declared, include all declared accounts (#1765)
Together with -E, this allows showing a balance for all accounts, both
used and declared. I mainly want this for hledger-ui, but there's no
harm in exposing it in the balance command as well. This is somewhat
consistent with the accounts and payees commands.
2021-11-22 11:08:33 -10:00
Simon Michael
45da9bb594 bal: fix bcexample test 2021-11-22 10:14:37 -10:00
Simon Michael
6e3695c317 ;dev: commodities: note todo 2021-11-22 09:59:49 -10:00
Simon Michael
af4d269215 ;imp: doc: account types: prioritise short names, hide old syntax 2021-11-22 08:25:53 -10:00
Simon Michael
3763b50ff2 imp: doc: directives: tweak 2021-11-21 23:53:44 -10:00
Simon Michael
df472b6cc5 ;doc: update manuals 2021-11-21 23:52:17 -10:00
Simon Michael
508b180b63 imp: doc: directives: tweak 2021-11-21 23:52:05 -10:00
Simon Michael
1d0fa5a96b ;doc: update manuals 2021-11-21 23:44:35 -10:00
Simon Michael
f6b10df50b imp: doc: directives: tweak 2021-11-21 23:44:19 -10:00
Simon Michael
14aa047e08 ;doc: update manuals 2021-11-21 23:33:44 -10:00
Simon Michael
1c388f0350 imp: doc: directives: tweak 2021-11-21 23:32:08 -10:00
Simon Michael
73d3cafbae ;doc: update manuals 2021-11-21 23:24:43 -10:00
Simon Michael
321a9195aa imp: doc: directives: tweak 2021-11-21 23:24:36 -10:00
Simon Michael
7b59821378 ;doc: update manuals 2021-11-21 23:06:55 -10:00
Simon Michael
6225db6b36 imp: doc: directives ends-at-file-end column 2021-11-21 23:06:45 -10:00
Simon Michael
c7cc1caca0 ;doc: update manuals 2021-11-21 22:41:52 -10:00
Simon Michael
d8205306dc imp: doc: more compact/accurate directives overview 2021-11-21 22:41:02 -10:00
Simon Michael
e0dc028374 ;doc: update manuals 2021-11-20 22:07:45 -10:00
Simon Michael
066a67ad09 ;doc: update CLI usage texts 2021-11-20 22:07:40 -10:00
Simon Michael
c709a22c64 imp: stats: also show run time and throughput
CliOpts has a new field, progstarttime_.

Currently the new stats are always printed on stdout, ignoring --output-file/--output-format.
2021-11-20 20:51:21 -10:00
Stephen Morgan
186995fc8b fix: balance: Balance reports with --depth=0 should report on true
values, not zero everywhere. (#1761)
2021-11-20 15:47:57 -10:00
Simon Michael
568b39734b ;doc: update manuals 2021-11-18 22:48:14 -10:00
Simon Michael
20d8f9f7e2 ;doc: bal: fix list formatting 2021-11-18 22:30:03 -10:00
Simon Michael
678d3b0a06 ;doc: bal: fix link 2021-11-18 22:28:42 -10:00
Simon Michael
cf15dbd7c9 ;doc: update manuals 2021-11-18 22:26:10 -10:00
Simon Michael
be5e6e4167 ;doc: update CLI usage texts 2021-11-18 22:24:59 -10:00
Simon Michael
7ba9a4d06b feat: docs for decimal-mark (#1670, #1726) 2021-11-18 22:17:07 -10:00
Lawrence
fb817ffa55 imp: journal: support decimal-mark directive in journal files
To match csv-rule and override amount-style as described in
https://github.com/simonmichael/hledger/issues/1670
2021-11-18 22:17:07 -10:00
Simon Michael
66b969a74c ;imp: bal --layout: streamline help more (#1751) 2021-11-18 21:27:47 -10:00
Stephen Morgan
4b6fe2c0bd ;doc: balance: Update docs to mention --layout. 2021-11-18 21:26:02 -10:00
Stephen Morgan
d82416b7b9 imp: balance: Add single-line display with elision back in, this time
with a separate option --layout=wide,WIDTH.
2021-11-18 21:26:02 -10:00
Stephen Morgan
8f1ae08f0a test: balance: Add tests for --layout options. 2021-11-18 21:26:02 -10:00
Stephen Morgan
de2776c996 imp!: balance: Stop eliding long amounts. (#1739)
This feature has caused a lot of confusion, and we now have better ways
of making sure columns don't get too wide.
2021-11-18 21:26:02 -10:00
Stephen Morgan
7e21f05a83 imp: balance: Implement multi-line display for multicommodity balance reports.
This allows more control over how multicommodity amounts are displayed.
In addition to the default single-line display, and the recent commodity
column display, we now have multi-line display. This is controlled by
the --layout option, which has possible values "wide", "tall", and
"bare". The --commodity-column option has been hidden, but is equivalent
to --layout=bare.

squash
2021-11-18 21:26:02 -10:00
Stephen Morgan
3dce61ea09 fix: prices: Do not try to generate prices when there would be a zero
denominator.

Also correctly generate reverse prices for zero amounts.
2021-11-18 20:59:52 -10:00
Stephen Morgan
87a7a586d4 fix: csv: Handle multiple zero amounts in postings in csv files. (#1733) 2021-11-18 20:48:55 -10:00
Stephen Morgan
f345fd0b78 imp: balance: Allow --related flag for balance reports. (#1469) 2021-11-08 14:03:50 -10:00
Stephen Morgan
7597e525a3 fix: balance: Balance reports should consider date: queries when calculating
report span with --date2. (#1745)
2021-11-06 08:51:53 -10:00
Stephen Morgan
9d5397deb6 fix: print: auto: The print command should always display inferred
amounts for --auto generated postings. (#1276)
2021-10-31 09:42:58 -10:00
Stephen Morgan
1bc04685b7 pkg: Drop base-compat-batteries dependency.
Our supported stackage versions are now new enough that we don't need
any of the compatibility features anymore.
2021-10-31 07:56:07 -10:00
Dmitry Astapov
4b1919de02 fix: roi: use posting dates when available, honor --date2
This will not change the results computed for the typical use-case,
just makes "roi" more thorough/consistent by supporting posting dates
when they are provided.
2021-10-11 11:22:46 -10:00
Simon Michael
e4263e69e1 areg: begin respecting --date2: show txns' date2 (#1731) 2021-10-10 10:34:45 -10:00
Simon Michael
7af2e79465 ;cabal: update cabal files 2021-10-03 22:56:02 -10:00
Simon Michael
69905dbc25 ;pkg: allow megaparsec 9.2 2021-10-03 22:55:10 -10:00
Stephen Morgan
94d9c28a63 cln: Replace all uses of deprecated !include with include.
Also include a test which makes sure !include is still parsed.
2021-09-27 15:04:35 -10:00
Stephen Morgan
5aadcdea4d ref: Add new helper functions journalValueAndFilterPostings(With)?.
Combining valuation with filtration is subtle and error-prone (see e.g. #1625).
We have to do in in both MultiBalanceReport and PostingsReport, where it
is done in slightly different ways. This refactors this functionality
into separate functions which are called in both reports, for uniform
behaviour.
2021-09-26 08:13:12 -10:00
Simon Michael
a6d70024d2
Merge pull request #1715
;doc: Document restriction on amountless auto postings.
2021-09-26 08:10:18 -10:00
Simon Michael
b857307f64 ;cabal: update cabal files 2021-09-24 12:22:15 -10:00
Simon Michael
8934c115bd ;pkg: bump version to 1.23.99 2021-09-24 12:22:15 -10:00
Stephen Morgan
ce4fcfae84 imp!: value: For register reports with no reporting interval and
--value=end, historical reports should be valued at journal/report end
date.
2021-09-24 11:32:41 -10:00
Stephen Morgan
465a5cf917 imp: cli: Allow general optional argument flags (--pretty and
--forecast) to be moved after the subcommand name.
2021-09-22 12:11:44 -10:00
Stephen Morgan
494b14510b ;doc: Document restriction on amountless auto postings. 2021-09-22 13:21:53 +10:00
Simon Michael
e90fa3ee81 doc: changelogs: cleanup, finalise 2021-09-21 17:15:39 -10:00
Simon Michael
416555b65a doc: update manuals 2021-09-21 17:15:39 -10:00
Simon Michael
1b020e004b ;cabal: update cabal files 2021-09-21 15:34:23 -10:00
Simon Michael
19950df745 ;pkg: bump version to 1.23 2021-09-21 15:34:23 -10:00
Stephen Morgan
afdeb404b0 fix: colour: NO_COLOR flag no longer overrides an explicit --color option. (#1710)
http://no-color.org/ specifies that command line arguments should
override a NO_COLOR flag.
2021-09-21 15:32:53 -10:00
Stephen Morgan
bf3e82f780 imp: pretty: Replace --pretty-tables argument with --pretty=WHEN
argument, which takes yes or no. Default is no for now.
2021-09-21 14:53:52 -10:00
Simon Michael
fbccd7b7ca ;doc: changelogs: tweaks 2021-09-20 18:07:57 -10:00
Simon Michael
17a12f0411 ;doc: changelogs: tweak 2021-09-20 18:01:09 -10:00
Simon Michael
bb4f2ff34f ;doc: update changelogs 2021-09-20 17:58:29 -10:00
Simon Michael
9cae7a076a ;doc: update manuals 2021-09-20 16:56:36 -10:00
Simon Michael
44d494af07 ;doc: update CLI usage texts 2021-09-20 16:55:22 -10:00
Stephen Morgan
378df77001 cln: Remove unnecessary normaliseMixedAmount(SquashPricesForDisplay)? functions. 2021-09-20 14:49:34 -10:00
Arjen Langebaerd
c0fd79a40e fix: extend application of commodity style to prices (except precision) and make --commodity-style a general flag 2021-09-20 08:55:55 -10:00
Stephen Morgan
4cfd3cb590 lib!: Remove GenericSourcePos, and replace it with either SourcePos or
(SourcePos, SourcePos).

This has been marked for possible removal for a while. We are keeping
strictly more information. Possible edge cases arise with Timeclock and
CsvReader, but I think these are covered.

The particular motivation for getting rid of this is that
GenericSourcePos is creating some awkward import considerations for
little gain. Removing this enables some flattening of the module
dependency tree.
2021-09-20 08:38:33 -10:00
Stephen Morgan
8a6d824900 imp: csv: sql: Use . as a decimal point in sql output for Print command. 2021-09-18 14:32:21 -10:00
Malte Brandy
e31eb58ada lib: Allow multiline comments in csv rules 2021-09-18 12:43:49 -10:00
Simon Michael
b79a8473f7 ;doc: update manuals 2021-09-18 12:16:09 -10:00
Simon Michael
9dca1dc7b6 imp: prices: use --infer-market-prices instead of --costs
This command now reuses the --infer-market-prices flag, and uses
a new --infer-reverse-prices flag, instead of the old
--costs and --inverted-costs flags, which are now deprecated and hidden.
2021-09-18 12:12:31 -10:00
Simon Michael
326d6e8dae ref: ReportOptions{infer_value_} renamed to infer_prices_
For more consistency with the flag name (--infer-market-prices).
And BalancingOpts{infer_prices_} is now infer_transaction_prices_.
2021-09-18 12:12:31 -10:00
Simon Michael
daa9fddec9 imp: cli: --infer-market-price renamed to --infer-market-prices
It was too easy to get this wrong, even some of the docs did.
Now either plural or singular spelling works
(since we accept flag prefixes).
2021-09-18 12:12:31 -10:00
Simon Michael
c784cf4a38 imp: cli: hide the old --infer-value flag spelling
Hide this deprecated legacy flag, and also leave more width for flag descriptions in --help.
2021-09-18 12:12:31 -10:00
Simon Michael
993e381307 ;doc: update manuals 2021-09-18 11:24:52 -10:00
Simon Michael
633af61b2e imp: cli: move --today to reportflags (#1674) 2021-09-18 11:24:27 -10:00
Simon Michael
8a4cea2a69 ;doc: update manuals 2021-09-17 17:58:10 -10:00
Stephen Morgan
62351dd329 fix: bal: Make sure boring parent accounts in compound balance reports
include historical postings when account declarations have undeclared
parents. (#1698)
2021-09-17 15:24:19 -10:00
Malte Brandy
724c84fe50 ;doc: Convert some plain urls to links 2021-09-16 07:06:08 -10:00
Stephen Morgan
54f2600db2 imp: cli: Let --today option handle smart dates, determined relative to
the current date.
2021-09-10 10:40:50 -10:00
Simon Michael
7a249cffe9 ;doc: update manuals 2021-09-09 14:45:01 -10:00
Simon Michael
ddec2cedf3 ;doc: update CLI usage texts 2021-09-09 14:44:09 -10:00
Stephen Morgan
c0053cb9ba doc: Document --today in the manual. 2021-09-09 14:40:39 -10:00
Stephen Morgan
6905e40c4d pkg!: cli: Add --today option to explicitly set the current date. (#1674)
rawOptsTo* in hledger-lib now takes a day as an argument, and does not
live in the IO monad, since it's now pure.

This is so that we can run tests containing future transactions that
won't fail as soon as ‘the future’ actually arrives.
2021-09-09 14:40:39 -10:00
Stephen Morgan
50f73b7434 fix: balance: Show all empty accounts in flat balance reports. (#1688)
Previously we only showed empty leaves.
2021-09-08 18:17:27 -10:00
Simon Michael
db45b13249 test: more detailed commodity directive tests 2021-09-07 10:19:01 -10:00