Commit Graph

2305 Commits

Author SHA1 Message Date
Arjen Langebaerd
3426030a91 feat: added commodity style commandline option 2021-08-17 22:05:29 -10:00
Simon Michael
b4c516c074 ;doc: period expressions: tweak 2021-08-17 09:17:15 -10:00
Simon Michael
881785c374 ;doc: period expressions: tweak 2021-08-17 09:00:55 -10:00
Simon Michael
7bfed72130 ;doc: period expressions: consistent layout 2021-08-17 08:58:44 -10:00
Simon Michael
1874a971dc ;doc: clarify period expressions, report intervals 2021-08-17 08:54:34 -10:00
Simon Michael
b74aa78345 ;help: doc: clarify 2021-08-08 10:15:21 -10:00
Simon Michael
b43a5263cb ;doc: update manuals 2021-08-08 10:07:44 -10:00
Simon Michael
bfa2ac1dcf ;doc: update CLI usage texts 2021-08-08 10:07:01 -10:00
Simon Michael
9bef817db0 ;bal: doc: --commodity-column: fix link (#1626) 2021-08-08 10:04:52 -10:00
Simon Michael
ca474a8687 ;bal: doc: --commodity-column: fix csv example (#1626)
and make examples reproducible, why not.
2021-08-08 10:02:23 -10:00
Simon Michael
d06d4ca080 ;doc: update manuals 2021-08-08 09:39:20 -10:00
Simon Michael
04812682e8 ;doc: bump man page dates 2021-08-08 09:39:20 -10:00
Simon Michael
bf2e9f24b8 ;doc: update CLI usage texts 2021-08-08 09:39:20 -10:00
Simon Michael
30ea463060 imp: bal: doc: --commodity-column tweaks (#1626)
- promote the heading one level
- periodic CSV reports are supported too
- slight edits to manual and flag description
2021-08-08 09:39:09 -10:00
Lawrence
1be74a01ce fix: bal: handle oneline for custom format correctly
Previously would not actually display anything since the Cell's
WideBuilders are single-element list. Just dispatch to showMixedAmountB
to do the right thing.
2021-08-08 09:19:25 -10:00
Lawrence
234caae557 doc: test: update for commodity-column
Add documentation and sample output for `--commodity-column` behavior
and functional tests e.g single-period balance, yearly balance, and
yearly budget
2021-08-08 09:19:25 -10:00
Lawrence Wu
f3c07144a8 bal: option to view one commodity per row
This adds the `--commodity-column` option that displays each commodity
on a separate line and the commodities themselves as a separate column.
The initial design considerations are at
simonmichael.hledger.issues.1559

The single-period balance report with `--commodity-column` does not
interoperate with custom formats.
2021-08-08 09:19:25 -10:00
Stephen Morgan
720fde3187 test: Add forecast transactions to aregister ordering test. 2021-08-07 14:15:19 -10:00
Simon Michael
233b8c91cb ;doc: finalise 1.22.2 changelogs 2021-08-07 09:27:20 -10:00
Simon Michael
2e28c5a1ef ;doc: update changelogs 2021-08-07 09:20:20 -10:00
Simon Michael
9bc77f87fc ;doc: changelogs 2021-08-06 17:26:37 -10:00
Simon Michael
981849a6c1 ;doc: changelogs 2021-08-06 00:16:20 -10:00
Simon Michael
49ff039312 lib: cli/ui/web: clarify version string code
version -> packageversion
versiondescription -> versionStringFor
2021-08-05 22:54:25 -10:00
Simon Michael
53f02c7b3d ;cabal: update cabal files 2021-08-05 22:04:38 -10:00
Simon Michael
33c5726a96 cli: require githash >=0.1.4.0, simplify version code 2021-08-05 22:04:20 -10:00
Simon Michael
606d992fc8 cli: disable no-longer-used --binary-filename flag
It was still supported (as a hidden flag) by hledger-web,
and now is not.
2021-08-05 21:51:10 -10:00
Simon Michael
1492fca8f1 cli: separate some version things 2021-08-05 21:49:17 -10:00
Stephen Morgan
918c243fa9 fix: forecast: Generate forecast transactions at journal finalisation,
rather than as a postprocessing step. (#1638)

This allows us to have a uniform procedure for balancing transactions,
whether they are normal transactions or forecast transactions, including
dealing with balance assignments, balance assertions, and auto postings.
2021-08-05 21:10:47 -10:00
Stephen Morgan
c404800fbf ref!: forecast: Move forecast_ from ReportOpts to InputOpts. 2021-08-05 21:10:47 -10:00
Stephen Morgan
23b0cad6ef fix: areg: Make sure aregister sorts first by transaction register date,
then by parse order to break any ties. (#1642)
2021-08-05 20:49:25 -10:00
Simon Michael
3270a4f0d7 ;areg: commented test for #1642 2021-08-05 19:08:21 -10:00
Simon Michael
d6504fef37 ;doc: timedot: rewrite 2021-08-04 19:21:51 -10:00
Simon Michael
6afc5ce6b2 ;cabal: update cabal files 2021-08-03 21:05:29 -10:00
Simon Michael
f51ea92cfc deps: require base >=4.11, prevent red squares on hackage matrix
We officially support GHC 8.6+ (and 8.8+ for hledger-web) now.
Hackage matrix builder shows all packages building successfully
with GHC 8.4+, somehow, so we'll adjust the base bound to
allow that but prevent any attempts to build with older GHCs,
2021-08-03 21:05:02 -10:00
Simon Michael
2a39497e21 pkg: add tested-with GHC 9.0.1 2021-08-03 20:52:05 -10:00
Simon Michael
abd63db3e7 ;doc: update changelogs 2021-08-03 09:50:57 -10:00
Simon Michael
81dfbc9ac2 ;doc: changelogs: note some 1.22.1 changes I missed 2021-08-03 09:42:59 -10:00
Simon Michael
95de5a878a ;cabal: update cabal files 2021-08-03 08:00:22 -10:00
Simon Michael
6665ddfb9b ;pkg: bump version to 1.22.99 2021-08-03 00:24:20 -10:00
Simon Michael
d425ce8fd3 ;doc: changelogs: 1.22.1 release date 2021-08-02 22:50:03 -10:00
Stephen Morgan
ae3c7e8756 fix: areg: Make sure the true original transaction is made available in
AccountTransactionsReport.

Only a limited number of journal transformations are allowed in
accountTransactionReports due to the need to include the original
transaction. Document these.

Make sure to remove currency and amount queries from the reportq, so
they do not cause problems after valuation.

Avoid confusion by calculating transaction date at one point, and
passing that down with the transaction.
2021-08-02 22:47:50 -10:00
Stephen Morgan
4e0dcec096 fix: areg: Explicitly avoid filtering by depth queries, perform
valuation after all reportq filtering is done (in both the historical
and recent postings), and make sure filtering is done at the correct
point based on whether --txn-dates is set. (#1634)
2021-08-02 22:47:50 -10:00
Stephen Morgan
1d278993bc fix: forecast: Make sure forecast transactions are generated up to the day before the provided query end date. (#1633) 2021-08-02 20:47:20 -10:00
Simon Michael
1d0b2bf9ce ;doc: update changelogs 2021-08-01 08:05:05 -10:00
Simon Michael
d07d0de2d6 test: areg: disable failing tests for now (#1634) 2021-07-31 18:28:32 -10:00
Simon Michael
136c7ca704 doc: areg: clarify (#1634) 2021-07-31 18:27:23 -10:00
Simon Michael
396b1eb515 test: areg: add more tests (#1634) 2021-07-31 18:27:23 -10:00
Stephen Morgan
fc8aa602cf lib!: modifyTransactions now takes a Map of commodity styles, and will
style amounts according to that argument. journalAddForecast and
journalTransform now return an Either String Journal.

This improves efficiency, as we no longer have to restyle all amounts in
the journal after generating auto postings or periodic transactions.
Changing the return type of journalAddForecast and journalTransform
reduces partiality.

To get the previous behaviour for modifyTransaction, use modifyTransaction mempty.
2021-07-30 13:52:35 -10:00
Stephen Morgan
2da0e67141 fix: Add balancing amounts in periodic transactions before applying auto-postings. (#1412) 2021-07-30 13:52:35 -10:00
Simon Michael
aa60c46597 ;areg: doc: clarify 2021-07-30 09:09:59 -10:00
Stephen Morgan
9df574b3c0 fix: reg: register --related should not create duplicate postings when
more than one posting in a transaction matches. (#1629)
2021-07-30 09:06:27 -10:00
Stephen Morgan
6528f25593 fix: lib: Filter postings before performing valuation and costing in
MultiBalanceReport, PostingsReport, EntriesReport, and
AccountTransactionsReport. (#1625, #1630)
2021-07-30 09:06:27 -10:00
Simon Michael
4451d68a63 ;doc: update manuals 2021-07-29 20:41:19 -10:00
Simon Michael
085b7d4b88 ;doc: update CLI usage texts 2021-07-29 20:37:16 -10:00
Simon Michael
e4a23c95d4 ;doc: changelogs: gather 1.22.1 changes 2021-07-28 10:03:22 -10:00
Simon Michael
b0611a7363 ;doc: regexps: list style that renders in vs code 2021-07-28 09:17:47 -10:00
Simon Michael
666e217bd5 ;doc: update changelogs 2021-07-27 23:21:13 -10:00
Simon Michael
8ae42873c4 ;doc: queries: edit 2021-07-27 22:37:26 -10:00
Simon Michael
6a92953111 ;doc: queries: cleanups (#1625) 2021-07-27 22:16:39 -10:00
Simon Michael
a4d8072393 ;doc: queries: clarify some behaviour (#1625) 2021-07-27 11:19:28 -10:00
Simon Michael
40c8ddd572 ;doc: strict mode: update 2021-07-27 10:57:50 -10:00
Simon Michael
d2b799a717 feat: bal: select budget( transaction)s by name (#1612)
This makes it possible to keep multiple named budgets in one journal,
and select the one you want with --budget's argument.

More precisely, you can select the subset of periodic transactions
rules which contain a certain fixed, case-insensitive substring.

Only one such --budget argument is supported, the last one on the
command line takes precedence.
2021-07-23 10:38:20 -10:00
Stephen Morgan
b0aa70b27a lib!: Rename the fields of ReportSpec.
This is done to be more consistent with future field naming conventions,
and to make automatic generation of lenses simpler. See discussion in
\#1545.

rsOpts -> _rsReportOpts
rsToday -> _rsDay
rsQuery -> _rsQuery
rsQueryOpts -> _rsQueryOpts
2021-07-23 10:37:08 -10:00
Stephen Morgan
7ed2a0aa9b lib!: lib: Remove aismultiplier from Amount.
In Amount, aismultiplier is a boolean flag that will always be False,
except for in TMPostingRules, where it indicates whether the posting
rule is a multiplier. It is therefore unnecessary in the vast majority
of cases. This posting pulls this flag out of Amount and puts it into
TMPostingRule, so it is only kept around when necessary.

This changes the parsing of journals somewhat. Previously you could
include an * before an amount anywhere in a Journal, and it would
happily parse and set the aismultiplier flag true. This will now fail
with a parse error: * is now only acceptable before an amount within an
auto posting rule.

Any usage of the library in which the aismultiplier field is read or set
should be removed. If you truly need its functionality, you should
switch to using TMPostingRule.

This changes the JSON output of Amount, as it will no longer include
aismultiplier.
2021-07-22 19:06:33 -10:00
Stephen Morgan
3969eb2679 lib!: lib,cli,ui,web: For accountTransactionsReport, generate the overall
reportq from the ReportSpec, rather than being supplied as a separate
option.

This is the same approach used by the other reports, e.g. EntryReport,
PostingReport, MultiBalanceReport. This reduces code duplication, as
previously the reportq had to be separately tweaked in each of 5
different places.

If you call accountTransactionreport, there is no need to separately
derive the report query.
2021-07-22 19:00:37 -10:00
Stephen Morgan
58516eea77 imp: json: Decrease indentation in JSON output. 2021-07-20 23:28:18 -10:00
Simon Michael
3beba678fe ;doc: a few more changelog updates 2021-07-20 22:37:27 -10:00
Simon Michael
6569c2aca7 ;doc: update changelogs 2021-07-20 22:24:39 -10:00
Simon Michael
9701e19169 make: shellcompletions: top level rule to build shell completions 2021-07-20 21:29:52 -10:00
Jakob Schöttl
80003a5190 imp: pkg: add bash completion files to cabal package 2021-07-20 20:55:28 -10:00
Jakob Schöttl
f26ffbc6ab imp: pkg: move shell-completions into hledger package 2021-07-20 20:55:14 -10:00
Simon Michael
9aac520edd deps: allow megaparsec 9.1 2021-07-20 20:38:39 -10:00
Stephen Morgan
c606f874fb imp: json: The keys of JSON objects are now displayed in alphabetical order, making it stable across different systems and compilers. 2021-07-20 20:37:33 -10:00
Dmitry Astapov
50b915d12a doc: advice on complex quoting use-cases (closes #1609) 2021-07-18 06:16:16 -10:00
Simon Michael
8653510e3d ;doc: journal: link Transactions -> Postings 2021-07-16 08:09:26 -10:00
Simon Michael
a89815cea0 ;doc: #report-period target 2021-07-15 14:28:16 -10:00
Simon Michael
87f575e643 ref: bal: rename some report types to clarify/sync with docs
ReportType -> BalanceCalculation
 ChangeReport -> CalcChange
 BudgetReport -> CalcBudget
 ValueChangeReport -> CalcValueChange

BalanceType -> BalanceAccumulation
 PeriodChange -> PerPeriod
 CumulativeChange -> Cumulative
 HistoricalBalance -> Historical

ReportOpts:
 reporttype_ -> balancecalc_
 balancetype_ -> balanceaccum_

CompoundBalanceCommandSpec:
 cbctype -> cbcaccum

Hledger.Reports.ReportOptions:
 balanceTypeOverride -> balanceAccumulationOverride
2021-07-15 14:22:20 -10:00
Simon Michael
70dab8eccd cln: bal: indentation 2021-07-14 12:29:00 -10:00
Simon Michael
8d68193c88 ;fix: doc: info: avoid directory paths in directory metadata (#1594)
In each info manual's DIR-ENTRY metadata, it's best to use just the
filename, with no subdirectory. This should facilitate working info
manuals in packaged versions of hledger, eg in nix.

I don't remember the detail of why I added those and I'm not going to
spend a couple of hours retesting; hopefully no other significant
workflows will be affected.

I have left the subdirectory paths in the dir file - this is intended
for hledger developers and they hopefully don't cause a problem there.
2021-07-14 09:07:56 -10:00
Simon Michael
964a019368 ;doc: changelogs: minor release headings 2021-07-13 18:39:43 -10:00
Simon Michael
1f9d89879d ;doc: update changelogs 2021-07-13 18:39:40 -10:00
Stephen Morgan
cf25d7d56d
imp: bal: more predictable sort order with multiple commodities (#1563, #1564)
This change provides more predictable and intuitive behaviour when 
using -S/--sort-amount with multiple commodities. 
It implements a custom Ord (and Eq) instance for MixedAmount 
which substitutes zero for any missing commodities.

As a consequence, all the ways of representing zero with a MixedAmount ([],
[A 0], [A 0, B 0, ...]) are now Eq-ual (==), whereas before they were
not. We have not been able to find anything broken by this change.

* imp: lib: Compare MixedAmounts by substituting zero for any missing commodities. (#1563)
* ;doc: Update docs for new multicommodity sort by amount rules.
2021-07-12 21:11:50 -10:00
Simon Michael
b8f0900edb ;dev: doc: update manuals 2021-07-12 18:50:06 -10:00
Simon Michael
31de526872 ;dev: doc: update CLI usage texts 2021-07-12 18:50:06 -10:00
Simon Michael
daa95aeb7b imp: close: doc: rewrite manual (#1604) 2021-07-12 18:50:06 -10:00
Simon Michael
0a66068ad1 imp: close: clarify date logic, use journal last day if later (#1604) 2021-07-12 18:50:06 -10:00
Simon Michael
a6cfc20e9d ;doc: journal: directives: fix payee link 2021-07-06 20:54:46 -07:00
Simon Michael
f8be423354 ;doc: journal: fix commodity's scope, end-of-file 2021-07-06 17:46:51 -10:00
Simon Michael
a04a0a2f16 ;doc: journal: drop obsolete wide table warning 2021-07-06 17:02:57 -10:00
Simon Michael
b669adb511 ;doc: changelog tweaks 2021-07-04 10:08:39 -10:00
Simon Michael
68e7ff4644 ;doc: finalise changelogs 2021-07-03 14:51:51 -10:00
Simon Michael
52ebfb3dce ;doc: changelog edits 2021-07-03 11:45:50 -10:00
Simon Michael
4971b106ef ;doc: changelog edits 2021-07-02 16:10:56 -10:00
Simon Michael
d5d19f8419 ;update manuals 2021-07-02 12:42:34 -10:00
Stephen Morgan
e2198ff1ee lib: Auto-postings with Amount queries should filter only those commodities which match the query.
Also corrects a regression introduced in
8ab29f84b32288a34ae7627a2204081fae31900f where transaction modifier
postings without multipliers would incorrectly be filtered by commodity.
2021-07-01 09:35:56 -10:00
Simon Michael
2b3f6e86b8 ;doc: changelog updates 2021-06-30 18:05:50 -10:00
Stephen Morgan
2a9d358627 lib: Make sure automatic postings generated from postings with more than one commodity match on commodity symbol (#1582). 2021-06-30 17:35:43 -10:00
Stephen Morgan
bb7d04c031 lib,cli: No longer strip prices in journalApplyValuationFromOptsWith and mixedAmountApplyValuationAfterSumFromOptsWith (#1577).
These were theoretically an efficiency improvement, but have been
error-prone. We instead handle stripping prices at the point of
consumption.
2021-06-30 16:45:05 -10:00
Simon Michael
43a909f824 doc: changelogs draft
And add big headings, for fun and to help me tell them apart.
2021-06-30 15:30:57 -10:00
Simon Michael
2f56368647 ;update manuals 2021-06-28 22:39:06 -10:00