Simon Michael
3f55c23603
;review, tag all error calls with an easier to find PARTIAL: comment ( #1312 )
2020-08-05 16:08:33 -07:00
Simon Michael
242c05fc9a
lib, journal: parseQuery, modifyTransactions are now total ( #1312 )
...
modifyTransactions now also requires a reference date, for parsing queries.
Relative dates are now permitted in auto posting rules.
2020-08-05 13:44:04 -07:00
Stephen Morgan
08ad220448
lib: In quarterdatespanp, use yearp and allow uppercase Q.
2020-08-04 09:10:53 -07:00
Henning Thielemann
9c9701fe7d
lib: quarterdatespanp ( fixes #1247 )
2020-07-31 17:37:41 -07:00
Henning Thielemann
ccac09fb1b
lib: doubledatespanp: fix and re-enable doctest
2020-07-31 17:37:41 -07:00
Stephen Morgan
ffb5cf0773
lib: Ensure parsed years have at least 4 digits.
2020-07-31 17:22:27 -07:00
Stephen Morgan
7b9f9ae49c
lib: Refactor reportingintervalp to be more compact and do less backtracking.
2020-07-31 17:22:27 -07:00
Stephen Morgan
696d9c73b0
lib: Remove unnecessary try in parsers, replace unnecessary string' with string, rewrite some parsers in applicative style.
2020-07-31 17:22:27 -07:00
Dmitry Astapov
a82c383370
lib: disallow tabs in simplecommoditysymbolp ( fixes #1301 )
2020-07-28 15:33:47 -07:00
Stephen Morgan
081ee390ab
lib: Change skipMany spacenonewline to takeWhileP Nothing isNonNewlineSpace.
2020-07-22 14:58:53 -07:00
Simon Michael
e4f8b80d3b
;journal: account types: fix detection of Cash as an Asset, add tests
2020-07-17 10:02:14 -07:00
Simon Michael
fd9171df07
journal: account types: add Cash, tweak fallback regexp, rewrite docs
2020-07-17 08:02:12 -07:00
Stephen Morgan
30f02b0882
lib: account name clipping takes Maybe Int as depth.
2020-07-17 07:41:27 -07:00
Stephen Morgan
dc076b0d5b
lib: Use text library functions for stripping.
2020-07-16 10:03:25 -07:00
Stephen Morgan
ed99aea7d5
lib: Introduce takeEnd to get rid of some reverse . take n . reverse.
2020-07-16 10:03:25 -07:00
Simon Michael
bf2fe3d88e
;lib: valuation debug output note
2020-07-14 10:21:45 -07:00
Stephen Morgan
fd729beabf
lib: Work around hiding deprecation warnings, don't traverse zeros twice in normaliseHelper.
2020-07-10 12:18:51 -07:00
Stephen Morgan
ee3ed6acdf
lib: Simplify and speed up amountLooksZero.
2020-07-10 12:18:51 -07:00
Stephen Morgan
99b74dc389
lib: Refactor sortAccountTreeByAmount
2020-07-10 09:08:03 -07:00
Simon Michael
4b9a76068f
lib: spanStartYear, spanEndYear, spanYears DateSpan helpers
2020-07-09 12:52:40 -07:00
Simon Michael
44c3eb1904
add a color argument to most amount show helpers, drop cshow variants
...
This is an API change, but it seems better than having additional
colour-supporting variants and trying to avoid duplicated code.
I stopped short of changing showAmount, so cshowAmount still exists.
2020-07-05 06:59:16 -07:00
Simon Michael
2739a70a38
balcmds: elide amounts with 3 or more commodities, unless --no-elide
...
Multicolumn balance reports showing many commodities tend to become
unreadably wide, especially in tree mode. Now by default we show at
most two commodities, and a count of the rest if there are more than
two. This should help keep reports somewhat readable by default.
2020-07-05 06:59:16 -07:00
Stephen Morgan
c811ea4c7b
lib, cli, ui, web: intopt and friends now make sure their arguments fit
...
inside bounds.
2020-07-03 12:35:51 -07:00
Simon Michael
765fb732c9
debug: move command parsing debug output down to level 8
2020-07-03 11:37:01 -07:00
Simon Michael
6cc896a8fe
debug: show aliasing and auto postings with other reading (level 7)
2020-07-03 11:30:52 -07:00
Stephen Morgan
015492553e
lib: Move unifyMixedAmount to Hledger.Data.Amount, make it return Maybe Amount, export it.
2020-06-24 10:24:11 -07:00
Stephen Morgan
b3cd865786
lib: Add fortnightly as a synonym for biweekly.
2020-06-23 06:48:20 -07:00
Stephen Morgan
7a74fc4f21
lib: Elide account if more components are dropped than exist.
2020-06-22 13:41:22 -07:00
Simon Michael
e3cae4aadc
valuation: implement new --infer-value flag & semantics ( #1239 , #1253 )
2020-06-19 14:40:20 -07:00
Simon Michael
467210c796
;valuation: refactor, update, clean up
2020-06-19 14:40:20 -07:00
Simon Michael
684cb45e1a
tweak debug levels, document some guidelines
...
Beginnings of a project-wide policy for what output to show at
each debug level, for now. Later we'll want more flexibility,
eg filtering by topic.
2020-06-14 17:17:09 -07:00
Simon Michael
6e36ede9aa
;valuation: refactor
2020-06-14 15:48:16 -07:00
Simon Michael
c8773854f0
;doc: valuation: more cleanup
2020-06-13 12:41:02 -07:00
Simon Michael
4bf4c62181
journal: default valuation commodity from P only, take 2 ( #1239 , #1253 )
2020-06-13 09:50:36 -07:00
Simon Michael
03b4b2dedc
journal: default valuation commodity comes from P directives only ( #1239 , #1253 )
2020-06-12 21:25:38 -07:00
Simon Michael
c59565ca5b
;fix Json.hs with old GHCs
2020-06-06 15:33:04 -07:00
Simon Michael
b50c3a694c
;lib: note issue with Journal's JSON
2020-06-06 12:54:58 -07:00
Simon Michael
b86ced5ee9
lib: replace jsonPrettyText with toJsonText in Hledger.Data.Json
2020-06-06 12:54:58 -07:00
Stephen Morgan
be25fe360e
lib: Parser now accepts .. as a synonym for to in date ranges.
2020-06-04 19:30:42 -07:00
Stephen Morgan
2f71da8838
lib: More consistent period formatting.
2020-06-04 19:30:42 -07:00
Dmitry Astapov
cbf4029b8b
lib: test for issue with sign checking code + fix
2020-06-01 15:17:15 -07:00
Simon Michael
97f2235bca
;lib: refactor amount cost functions
...
Rename costOfAmount -> amountCost, costOfMixedAmount -> mixedAmountCost,
drop amountToCost, mixedAmountToCost.
2020-05-31 15:48:08 -07:00
Simon Michael
660ba7e1d9
lib: clarify zero-checking function names
...
isZeroAmount -> amountLooksZero
isReallyZeroAmount -> amountIsZero
isZeroMixedAmount -> mixedAmountLooksZero
isReallyZeroMixedAmount -> mixedAmountIsZero
isReallyZeroMixedAmountCost dropped
2020-05-29 18:57:22 -07:00
Simon Michael
1087e790cf
;lib: refactor transactionCheckBalanced
2020-05-29 17:57:10 -07:00
Simon Michael
7bcc205622
lib: drop transactionPostingBalances
2020-05-29 17:33:53 -07:00
Simon Michael
0a5fa33f9d
split more long transaction balancing errors into lines; refactor
2020-05-29 16:31:15 -07:00
Simon Michael
924ec1c98d
journal: clearer transaction balancing errors; refactor
...
As mentioned by netvor on IRC, the unbalanced transaction error was
not too clear when postings all have the same sign.
Some other wording has been clarified, and the main error message is
now shown on multiple lines for readability (at the cost of
predictability/grepability..)
There's also a probably unnoticeable change: selecting which parts of
the error to show is now based on display precisions (reusing the
balanced check logic), rather than original precisions.
2020-05-29 16:07:58 -07:00
Simon Michael
61264cfdc0
lib: isNegativeMixedAmount handles all-negative multi-comm. amounts
2020-05-29 13:07:02 -07:00
Simon Michael
e6f9f09b41
;lib: refactor, consolidate, add transactionCheckBalanced
2020-05-29 11:57:48 -07:00
Simon Michael
e1ddfc3a1b
lib: also infer market prices from transactions, like Ledger ( #1239 ) (WIP)
2020-05-25 17:45:31 -07:00