Commit Graph

854 Commits

Author SHA1 Message Date
Simon Michael
69ee21cf16 ;doc: regen manuals
[ci skip]
2019-11-18 17:14:06 -08:00
Michael Kainer
79ca4a767e cli: Add -% to compound balance commands
This commit introduces the commandline argument -%/--percent to show
percentages of the column's total instead of the absolute amounts for
each account in reports. The signs of the values are preserved.

This option is especially useful for the balance and incomestatement
commands.

If there are multiple commodities involved in a report hledger bails
with an error message. This can be avoided by using --cost. Also note
that if one uses -% with the balance command the chances are high that
all numbers are 0. This is due to the fact that by default balance sums
up to zero. If one wants to use -% in a meaningful way with balance one
has to add a query.

In order to keep the implementation as simple as possible --tree has no
influence over how the percentages are calculated, i.e., the percentages
always represent the fraction of the columns total. If one wants to know
the percentages relative to a parent account, one has to use a query to
narrow down the accounts.
2019-11-18 17:10:59 -08:00
Dmitry Astapov
87b82b6839 lib: roi does not fail on empty input data (+test) 2019-11-18 16:13:04 -08:00
Brian Wignall
0ce7e811ba Fix two small typos 2019-11-10 13:54:48 -08:00
Simon Michael
445adbe9d1 ;doc: regen manuals
[ci skip]
2019-10-23 12:30:27 -07:00
Simon Michael
cfc00070a1 ;doc: fix output destination/format links in command docs
[ci skip]
2019-10-23 12:29:17 -07:00
Simon Michael
312e772468 prices: style price amounts; always show full precision 2019-10-20 07:09:34 -07:00
Mykola Orliuk
78146978f4 ;lib: store raw opts unquoted
It looks like we only need quote when we build query and in some
messages.

Fixes simonmichael/hledger#1079
2019-10-19 14:44:08 -07:00
Simon Michael
9967ead4c5 ;lib: let commodityStylesFromAmounts & co. return an error (#793, #1091)
And if they did, the stats command would now throw an error.

Changed:
journalApplyCommodityStyles
journalInferCommodityStyles
commodityStylesFromAmounts
2019-09-27 15:09:39 -10:00
Simon Michael
a0deb88796 ;doc: regen manuals
[ci skip]
2019-09-13 11:00:03 -07:00
Simon Michael
867ccb31d5 ;import: drop inconsistent period 2019-09-13 09:07:18 -07:00
Simon Michael
bf1e398ffd ;import: with --dry-run the no txns case should be parseable too 2019-09-13 09:02:32 -07:00
Simon Michael
edaf92db5e import: message cleanups, mention input files
Only the --dry-run message needs the semicolon, so dry run output can
be piped into hledger.
2019-09-13 08:43:33 -07:00
Simon Michael
807273d9de import: --catchup marks all transactions imported, without importing 2019-09-13 08:43:33 -07:00
Simon Michael
35a90004ca import: also show a message when nothing was imported 2019-09-13 08:43:33 -07:00
Simon Michael
dfc0095fed import: create the journal if missing, like the add command
Streamlines import/migration instructions.
2019-09-13 08:43:33 -07:00
Simon Michael
4db14ef70f ;api: another round of hledger-api purging; fix the build 2019-09-11 14:49:22 -07:00
Simon Michael
ef04907484 ;doc: fix broken manual links in manuals source
[ci skip]
2019-09-10 17:02:56 -07:00
Simon Michael
538e97f3ac ;lib: clarify journalAddForecast doc (#835)
[ci skip]
2019-09-10 16:59:26 -07:00
Simon Michael
499e20c0b2 lib, cli, ui: start using Control.Monad.Fail, allow base-compat 0.11
fail is moving out of Monad and into it's own MonadFail class.
This will be enforced in GHC 8.8 (I think).

base-compat/base-compat-batteries 0.11.0 have adapted to this,
and are approaching stackage nightly
(https://github.com/commercialhaskell/stackage/issues/4802).

hledger is now ready to build with base-compat-batteries 0.11.0, once
all of our deps do (eg aeson). We are still compatible with the older
0.10.x and GHC 7.10.3 as well.

For now we are using both fails:

- new fail (from Control.Monad.Fail), used in our parsers, imported
  via base-compat-batteries Control.Monad.Fail.Compat to work with
  older GHC versions.

- old fail (from GHC.Base, exported by Prelude, Control.Monad,
  Control.Monad.State.Strict, Prelude.Compat, ...), used in easytest's
  Test, since I couldn't find their existing fail implementation to update.

To reduce (my) confusion, these are imported carefully, consistently,
and qualified everywhere as Fail.fail and Prelude.fail, with clashing
re-exports suppressed, like so:

import Prelude hiding (fail)
import qualified Prelude (fail)
import Control.Monad.State.Strict hiding (fail)
import "base-compat-batteries" Prelude.Compat hiding (fail)
import qualified "base-compat-batteries" Control.Monad.Fail.Compat as Fail
2019-09-08 17:13:47 -07:00
Simon Michael
b1859769ac ;doc: regen man pages
[ci skip]
2019-09-01 08:53:06 -07:00
Simon Michael
9cdbce288c ;descriptions/notes/payees: fix build warning 2019-08-31 18:36:03 -07:00
Simon Michael
4dc0e359dc help: don't require a journal file 2019-08-22 17:49:50 -07:00
Simon Michael
318a7ce234 reg: show negative amounts in red, like balance and Ledger 2019-08-21 07:11:55 +01:00
Simon Michael
5bc1e7746f stats: show count of market prices (P), and the commodities covered 2019-08-19 11:16:09 +01:00
Simon Michael
1cbbe8f43d memoise market valuation, making it fast (#999) 2019-08-19 02:16:39 +01:00
Simon Michael
7c2511aa29 bs: show end date(s) in title, not transactions date span (#1078)
Compound balance reports showing ending balances (eg balancesheet),
now show the ending date (single column) or range of ending
dates (multi column) in their title. ,, (double comma) is used
rather than - (hyphen) to suggest a sequence of discrete dates
rather than a continuous span.
2019-08-15 18:22:23 +01:00
Simon Michael
8284c1042b ;doc: update command help txt files
[ci skip]
2019-07-26 23:25:52 +01:00
Simon Michael
8cde342432 tags: speedup: replace n^2 nub with n log n nubSort 2019-07-26 23:24:09 +01:00
Simon Michael
0b793bca1b tags: add --values flag 2019-07-26 23:18:21 +01:00
Simon Michael
2aa5bd1653 ;tags: mention pivot trick for listing tag values
[ci skip]
2019-07-26 22:19:27 +01:00
Caleb Maclennan
11d9e5eb6a code: Strip extraneous trailing whitespace from Haskell sources 2019-07-15 16:40:49 +01:00
Caleb Maclennan
e68e558761 payees: Split command into descriptions, payees, and notes 2019-07-15 08:22:16 +01:00
Caleb Maclennan
5d42578137 payees: Output sorted results as in other similar commands 2019-07-15 08:22:16 +01:00
Simon Michael
f49a76e051 payees: get basic command working 2019-07-15 08:22:16 +01:00
Caleb Maclennan
e6b709cb01 payees: Add a module for handling payees command 2019-07-15 08:22:16 +01:00
Simon Michael
6c2398e4d7 close: preserve transaction prices (costs) accurately (#1035)
Transaction prices were being collapsed/misreported after close/open;
this is fixed. Now each separately-priced amount gets its own posting,
and only the last of these (for each commodity) gets a balance
assertion. Also the equity posting's amount is now always shown
explicitly, which in multicommodity situations means that multiple
equity postings are shown. The upshot is that a balance -B report
will be unchanged after closing & opening transactions.
2019-07-09 11:21:22 +01:00
Jakob Schöttl
8569b39771 Refactoring: qualified call to process function 2019-06-30 10:38:06 +02:00
Jakob Schöttl
2b01312004 Fix and update documentation on date options 2019-06-30 10:38:06 +02:00
Simon Michael
27c01e82b5 add: doc: mention the windows trailing-dot file path issue 2019-06-26 18:47:11 +01:00
Simon Michael
5cb334514c ;lib: rename setMinimalPrecision -> setNaturalPrecision 2019-06-14 19:04:09 -07:00
Simon Michael
692620180e ;lib: refactor: change AmountPrice to a Maybe
I've wanted to do this for a long time; now that prices are in flux,
seems a good time.
2019-06-13 15:50:01 -07:00
Simon Michael
adb6ee40eb lib: clarify price types (#131)
dropped journalPrices

renamed Price to AmountPrice,  AKA "transaction price"

renamed MarketPrice to PriceDirective.

added new MarketPrice (more pure form of PriceDirective without the amount style information)

Prices is now a more efficient data structure, but not used yet.
2019-06-13 15:50:01 -07:00
Simon Michael
e24c6292d0 lib: support -X/--exchange (direct/reverse prices only) (#131) 2019-06-13 15:50:01 -07:00
Simon Michael
50a52dd467 lib: --value can select commodity (via direct/reverse prices) (#131) 2019-06-13 15:50:01 -07:00
Simon Michael
289891cacf ;prices: note
[ci skip]
2019-06-02 08:48:41 -07:00
Simon Michael
faf85d91e3 cli: restore --aux-date and --effective as --date2 aliases (#1034)
These Ledger-ish spellings were dropped over the years, to improve
--help's layout. Now they work again, but are considered hidden flags
so --help doesn't show them automatically (but I decided to mention
them manually in --date2's description).
2019-06-02 08:48:41 -07:00
Simon Michael
aa99743096 make -V do --value=end in multiperiod reports (#329) 2019-05-24 10:30:35 -07:00
Simon Michael
9977739c76 bal etc.: replace --value=transaction with --value=cost (#329) 2019-05-23 21:55:18 -07:00
Simon Michael
f999bf78e6 opts: new -B/--cost, -V/--market, --value flags (#329) 2019-05-23 13:11:20 -07:00