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
Simon Michael
10f8dc84a5
period expressions: allow "until", like Ledger (synonym for "to")
2020-04-08 14:26:38 -07:00
Pavan Rikhi
f574b782fa
Fix Documentation for journalExpenseAccountQuery
2020-03-22 17:17:06 -07:00
Simon Michael
21fdcec6b7
journal: inclusive balance assignments now work ( #1207 )
2020-03-05 13:38:19 -08:00
Simon Michael
f18c74fff7
;journal: a test for inclusive balance assignment, disabled ( #1207 )
...
[ci skip]
2020-03-05 11:19:04 -08:00
Simon Michael
5ed6fe586a
;refactor transaction balancing/checking ( #1207 )
2020-03-05 11:18:59 -08:00
Stephen Morgan
e0dde6fe57
lib: Remove non-law-abiding Monoid instance for Journal.
2020-03-02 12:45:30 -08:00
Stephen Morgan
702c958487
lib: Replace some utility functions with library functions.
2020-03-02 12:45:30 -08:00
Simon Michael
04fb132496
;doc: draft changelogs
...
[ci skip]
2020-03-01 16:44:28 -08:00
Simon Michael
43c55bf4ea
;lib: add YYYY.MM.DD to parsedate/parsedateM helpers
...
For a bit more consistency with simple dates. And document better.
2020-02-27 10:57:55 -08:00
Simon Michael
a33a9d61c2
json: use a simpler, more consumable number representation ( #1195 )
...
Amounts in JSON are now rendered as simple Numbers with up to 10
decimal places, instead of Decimal objects which would in some cases
have 255 digits, too many for most JSON parsers to handle.
A provisional fix, see the comment in Json.hs for more detail.
2020-02-26 11:48:09 -08:00
Simon Michael
7f16d23898
;refactor: extract --value=then error message
2020-02-24 17:49:53 -08:00
Simon Michael
86ffef1057
;doc:journal: edits, Amount display format -> Amount display style ( #1187 )
...
Drop occasional use of "display format", prefer "display style".
[ci skip]
2020-02-11 10:23:52 -08:00
Simon Michael
e4a0bdff8d
journal: default commodity (D) limits display precision too ( #1187 )
...
D directives are now fully equivalent to commodity directives for
setting a commodity's display style. (Previously it was equivalent to
a posting amount, so it couldn't limit the number of decimal places.)
When both kinds of directive exist, commodity directives take precedence.
When there are multiple D directives in the journal, only the last one
affects display style.
2020-02-11 09:47:26 -08:00
Simon Michael
1741b607e2
lib: more cleanup of amount canonicalisation helpers ( #1187 )
...
Stop exporting journalAmounts, overJournalAmounts, traverseJournalAmounts.
Rename journalAmounts helper to journalStyleInfluencingAmounts.
D directives are now a little better at influencing amount
canonicalisation, eg in the updated test case.
2020-02-11 09:23:04 -08:00
Simon Michael
926b01f2eb
;lib: try to clarify this amount traversing stuff ( #1187 )
2020-02-11 08:34:22 -08:00
Simon Michael
aa96b41efe
print, register: add --value=then, valuing at each posting's date
...
Currently this will give an error with other kinds of report.
2020-02-10 08:20:39 -08:00
Jakob Schöttl
50acfc9119
Fix documentation, make ISO date format standard in some places
2020-02-09 07:26:54 -08:00
Simon Michael
e0a46a6523
;lib: update doctests for ISO 8601 date output
...
[ci skip]
2020-02-03 08:03:44 -08:00
Simon Michael
5f7ae2ced6
;lib: Amount: export mixedAmountStripPrices
2020-01-22 11:57:42 -08:00
Simon Michael
64546cd54a
lib: export mapMixedAmount
2020-01-20 18:01:33 -08:00
Jakob Schöttl
c7a88b50fb
Fix timeclock format parsing
...
Fix presumably copy-paste errors
timeclock format has only timeclock lines or empty/comment lines
Update test format to v3, add new tests
Throw error on unexpected clock codes in timeclock format
Fix missing case in pattern matching
2020-01-12 13:17:36 -08:00
Brian Wignall
ab12ff916f
Update "showPeriod" to use yyyy-mm-dd formatting
2020-01-07 15:58:54 -08:00
Brian Wignall
00eb0b3c8f
Make "stack test" pass again
2020-01-07 15:58:22 -08:00
Brian Wignall
35481a665b
Change Date output to yyyy-mm-dd
2020-01-07 15:58:22 -08:00
Stephen Morgan
74778efcf5
Use nubSort instead of nub . sort.
2020-01-04 08:31:10 -08:00
Stephen Morgan
38904372b2
Calculate MultiReportBalance columns more efficiently.
...
Only calculate posting date once for each posting, and calculate their
columns instead of checking each DateSpan separately.
2020-01-03 16:11:46 -08:00
Simon Michael
0b734be445
; silence safe 0.3.18's deprecation warnings for now
...
(max|min)imum(By)?Def are being replaced by (max|min)imumBound(By)?
but the old functions have the semantics I want and
I don't understand the new ones yet.
This can hide other deprecation warnings in this file,
and presumably the old functions will be removed later,
so this is temporary.
Cf https://github.com/ndmitchell/safe/issues/26
2019-12-28 15:52:32 -08:00
Simon Michael
c5537cedb5
;lib: drop more unnecessary toJSON calls
2019-12-27 15:49:42 -08:00
Simon Michael
7fa7ccc033
ToJSON instances for all (?) remaining data types, up to Ledger
2019-12-16 17:17:00 -08:00
Simon Michael
46d516e7a3
move JSON instances from hledger-web to hledger-lib
2019-12-16 17:17:00 -08:00
Simon Michael
c759c9b3de
;lib: fix some more warnings in Transaction
2019-12-09 06:08:03 -08:00
Simon Michael
13e6c7dfdf
lib: drop "assertion" alias for nullassertion
...
Perhaps we'll stick with the null* convention. Fixes a warning in Transaction.hs.
2019-12-09 06:08:03 -08:00
Simon Michael
a0b92e02b9
Revert "remove old fail compatibility imports that are obsolete ?"
...
They are needed with ghc <8.4, not for fail but for <> I think.
Try cleaning up again another time.
This reverts commit 318ce7eb07 .
2019-12-01 11:32:51 -08:00