Simon Michael
c2ab616c2d
dev: unbreak recent change, don't re-export Color/ColorIntensity for now
2023-03-18 20:19:50 -10:00
Simon Michael
be8e64e498
imp: lib: export more terminal size, ANSI style/color helpers
...
Hledger.Utils.IO (and therefore Hledger and Hledger.Cli.Script) added:
getTerminalHeightWidth
getTerminalHeight
getTerminalWidth
Color(..)
ColorIntensity(..)
bold'
faint'
black'
red'
green'
yellow'
blue'
magenta'
cyan'
white'
brightBlack'
brightRed'
brightGreen'
brightYellow'
brightBlue'
brightMagenta'
brightCyan'
brightWhite'
rgb'
2023-03-18 19:59:00 -10:00
Simon Michael
5ddb6028ed
;dev: lib: cleanup
2023-03-16 21:52:37 -10:00
Simon Michael
ee29893040
dev: fix Hledger.Utils.String import
2023-03-16 14:48:59 -10:00
Simon Michael
d3e4f8547c
imp: lib: Hledger.Utils.String: more string strippers
...
added:
strip1Char
stripBy
strip1By
Not used in hledger right now, but useful to offer in our scripting prelude.
2023-03-16 14:35:37 -10:00
Simon Michael
658a650bb2
;dev: lib: another Balancing fix after ghc 9.6 support ( #2011 )
2023-03-15 20:26:57 -10:00
Simon Michael
c790aa6145
;dev: lib: also build with GHC 9.6.1; add base-compat
2023-03-14 10:42:48 -10:00
Simon Michael
6dc91588e4
fix: lib: avoid using pager on Windows, part 2
2023-03-10 20:58:11 -10:00
Simon Michael
41e838ef83
fix: lib: avoid using pager on Windows, the package is not supported
2023-03-10 19:14:13 -10:00
Simon Michael
56c38b1b29
fix: areg: handle an extra account query correctly ( fix #2007 )
2023-02-21 10:04:07 -10:00
Simon Michael
44400e840c
dev: lib: clarify accountTransactionsReportItem
2023-02-21 09:47:59 -10:00
Simon Michael
7408bc02df
lib: Hledger.Data.RawOptions: add unsetboolopt
2023-02-20 16:24:54 -10:00
Simon Michael
fa70f160ae
imp: partial/inferred dates are flexible, full dates are not ( #1982 )
...
DateSpans are now now aware of exact/flexible dates.
2023-02-17 07:24:19 -10:00
Simon Michael
032ffd112b
imp: cli: report intervals can now start on arbitrary dates
...
Eg, where previously -p 'monthly from 1/15' or -M -b 1/15 would always
adjust the report start date to 1/1,
unless you used the special -p 'every 15th day of month from 1/15' form,
now the start date will not be adjusted. (It is still adjusted if
the report date is not specified explicitly, eg inferred from the journal).
This keeps behaviour consistent between report periods and periodic transactions.
'in' period expressions, like 'in 2023-01', are a grey area; they
do specify a start date (2023-01-01), although they look a bit implicit.
So previously, -p 'weekly in 2023-01' would adjust the start date to
the preceding monday (2022-12-26), but now it will start exactly on
2023-01-01 (a sunday, which also causes ugly verbose column headings).
To ensure monday based weeks and simple report headings here,
you would have to explicitly specific a start date that is a monday,
eg -p 'weekly from 2022-12-26 to 2023-02'.
2023-02-17 07:24:19 -10:00
Simon Michael
5537a251f3
imp: journal: periodic txns need not start on an interval boundary
...
Eg, ~ monthly from 1/15 now works, instead of giving an error message.
2023-02-17 07:24:19 -10:00
Simon Michael
0c74744626
fix: test: fix periodic transaction pretty-printing ( #1988 )
2023-02-17 07:24:19 -10:00
Simon Michael
7a9b0fd94c
feat: check: the tags check checks tag names
2023-02-16 11:56:22 -10:00
Simon Michael
614697acf7
feat: journal: tag directive declares tag names
2023-02-16 11:56:22 -10:00
Simon Michael
c51ebe7b8c
imp: journal: remove the "adjacent conversion postings" check again
...
I find that single conversion postings are sometimes needed, eg with
paypal.
2023-02-01 13:30:21 -10:00
Simon Michael
9381b46004
fix: lib: fix terminal lightness detection
2023-01-27 16:51:05 -10:00
Simon Michael
79914cbe74
fix: cli: avoid showing color detection escape sequence when piped
2023-01-27 10:50:56 -10:00
Simon Michael
110711a2a2
fix: cli: restore workaround to avoid showing escape codes in emacs
2023-01-27 10:00:07 -10:00
Simon Michael
eed8a06906
fix: cli: don't highlight help when TERM=dumb
2023-01-27 06:06:17 -10:00
Simon Michael
bb5d473955
fix: lib: don't use $PAGER when TERM=dumb
2023-01-27 06:01:49 -10:00
Simon Michael
45808c8e13
imp: cli: add terminalLightness; tweak IsLight threshold; embolden banner
2023-01-26 22:11:20 -10:00
Simon Michael
1da4fd1eaf
imp: lib: terminal colour detection
...
added:
terminalIsLight
terminalFgColor
terminalBgColor
2023-01-26 22:11:20 -10:00
Simon Michael
de330bdfce
imp: journal: check for adjacent conversion postings only in strict mode
...
This avoids breaking existing journals if, say, they happen to have
a single "equity:trading" posting somewhere.
2023-01-25 19:00:29 -10:00
Simon Michael
9c5bcfea85
dev: transactionInferCostsFromEquity: clarify partitionPs
2023-01-25 19:00:29 -10:00
Simon Michael
76f8eaf91a
imp: journal: ignore redundant costs; --infer-costs more robustly
...
You can now write both @/@@ costs and corresponding equity conversion postings
in a transaction at any time, not just when using --infer-costs or --infer-equity.
hledger will recognise the redundancy and ignore it.
One thing has become more strict: hledger now requires conversion postings
to occur in adjacent pairs; an odd number of them is not allowed.
(Conversion postings are postings to accounts of type `V`/`Conversion`,
or named `equity:conversion`, `equity:trade`, `equity:trading`,
or subaccounts of these.)
And, --infer-costs now works in transactions with an implicit amount
(inferring costs from equity now happens after transaction balancing,
not before).
2023-01-25 19:00:29 -10:00
Simon Michael
7432769d3c
lib: add journalMarkRedundantCosts to help with balancing; slight refactoring
2023-01-25 19:00:29 -10:00
Simon Michael
d77d76e17f
imp: cli: use $PAGER when help output is taller than terminal
...
This works with hledger, hledger -h and hledger CMD -h.
2023-01-25 17:20:27 -10:00
Chris Lemaire
43c9f018dc
journal: Account directives reject account names with brackets
...
Previously, the accounts passed to account directives would be stripped
of their surrounding brackets, but the required behaviour is to have
account directives plain reject bracketed accounts. This change ensures
that accounts in account directives may not start with a bracket
character.
2023-01-24 13:40:01 -10:00
Simon Michael
9497472e64
Merge branch 'master' into 1984-source-name-and-position-for-forecast
2023-01-23 16:04:00 -10:00
Chris Lemaire
4ada2a3fbc
journal: Fully unbracket AccountNames in account directives
...
Currently an account name like "a:(aa)" will not have (aa) unbracketed.
However, this seems reasonable since the full name is unbracketed and
thus will not be confused with virtual or virtual-balanced posting.
2023-01-23 12:43:13 -10:00
Chris Lemaire
9443fe0e0d
journal: json: Add source positions to forecast transactions
2023-01-21 22:30:30 +01:00
Simon Michael
e5f3c0ecdb
lib: transactionInferCostsFromEquity: adjust to "cost" terminology
2023-01-20 21:47:44 -10:00
Simon Michael
5ca8752e48
lib: journalBalanceTransactions, balanceTransactionHelper cleanups
2023-01-20 20:23:27 -10:00
Simon Michael
5b27554f0a
dev: note why inferring costs from equity before balancing
2023-01-19 20:57:02 -10:00
Simon Michael
cf469c080d
lib: journalInferCosts -> journalInferCostsFromEquity
2023-01-19 20:25:41 -10:00
Simon Michael
28eb8be4fa
lib: BalancingOpts{infer_transaction_prices_ -> infer_balancing_costs_}
2023-01-19 20:21:31 -10:00
Simon Michael
c0950c0900
lib: Hledger.Data.Balancing: inferBalancingPrices -> transactionInferBalancingCosts
2023-01-19 09:36:12 -10:00
Simon Michael
7ecf7ef27b
lib: Hledger.Data.Balancing: inferBalancingAmount -> transactionInferBalancingAmount
2023-01-19 09:28:30 -10:00
Simon Michael
402b4265f8
lib: Hledger.Data.Journal: transactionAddPricesFromEquity -> transactionInferCostsFromEquity
2023-01-19 09:22:55 -10:00
Simon Michael
dfea6eaee2
lib: Hledger.Data.Journal: journalAddPricesFromEquity -> journalInferCosts
2023-01-19 09:17:56 -10:00
Simon Michael
dfebf3174c
imp: csv: check assigned account names are valid (parseable) ( #1978 )
2023-01-11 21:42:47 -10:00
Simon Michael
93f74f7a0e
lib: Hledger.Data.Dates: intervalStartBefore -> intervalBoundaryBefore
2023-01-11 20:51:24 -10:00
Simon Michael
e891eecb8b
dev: add TypeOperators pragma to satisfy ghc 9.4
2023-01-10 19:33:31 -10:00
Simon Michael
a9b63bb694
fix: csv: skip header lines before attempting to parse records ( #1967 )
2022-12-27 12:21:20 -10:00
Simon Michael
71bd102b4b
fix: journal: don't generate bad assertion when assigning with cost ( fix #1965 )
2022-12-26 10:21:44 -10:00
Simon Michael
4b36d852b4
imp: journal: ignore ((valuation expressions)) after amounts (ledger compat)
2022-12-22 20:06:28 -10:00