Commit Graph

63 Commits

Author SHA1 Message Date
Simon Michael
65934958f9 rename --value-date -> --value-at; --value-at implies -V 2019-04-26 12:08:31 -07:00
Simon Michael
9adae02973 print: add --value-date general option; implement for print -V 2019-04-26 12:08:31 -07:00
Simon Michael
ef9c4a29c4 lib: save the current date in ReportOpts
We need this for choosing a valuation date, otherwise, report
functions would have to be in IO or we'd have to pass in yet another
argument.

It's optional because it's useful to be able to create report opts
purely (I think ?) This is not ideal but maybe not a problem.
2019-04-24 08:25:55 -07:00
Jakob Schöttl
4444b8bc8f Change unused argument to undefined to make possible bugs more obvious 2019-04-18 22:38:41 +02:00
Jakob Schöttl
593ee39284 Fix behavior of options like -Mp2019
This fixes the issue #1008
2019-04-18 22:38:41 +02:00
Dmitry Astapov
5711cdf9ba cli: added --transpose to "balance" command 2019-01-24 15:06:35 -08:00
Alex Chen
3d2584d869 lib: switch to megaparsec 7 2018-09-30 20:15:12 -06:00
Simon Michael
91b111b60d rename easytests_* to tests_* 2018-09-06 13:13:26 -07:00
Simon Michael
4003264129 lib: drop HUnit helpers, rename expectEqPP 2018-09-04 13:52:36 -07:00
Simon Michael
241d0dbebd tests: ReportOptions -> easytest 2018-09-04 11:54:40 -07:00
Simon Michael
d778a92561 tests: export HUnit/EasyTest from Hledger.Utils.Test; more helpers 2018-08-18 15:19:59 +01:00
Simon Michael
1e0a7ec8f1 remove some unneeded CPP pragmas 2018-08-02 08:25:49 +01:00
Simon Michael
816ba0f89d consistent comment wording 2018-06-18 17:54:25 -07:00
Simon Michael
061aad0431 remove some CPP that's obsolete since we require base 4.8+ 2018-06-04 17:33:21 -07:00
Dmitry Astapov
ecf49b1e4b lib: auto postings generated before amount inference and balance checks (#729) 2018-04-17 14:33:32 -07:00
Simon Michael
2b34ff1184 lib: reportSpan debug output 2018-03-30 02:41:03 +01:00
Simon Michael
ebaac2866b lib: fix reportStartEndDates, rename to reportSpan 2018-03-30 00:16:35 +01:00
Simon Michael
083d9190fd budget: only periodic txns with the selected interval are used 2018-03-29 15:51:52 +01:00
Simon Michael
d3fde29b36 bal: --invert flag to flip all signs 2018-01-29 14:53:23 -08:00
Simon Michael
88ef586480 lib: rename, clarify purpose of balanceReportFromMultiBalanceReport 2018-01-23 11:32:24 -08:00
Simon Michael
6b349e3123 bs/bse/cf/is: show all balances as normally-positive (experimental)
Income, liability and equity balances, which until now we have
always displayed as negative numbers, are now shown as normally positive
by these reports.
Negative numbers now indicate a contra-balance (eg an overdrawn
checking account), a net loss, a negative net worth, etc.
This makes these reports more like conventional financial statements,
and easier to read and share with normal people.
2018-01-18 11:01:07 -08:00
Simon Michael
79812f974a rename NormalBalance -> NormalSign 2018-01-15 14:12:38 -08:00
Simon Michael
8f55b6137d uses today's prices, not those of last txn date, for -V (fix #683,#648) 2017-12-29 21:42:59 -08:00
Dmitry Astapov
23f3da4e92 cli: --auto adds automated postings to reports
Ledger-style automated postings, previously supported only by
hledger-budget, have landed as a first-class feature.  The --auto
flag activates them, so that any postings they generate are
included in reports.
2017-11-26 14:57:41 +00:00
Dmitry Astapov
f101d5b515 cli: --forecast adds periodic transactions to reports
Ledger-style periodic transactions, previously supported only by
hledger-budget, have landed as a first-class feature.  The --forecast
flag activates them, so that any transactions they generate are
included in reports.
2017-11-26 14:57:41 +00:00
Simon Michael
b5602fd771 bal: --sort-amount sorts tree-mode multi-column balance reports 2017-09-29 18:49:47 -10:00
Simon Michael
d9d92b3bf1 bs/bse/is: --sort-amount puts large liabilities/equities/incomes at top
Compound balance commands like these can now be aware of normal account
balance sign, and sort negative balances accordingly.

This also adds utility-ht as a dependency, only for the uncurry function
right now but it looks potentially useful to have.
2017-09-25 19:06:38 -10:00
Simon Michael
35e2e94228 bal/bs/cf/is: --sort-amount sorts by amount instead of account name 2017-09-25 06:17:46 -10:00
Simon Michael
e3c4a76119 add & use simpler readJournalFilesWithOpts/InputOpts api 2017-09-14 17:43:32 -07:00
Simon Michael
59af88b796 ui: add temporary --status-toggles for testing toggle styles (#564) 2017-06-18 16:20:30 -07:00
Simon Michael
22e751983b ui: allow multiple status filters to be active at once (#564) 2017-06-15 19:16:39 -07:00
Simon Michael
dcc58d4a2b lib: rename ClearedStatus type to Status
(and fix hard-coded enum count)
2017-06-15 19:16:39 -07:00
Simon Michael
430c49154a lib: rename Query's Status constructor to StatusQ 2017-06-15 19:16:39 -07:00
Simon Michael
e119941648 rename "uncleared" status to "unmarked" and --uncleared to --unmarked (#564)
See the issue and linked mail list discussion. Ambiguity between the
uncleared state, and the "not cleared" --uncleared flag causes confusion
and friction. At this point it seems best to break with Ledger and
past hledger, pick a new name and drop --uncleared to put an end to it.
2017-06-15 19:16:39 -07:00
Simon Michael
7fc921db86 lib, cli: -U/-P/-C flags can be combined (#564) 2017-06-15 19:16:39 -07:00
Simon Michael
10d85bedec bal: show negative amounts in red
The balance command now shows negative amounts in red, when it thinks
ANSI codes are supported, ie when TERM is not "dumb" and stdout is not
being redirected or piped somewhere.
2017-04-25 18:34:09 -07:00
Moritz Kiefer
f4b3f1c094 Add an option to use unicode in balance tables (#528)
* Add an option to use unicode in balance tables

fixes #522

* Add a test for unicode tables

* Document --pretty-tables

* Support --pretty-tables in BalanceView
2017-03-29 11:12:01 -07:00
Simon Michael
b402fc7e7d lib: optserror -> usageError, consolidate with other error functions (#529) 2017-03-29 08:00:51 -07:00
Hans-Peter Deifel
dfbb683573 Prettify option parsing errors (#478)
Megaparsec's show instance for ParseError doesn't produce digestible
strings. parseErrorPretty has to be used instead.
2017-01-13 13:10:11 -08:00
Simon Michael
2b05970781 lib: report end date fix #403 #453 2016-12-30 14:36:27 -08:00
Simon Michael
7dcfcb05ec lib: get effective report start/end dates 2016-12-30 11:46:13 -08:00
Simon Michael
69ebc3b159 bal, reg, stats: clarify report modes, output, options
- try to clarify naming and meaning of balance/register report modes
  and kinds of "balance" displayed. Added balance --change and
  register --cumulative flags to clarify report modes.

- with multiple --change/--cumulative/--historical flags use the last
  instead of complaining

- register -A is now affected by -H

- options cleanups
2016-08-12 09:44:31 -07:00
Simon Michael
fe6d4cc7da lib: abstract period/interval/cleared in ReportOpts 2016-07-29 19:20:56 -07:00
Simon Michael
b7071dee84 lib: use Data.Default directly, not via cmdargs 2016-07-29 10:15:48 -07:00
Moritz Kiefer
4141067428 Replace Parsec with Megaparsec (see #289) (#366)
* Replace Parsec with Megaparsec (see #289)

This builds upon PR #289 by @rasendubi

* Revert renaming of parseWithState to parseWithCtx

* Fix doctests

* Update for Megaparsec 5

* Specialize parser to improve performance

* Pretty print errors

* Swap StateT and ParsecT

This is necessary to get the correct backtracking behavior, i.e. discard
state changes if the parsing fails.
2016-07-29 08:57:10 -07:00
Simon Michael
92038b7d72 web: fix options breakage, add test code to tags 2015-08-28 15:23:49 -07:00
Simon Michael
f3dd5eb830 fix options breakage with GHC < 7.10 2015-08-28 11:17:49 -07:00
Simon Michael
0d02262463 validate --depth/depth:'s argument is positive 2015-08-28 09:57:30 -07:00
Simon Michael
4dd1e9c725 clean up options validation a little 2015-08-28 09:57:01 -07:00
Simon Michael
49be1f646e balance: add -V/--value to show as market value
Initial support of market value reporting and currency conversion,
similar in spirit to Ledger's.  The balance command now has a -V/--value
flag that converts all the reported amounts using their "default market
price". That is the latest market price (P directive, formerly called
"historical prices") found in the journal for their commodity that is on
or before the report end date.

Unlike Ledger, hledger's -V only uses the market prices recorded with P
directives, ignoring transaction prices recorded as part of posting
amounts (which -B/--cost uses). Using -B and -V together is allowed.
2015-08-09 16:03:16 -07:00