Simon Michael
be5fc09ebb
;csv: refactor: more transactionFromCsvRecord cleanups
2020-02-27 00:41:10 -08:00
Simon Michael
93358d72b4
;csv: refactor transactionFromCsvRecord
2020-02-27 00:30:45 -08:00
Simon Michael
02f2e3bd9b
csv: refine unknown accounts more thoroughly, a better fix for #1192
2020-02-26 22:45:49 -08:00
Simon Michael
58bb0df5ab
csv: undo failed #1192 fix, causing "_unknown_" accounts; refactor
...
Restore the old logic, while also trying to clarify this
transaction-generating code, and add some tests.
See also #1198 .
2020-02-26 21:46:11 -08:00
Simon Michael
fb788a64e8
;csv: cleanups, drop match operator for now
2020-02-26 11:52:47 -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
99aec9d476
;csv: doc: use field matchers in manual examples
...
[ci skip]
2020-02-26 09:38:30 -08:00
Simon Michael
d537f1fe07
csv: allow single field matching; more docs and tests
2020-02-26 08:55:55 -08:00
Simon Michael
becd891dd1
;csv: Matcher type, simplify
2020-02-25 13:44:45 -08:00
Simon Michael
1cbce98a68
;csv: refactor, ConditionalBlock ADT
2020-02-25 13:44:45 -08:00
Simon Michael
2a5f7819af
bs,cf,is,bal,print,reg: support json output format
2020-02-24 17:49:53 -08:00
Simon Michael
7f16d23898
;refactor: extract --value=then error message
2020-02-24 17:49:53 -08:00
Simon Michael
7ec25da13a
web: edit/upload: normalise line endings, avoiding parse errors ( #1194 )
...
Renamed: writeValidJournal -> writeJournalTextIfValidAndChanged
Added comments clarifying line ending behaviour of:
add, import, appendToJournalFileOrStdout, readFilePortably,
writeFileWithBackupIfChanged, writeJournalTextIfValidAndChanged
Summary of current behaviour:
- hledger add and import commands will append with (at least some)
unix line endings, possibly causing the file to have mixed line
endings
- hledger-web edit and upload forms will write the file with
the current system's native line endings, ie changing all
line endings if the file previously used foreign line endings.
2020-02-24 14:04:44 -08:00
Simon Michael
696ec4998b
;doc: regen help/manuals
...
[ci skip]
2020-02-22 11:40:41 -08:00
Simon Michael
2d90074b2e
;csv: avoid a potential display of internal placeholder ( #1192 )
...
With a multicommodity amount, the unknown account name will always be
"expenses:unknown".
2020-02-15 14:02:53 -08:00
Simon Michael
017d3355f8
csv: allow manual assignment of "expenses:unknown" again ( fix #1192 )
2020-02-15 13:52:59 -08:00
Simon Michael
7359fdd32a
;doc:journal: edits ( #1187 )
...
[ci skip]
2020-02-11 10:38:08 -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
9112e077ba
;doc: journal: edits ( #1187 )
...
[ci skip]
2020-02-11 10:18:39 -08:00
Simon Michael
0b2349c28f
;doc: journal: fix D example ( #1187 )
...
[ci skip]
2020-02-11 10:09:20 -08:00
Simon Michael
8ff225920a
;doc: journal: update D doc ( #1187 )
...
[ci skip]
2020-02-11 10:06:36 -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
ae9d8d6e56
;add then and t to --value's error message
...
[ci skip]
2020-02-10 12:40:02 -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
0f5f573db7
;doc: journal: fix wrong account type: value (hledger_site/#20)
...
[ci skip]
2020-02-08 12:44:54 -08:00
Simon Michael
4d94a5273b
;doc: manuals: whitespace cleanup
...
Remove a bunch of trailing whitespace with M-x whitespace-cleanup.
Except for examples showing hledger output, which might be tested
with shelltest some day, so stripping that whitespace might be problematic.
[ci skip]
2020-02-08 12:44:54 -08:00
Simon Michael
98d0cc9c17
;doc: regen manuals
...
[ci skip]
2020-02-08 11:56:03 -08:00
Simon Michael
54e633e186
;doc: hledger, journal, csv: consistent use of pipe tables
...
For consistency, ease of editing, and to fix unwanted content display
when cycling visibility in markdown-mode.
[ci skip]
2020-02-08 11:52:18 -08:00
Simon Michael
e3ab3b9985
;doc: regen all manuals, bumping month
...
[ci skip]
2020-02-08 11:20:25 -08:00
Simon Michael
fd64d7bb3a
;doc: regen manuals
...
[ci skip]
2020-02-07 10:45:57 -08:00
Simon Michael
4dc82fc2b3
;doc: journal: comments
...
[ci skip]
2020-02-05 19:41:07 -08:00
Simon Michael
088e253eff
;doc: journal: note quotes needed in auto posting queries ( #1185 )
...
[ci skip]
2020-02-03 10:37:30 -08:00
Simon Michael
bb6e1e3ce2
;lib: export textQuoteIfNeeded
...
[ci skip]
2020-02-03 10:10:46 -08:00
Simon Michael
56b51c1961
;lib: couple of doctests
...
[ci skip]
2020-02-03 10:10:32 -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
b3711488a7
lib: apply canonical display styles to auto posting amounts too
2020-01-31 06:00:06 -08:00
Simon Michael
fccd88149d
;lib: refactor, clarify finaliseJournal a bit
2020-01-31 05:39:16 -08:00
Simon Michael
c67ffedea5
;doc: journal: more cleanups to intro, secondary dates
...
[ci skip]
2020-01-29 08:42:04 -08:00
Simon Michael
06a54f70b0
;doc: regen manuals
...
[ci skip]
2020-01-29 08:27:29 -08:00
Simon Michael
150a74c5a0
;doc: journal: reorg; rewrite transactions, simple & secondary dates
...
[ci skip]
2020-01-29 08:26:00 -08:00
Simon Michael
c920bd3169
;doc: journal: virtual postings rewrite
...
[ci skip]
2020-01-29 07:09:54 -08:00
Simon Michael
181de60ff7
;doc: journal: hide FILE FORMAT heading on web; move editor info
...
[ci skip]
2020-01-29 06:13:35 -08:00
Simon Michael
93644a52ba
;doc: journal: layout fix
...
[ci skip]
2020-01-27 12:53:12 -08:00
Simon Michael
7011160bfd
;allow base 4.14/GHC 8.10
2020-01-26 08:12:25 -08:00
Simon Michael
b1de2f2308
;doc: drop redundant version message from web manuals
...
[ci skip]
2020-01-25 19:33:12 -08:00
Simon Michael
24c6828a5c
;doc: regen manuals
...
[ci skip]
2020-01-25 17:10:34 -08:00
Simon Michael
490ab140cd
;doc: timedot: drop FILE FORMAT heading
...
[ci skip]
2020-01-25 17:10:10 -08:00
Simon Michael
444c4342ed
;doc: manuals: hide NAME/SYNOPSIS/DESCRIPTION headings in web manuals
...
[ci skip]
2020-01-25 16:57:51 -08:00
Simon Michael
9710c86c7f
;doc: regen manuals
...
[ci skip]
2020-01-22 12:52:41 -08:00
Simon Michael
5f7ae2ced6
;lib: Amount: export mixedAmountStripPrices
2020-01-22 11:57:42 -08:00
Simon Michael
9874d29953
;doc: journal: 2 spaces required in same line account comments ( #1182 )
...
[ci skip]
2020-01-22 05:42:22 -08:00
Simon Michael
090f65ec83
;doc: regen manuals
...
[ci skip]
2020-01-20 18:02:42 -08:00
Simon Michael
64546cd54a
lib: export mapMixedAmount
2020-01-20 18:01:33 -08:00
Simon Michael
80ab45984b
csv: also recognise .tsv, .ssv extensions; document thoroughly ( #1179 )
2020-01-20 12:58:47 -08:00
Simon Michael
42dfde141a
;doc: changelogs: update from 1.16.2, cleanups
2020-01-14 11:19:05 -08:00
Simon Michael
dba0b117f4
;doc: draft changelogs
2020-01-14 10:08:59 -08:00
Simon Michael
445e8aa3cc
add support for megaparsec 8 ( #1175 )
2020-01-14 09:54:06 -08:00
Brian Wignall
473b3376ab
;doc: update shell output in hledger*/*.m4.md to use ISO date formatting
2020-01-13 12:32:41 -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
Simon Michael
65efdea4c0
;doc: regen some manuals
...
[ci skip]
2020-01-07 16:24:51 -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
Simon Michael
be72497ebb
;doc: journal: corrections for D directive's scope ( #1170 )
...
[ci skip]
2020-01-07 07:38:51 -08:00
Aleksandar Dimitrov
3bf6ef9a8b
Update documentation on separators
2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
3ead97975c
Inline function, add debug statement
2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
9011aaa5ba
Refactor getSeparator
2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
92f680875f
Parse reserved words case insensitively
2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
8df4e1ed83
Remove --separator command line argument
2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
02d9205af7
Allow separator to be overridden from command line
...
This also fixes that parsing separators on the command line and the
rules file was not handled the same way.
2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
b524a088c7
Implement getting separator from rules
2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
32ccc3a2b2
Add directive
2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
ec0f55d18e
Add missing type signature
2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
b104b3b8a3
Explictly discard result
2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
42d585d20b
Refactor: rename variable
2020-01-05 14:45:57 -08:00
Aleksandar Dimitrov
63cda87e86
Whitespace
2020-01-05 14:45:57 -08:00
Simon Michael
07029047f5
;doc: regen manuals again
...
[ci skip]
2020-01-05 09:17:02 -08:00
Simon Michael
cfb2a61ae1
;bump to dev version; bump man page dates
...
[ci skip]
2020-01-05 09:04:50 -08:00
Simon Michael
f91076cc6a
;doc: regen manuals
...
I think all the non-content changes are due to newer
doc tools and harmless, including this one hopefully:
-.B \f[C]--watch\f[R]
+\f[B]\f[CB]--watch\f[B]\f[R]
[ci skip]
2020-01-05 07:06:42 -08:00
Simon Michael
ce5eccfbc0
;spelling fix
...
[ci skip]
2020-01-04 21:17:50 -08:00
Stephen Morgan
228edf6ba6
Don't store leaf name in PeriodReport.
...
Calculate at the point of consumption instead.
2020-01-04 21:15:42 -08:00
Stephen Morgan
2e20d0717f
lib: Generalise PeriodicReport to be polymorphic in the account labels.
2020-01-04 17:23:17 -08:00
Stephen Morgan
88dc619257
lib: Use records instead of tuples in PeriodicReport.
2020-01-04 17:23:17 -08:00
Stephen Morgan
beb8b6d7c8
lib: Use PeriodicReport in place of MultiBalanceReport.
2020-01-04 17:23:17 -08:00
Stephen Morgan
74778efcf5
Use nubSort instead of nub . sort.
2020-01-04 08:31:10 -08:00
Simon Michael
390cea7f7c
;doc: note that -I does not disable balance assignments
...
[ci skip]
2020-01-04 08:22:45 -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
Stephen Morgan
b9b16da8ed
Correct finding latest date in queryEndDate Or queries and simplify date
...
comparison code.
2019-12-24 05:04:51 -08:00
Brian Wignall
2852f9dbee
Fix typos
2019-12-21 12:09:05 -08:00
Simon Michael
4266db5633
;csv: doc: document balance-type
...
[ci skip]
2019-12-20 10:41:24 -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
47567cd770
;fix some warnings with GHC 8.10 alpha
...
hledger is GHC 8.10 ready!
2019-12-14 17:30:19 -08:00
Simon Michael
2a2f08bb58
;doc: csv: mention that fields rule's separator != csv separator
...
[ci skip]
2019-12-14 14:00:59 -08:00
Simon Michael
2825a06e8e
;doc: csv: expand help on other separator characters
...
[ci skip]
2019-12-14 13:57:48 -08:00
Simon Michael
f099fb558e
;doc: csv: mention entr for rapid feedback
...
[ci skip]
2019-12-09 14:46:02 -08:00
Simon Michael
95aa2e16cc
;doc: fix some old wiki and Cookbook references (hledger_site/#10)
2019-12-09 06:08:03 -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
Jacek Generowicz
29211868bb
Fix issue 457
...
Issue #457 pointed out that commands such as
hledger ui 'amt:>200'
failed. This was becasue the process of dispatching from `hledger ui`
to `hledger-ui` (note addition of `-`) lost the quotes around
`amt:>20` and the `>` character was interpreted as a shell redirection
operator, rather than as part of the argument.
The machinery for quoting or escaping arguements which cointain
characters which require quoting or escaping (thus far whitespace and
quotes) already existed. This solution simply adds shell stdio
redirection characters to this set.
Fixes #457
2019-12-08 18:33:43 +01:00
Simon Michael
5a2bcecf26
;doc: finalise changelogs
2019-12-03 08:41:44 -08:00
Simon Michael
06b70194c0
;doc: regen manuals
2019-12-03 08:41:44 -08:00
Simon Michael
093dca570d
lib, cli, web: bump version to 1.16.1
2019-12-03 08:41:44 -08:00
Simon Michael
6ae837f820
;doc: changelogs
2019-12-03 08:41:44 -08:00
Simon Michael
e032eff8eb
;doc: changelog updates
2019-12-02 08:59:58 -08:00
Simon Michael
0ce890e5ff
lib, cli, web: drop unnecessary mtl-compat dependency
2019-12-02 08:23:00 -08:00
Simon Michael
62a9e1aa62
;lib: clarify Hledger.Read imports a little
2019-12-02 08:21:06 -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
Simon Michael
d922b6e798
;doc: regen manuals
2019-12-01 10:12:29 -08:00
Simon Michael
6daebf60ea
;regen cabal files
2019-12-01 10:05:37 -08:00
Simon Michael
87d0491103
;bump version to 1.16
2019-12-01 10:03:58 -08:00
Simon Michael
c90c0867c4
;doc: changelogs
...
[ci skip]
2019-12-01 09:59:01 -08:00
Simon Michael
4b66bc2ed9
lib: disable doctest suite again till we can run it with cabal ( #1139 )
2019-12-01 09:13:18 -08:00
Simon Michael
318ce7eb07
remove old fail compatibility imports that are obsolete ?
2019-12-01 08:31:50 -08:00
Simon Michael
279e9624ed
;lib: clarify docs for setFullPrecision, setNaturalPrecision
2019-11-30 16:56:45 -08:00
Simon Michael
a081404bd7
;doc: journal: rewrite commodity directive doc
...
[ci skip]
2019-11-30 08:34:13 -08:00
Simon Michael
359a118900
;doc: draft changelog updates
...
[ci skip]
2019-11-29 07:57:54 -08:00
Simon Michael
caf8cdf0ca
;test: consistent singular naming for test suites and files
2019-11-29 06:35:29 -08:00
Simon Michael
c7574b8005
;lib, cli: test suite cleanups, don't run hledger-lib tests twice
2019-11-29 06:11:25 -08:00
Simon Michael
2b2a0b3cf8
;tests: use "test" alias for testCase everywhere
...
Easier to type and read, and a little clearer to my eyes;
"testCase" implies a single case, but it can contain many assertions.
2019-11-28 15:33:33 -08:00
Simon Michael
030b633cd6
;fix build issues with old GHC versions
2019-11-28 15:22:12 -08:00
Simon Michael
ebedae01cf
;cabal: remove special cases for unsupported GHC 7
2019-11-28 14:59:18 -08:00
Simon Michael
08951ac3e8
;cabal: add ghc 8.8 to tested-with
...
[ci skip]
2019-11-28 14:59:10 -08:00
Simon Michael
ca4fade4af
;tests: re-add hledger-lib's tests to the cabal file, as unittests
2019-11-28 14:45:10 -08:00
Simon Michael
5dac8af2ef
;ui: fix build error due to tests rewrite
2019-11-27 21:54:31 -08:00
Simon Michael
4faefcfab2
;doc: regen manuals
...
[ci skip]
2019-11-27 13:18:08 -08:00
Simon Michael
b36f6df110
tests: port all unit tests to tasty, second pass ( #1090 )
...
Hledger.Util.Tests helpers have been cleaned up, and test names are
now shown.
Tests have been cleaned up a bit. Some groups of unnamed tests have
been collapsed into a single named test containing a sequence of
assertions. The test command counts named tests, not assertions, so
the reported unit test count has dropped from 199 to 188.
2019-11-27 13:17:34 -08:00
Simon Michael
13a3542464
tests: port all unit tests to tasty, first cut ( #1090 )
...
easytest is not actively maintained and requires an old version of
hedgehog which does not support base-compat 0.11 & ghc 8.8.
This is still using the old easytest helpers, and not displaying test
names properly.
2019-11-27 12:43:43 -08:00
Simon Michael
3f0892556d
;lib: clarify choiceopt doc
2019-11-23 13:03:26 -08:00
Simon Michael
0beca72275
;csv: doc: one-posting txns can now be generated (#1111/#1133)
...
[ci skip]
2019-11-23 12:28:41 -08:00
Dmitry Astapov
aa051a05cf
lib: support generation of (un)balanced virtual postings in csv reader
2019-11-23 10:28:10 -08:00
Simon Michael
332624f9fa
ui: B and V keys toggle display of cost, value
2019-11-21 17:33:04 -08:00
Brian Wignall
f8269e21ab
Fix some simple typos
2019-11-20 13:33:33 -08:00
Mykola Orliuk
2a36ac0d62
;lib: fix doctest for RawOptions
2019-11-19 20:43:19 +01:00
Simon Michael
f0b2eed6c2
;lib: clarify test suites recompilation workaround ( #1125 )
...
[ci skip]
2019-11-19 04:10:46 -08:00
Mykola Orliuk
f82ed83153
;lib: re-enable easytests
2019-11-19 03:58:56 -08:00
Mykola Orliuk
097486a247
;lib: re-enable doctests
2019-11-19 03:58:56 -08:00
Mykola Orliuk
5287fe671b
;all: hide RawOpts internals
...
This way we can ensure we always use only functions from RawOptions.
2019-11-18 17:38:39 -08:00
Mykola Orliuk
31ae3d3aaf
;lib: drop SystemString left from GHC pre 7.2
...
We are relying on base-4.9 or newer. Thus we don't compile anymore with
GHC version lower than 8.0.1.
2019-11-18 17:38:39 -08:00
Simon Michael
68b1cacf0f
lib: refactor, prepare to drop showTransactionUnelided functionality
...
It seems we don't use it at all, and ony says it's not robust with
prices either.
Merge remote-tracking branch 'ony/chores/drop-elide-in-showTransaction'
2019-11-18 17:27:30 -08:00
Simon Michael
4cb2a03f7f
;lib: more docs for unifyMixedAmount
...
[ci skip]
2019-11-18 17:22:42 -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
Mykola Orliuk
aca214b0ac
lib: drop amount elision in showing last posting
...
This behavior is highly depends on journal. If we want to re-introduce
it we'd better re-consider how transaction entry can be "simplified".
I.e. besides dropping last amount we may drop prices that can be assumed
implicitly.
Note that there is no need to knit it into showTransaction since it
easily achievable with pre-processing (similar to implicit balances
etc).
2019-11-16 12:53:07 +01:00
Dmitry Astapov
c4d650e6ad
lib: balance-style -> balance-type
2019-11-13 09:06:25 -08:00
Dmitry Astapov
39bc183340
lib: csv reader gets balance-style directive
2019-11-13 09:06:25 -08:00
Simon Michael
fb3c1a132c
csv: fix parsing of whitespace on line after an if block ( fix #1120 )
2019-11-13 05:41:32 -08:00
Simon Michael
9b74471d02
;doc: regen csv manuals
...
[ci skip]
2019-11-12 13:32:35 -08:00
Simon Michael
470b5aca7b
;csv: doc: fix typo
...
[ci skip]
2019-11-12 13:32:05 -08:00
Simon Michael
dbe8638ba2
;csv: doc: remove currencyN/amount limitation ( #1113 )
...
[ci skip]
2019-11-12 13:24:59 -08:00
Dmitry Astapov
94f912e558
lib: better resolution of csv field aliases ("balance" vs "balance1", etc)
2019-11-12 12:20:09 -08:00
Simon Michael
205ff9d2d6
;csv: doc: more cleanups, consistency
...
[ci skip]
2019-11-12 12:04:57 -08:00
Simon Michael
8b237cd4a0
;csv: doc: reorder sections, greatly expand examples
...
too much ?
[ci skip]
2019-11-12 10:37:17 -08:00
Simon Michael
4eeb8f6264
;csv: doc: more cleanups, note some limitations
...
[ci skip]
2019-11-11 18:29:36 -08:00
Simon Michael
01823d6329
;csv: doc: testing/cleanup pass
...
[ci skip]
2019-11-11 18:10:09 -08:00
Simon Michael
d4cddc5402
;csv: doc: another currency clarification, posting fields cleanup
...
[ci skip]
2019-11-10 18:33:50 -08:00
Simon Michael
a8f1f5da62
;csv: doc: more notes about currency ( #1095 )
...
[ci skip]
2019-11-09 09:53:05 -08:00
Simon Michael
7200c2c4da
;doc: changelog update
...
[ci skip]
2019-11-07 19:28:52 -08:00
Simon Michael
c4d7cc198a
csv: finalise and check journals generated from CSV ( #1000 )
...
Invalid transactions generated from CSV will now be rejected.
I updated some csv tests to avoid this, except for 21, which
probably needs more cleanup.
2019-11-07 18:58:12 -08:00
Simon Michael
5264a7ebc1
;lib: refactor, split out finaliseJournal
2019-11-07 18:08:41 -08:00
Simon Michael
3f530f5b54
;doc: update changelogs, including #1095
...
[ci skip]
2019-11-07 16:37:03 -08:00
Simon Michael
6e951962f9
;csv: doc: cleanups
...
[ci skip]
2019-11-06 18:42:39 -08:00
Simon Michael
7ecc42f142
;doc: regen manuals
...
[ci skip]
2019-11-06 13:15:17 -08:00
Simon Michael
d92351e21a
csv: doc: clean up/expand manual after #1095
...
[ci skip]
2019-11-06 13:15:17 -08:00
Dmitry Astapov
fc001da1ef
lib: expenses:unknown is a much better default account name
2019-11-05 21:16:42 +00:00
Dmitry Astapov
09f17f2b2b
doc: mention the magic sauce
2019-11-05 21:16:42 +00:00
Dmitry Astapov
c66ccc5cee
lib: do not try to balance transaction in csv reader
2019-11-05 21:16:42 +00:00
Dmitry Astapov
95ec5715cc
lib: better compatibility code in csv reader
2019-11-05 21:16:42 +00:00
Dmitry Astapov
d62f84bec2
lib: csv reader does not generate postings if account=""
2019-11-05 21:16:42 +00:00
Dmitry Astapov
a6d91da217
doc: remove "you need to create at least 1 posting" bit
2019-11-05 21:16:42 +00:00
Dmitry Astapov
44f01cbd94
docs: revert advise on account, postpone for now
2019-11-05 21:16:42 +00:00
Dmitry Astapov
91eb899b82
doc: advise on the default account selection
2019-11-05 21:16:42 +00:00
Dmitry Astapov
4b30a70c72
doc: posting1 is not magical in csv rules
2019-11-05 21:16:42 +00:00
Dmitry Astapov
8d24a40150
lib: csv parser fills out amounts on all postings, if possible
2019-11-05 21:16:42 +00:00
Dmitry Astapov
637741a755
lib: amount1 is no longer magical
2019-11-05 21:16:42 +00:00
Dmitry Astapov
977592e49c
lib: typo fix, "expense:unknown" -> "expenses:unknown"
2019-11-05 21:16:42 +00:00
Dmitry Astapov
3c7d5d466d
lib, doc, test: csv parser gains "end" command for "if" block
2019-11-05 21:16:42 +00:00
Dmitry Astapov
3e5f0e8dd5
doc: clarify csv rules application order
2019-11-05 21:16:42 +00:00
Dmitry Astapov
f92590f92c
lib: allow zero postings in csv reader
2019-11-05 21:16:42 +00:00
Dmitry Astapov
26a4f5e519
doc: less confusing example
2019-11-05 21:16:42 +00:00
Dmitry Astapov
cb6a5fc4a1
doc: proofreading csv parser docs
2019-11-05 21:16:42 +00:00
Dmitry Astapov
1ab8631264
lib: change default rules file text to mention "amount1"
2019-11-05 21:16:42 +00:00
Dmitry Astapov
32cbe4c7b3
lib: better inference for unknown account names in csv parser
2019-11-05 21:16:42 +00:00
Dmitry Astapov
b5d4918c16
lib: allow recursive interpolation of fields with underscores in names
2019-11-05 21:16:42 +00:00
Dmitry Astapov
38db7eb24d
lib: implement skip end in csv reader
2019-11-05 21:16:42 +00:00
Dmitry Astapov
b2ba1086b6
lib: fixed validation rules for minimul viable csv rules to include account1 etc
2019-11-05 21:16:42 +00:00
Dmitry Astapov
f1ab107400
lib, doc: extended "skip" in "if" body to "skip N"
2019-11-05 21:16:42 +00:00
Dmitry Astapov
f877a7789f
doc: further clarify posting generation
2019-11-05 21:16:42 +00:00
Dmitry Astapov
a2bd1ceb61
doc: close todos mentioned in csv parser description, more details
2019-11-05 21:16:42 +00:00
Dmitry Astapov
5d207ddd05
doc: describe changes to csv parser
2019-11-05 21:16:42 +00:00
Dmitry Astapov
f108b52171
lib: fix for #1001 - empty field assignment consumes next line
2019-11-05 21:16:42 +00:00
Dmitry Astapov
5dac141a7e
lib: implement conditional line skips in csv ( fixes #1076 )
2019-11-05 21:16:42 +00:00
Dmitry Astapov
f74df08e98
lib: fix accidental switch of income:unknown and expence:unknown in csv parser
2019-11-05 21:16:42 +00:00
Dmitry Astapov
77fa81ea4d
lib: fix error message formatting (header displayed twice)
2019-11-05 21:16:42 +00:00
Dmitry Astapov
825b9ce5b3
lib: fixed amount vs amount1 conflict detection in csv parser
2019-11-05 21:16:42 +00:00
Dmitry Astapov
24bba96ea2
lib: more robust multi-line joining in csv parser
2019-11-05 21:16:42 +00:00
Dmitry Astapov
881422cd0f
lib: fix recursive interpolation in CSV parser for fields with dashes
2019-11-05 21:16:42 +00:00
Dmitry Astapov
e4476dd2f1
lib: more robust "unknown" account assignment in csv parser
2019-11-05 21:16:42 +00:00
Dmitry Astapov
28ca65b99a
lib: more explicit conditions for using legacy csv parser
2019-11-05 21:16:42 +00:00
Dmitry Astapov
e4add6df83
lib: fix for multiline descriptions in csv ( fixes #841 , #416 )
2019-11-05 21:16:42 +00:00
Dmitry Astapov
9aab476d53
lib: csv parser supports up to 9 postings. Fixes #570 , #627
2019-11-05 21:16:42 +00:00
Simon Michael
445adbe9d1
;doc: regen manuals
...
[ci skip]
2019-10-23 12:30:27 -07:00
Simon Michael
312e772468
prices: style price amounts; always show full precision
2019-10-20 07:09:34 -07:00
Simon Michael
b598f30a8a
;lib: styleAmountExceptPrecision
2019-10-20 07:08:45 -07:00
Simon Michael
2e3b51c03f
;lib: journalConvertAmountsToCost -> journalToCost
2019-10-19 19:58:27 -07:00
Simon Michael
54e1caebf1
;lib: refactor journalConvertAmountsToCost
2019-10-19 19:53:05 -07:00
Simon Michael
905149df86
;lib: transaction valuation helpers
2019-10-19 19:41:21 -07:00
Simon Michael
de0a6b1e62
;lib: Transaction: as Map -> as M
2019-10-19 19:17:35 -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
96e9b1595d
;csv: doc: clarify skip's behaviour
...
[ci skip]
2019-10-18 11:14:43 -07:00
Simon Michael
eff1b31c86
csv: allow csv records with varying lengths, padding with empties
...
Sometimes trailing empty fields are omitted entirely (including the
commas) in CSV records. (I see this in exported Google spreadsheets.)
Now we don't raise an error in this case, instead we automatically pad
any "short" records with empty fields. Not yet well tested.
2019-10-07 14:54:36 -10:00
Simon Michael
6dcddadd9f
;journal: in generated-transaction:/posting: tags, add a space before the value
2019-10-07 14:54:36 -10:00
Simon Michael
40c089dcfc
;doc: regen manuals
...
[ci skip]
2019-10-07 14:54:36 -10:00
Simon Michael
f1420cc770
;doc: journal: oh, we can declare the null commodity
...
[ci skip]
2019-09-27 17:58:46 -10:00
Simon Michael
16973ce296
;lib: fix journalInferCommodityStyles debug message
2019-09-27 18:51:37 -07:00
Simon Michael
58a313165c
;journal: infer amount styles more carefully, fix wrong output ( #1091 )
...
Certain journal entries could trigger a bug where we displayed amounts
with the same character for digit group mark and decimal mark. Now if
a comma or period digit group mark is detected, that forces the
decimal mark to be the other character.
2019-09-27 15:40:36 -10: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
fd8c6935e8
;doc: regen manuals
...
[ci skip]
2019-09-27 14:32:59 -10:00
Simon Michael
64f49a8c02
;doc: journal: rewrite Amounts; switch to "digit group mark" term ( #1091 )
2019-09-27 14:25:32 -10:00
Simon Michael
b754abc36b
;lib: commodityStylesFromAmounts: simplify, disable #1091 test
2019-09-26 18:06:22 -10:00
Simon Michael
4884213a3e
;lib: commodityStylesFromAmounts: a failing unit test for #1091
2019-09-25 23:08:00 -10:00
Simon Michael
7ffe38677a
;lib: parseAndFinaliseJournal: note txns order issue ( #1091 )
2019-09-25 23:07:22 -10:00
Simon Michael
6037d701b6
;lib: document RawNumber, AmbiguousNumber, DigitGrp ( #1091 )
2019-09-25 21:26:06 -10:00
Simon Michael
24ce2686f4
drop GHC 7.10/base 4.8 support, finally, due to MonadFail hassles
...
in JournalReader.hs. If you still need this, feel free to work on
those errors. But hopefully not, because dropping base 4.8 should
permit some code cleanups.
2019-09-14 03:45:37 -07:00
Simon Michael
977d4f009e
lib, cli: disable hledger-lib test suites, hledger benchmark suite
...
by default. hledger-lib's doctests and easytests test suites (each ?)
require an additional slow rebuild of hledger-lib and are not worth
the time, energy and carbon. hledger's test suite runs those same
easytest tests (but not the doctests).
2019-09-14 03:45:37 -07:00
Simon Michael
180f4baedb
;lib: csv: note cause of #1087
...
[ci skip]
2019-09-14 03:45:37 -07:00
Simon Michael
f92b2fe6ef
;lib: csv: refactor: clarify, get rid of some IO/ExceptT
...
Rule parsing doesn't need IO (since we are doing expandIncludes as a
pre-parsing step).
2019-09-14 03:45:37 -07:00
Simon Michael
3c05662ce2
;lib: csv: clarify confusing imports
2019-09-13 18:11:40 -07:00
Simon Michael
46caa1d4ef
;lib: csv: rename error-prone default rules
2019-09-13 17:51:14 -07:00
Simon Michael
a0deb88796
;doc: regen manuals
...
[ci skip]
2019-09-13 11:00:03 -07:00
Simon Michael
f65fc47185
;bump version to 1.15.99
...
[ci skip]
2019-09-13 08:43:33 -07:00
Simon Michael
e851bdf834
;doc: changelogs
...
[ci skip]
2019-09-13 08:43:33 -07:00
Simon Michael
af21ae6eb6
;doc: regen manuals
...
Wrapping and hyphenation has changed again, which I thought would
be more stable now with same tool versions on laptop and server.
Who knows.
2019-09-13 08:43:33 -07:00
Dmitry Astapov
568cb32677
lib: more runPeriodicTransaction tests (lifted from #1085 and spanIntervalIntersect)
2019-09-11 16:09:28 -07:00
Dmitry Astapov
e9d300bef3
lib: dont raise when there is neither budget nor transactions in the report period
2019-09-11 16:09:28 -07:00
Dmitry Astapov
cf74972148
bin: improve debug output for budger report (show budget txns)
2019-09-11 16:09:28 -07:00
Dmitry Astapov
cf4029a5ed
lib: fix generation of periodic transactions with days/months/... repeat
2019-09-11 16:09:28 -07:00
Simon Michael
acd7010e5a
;doc: "curses-style interface" -> "terminal interface"
...
[ci skip]
2019-09-10 18:14:16 -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
85d48a6b0e
;doc: regen manuals (on server)
...
Usually done on my laptop, but the toolchain on both machines should
produce the same result these days..
[ci skip]
2019-09-09 08:04:26 -07:00
Simon Michael
fb521e248b
;doc: journal: periodic transactions: more tweaks
...
[ci skip]
2019-09-09 08:02:22 -07:00
Simon Michael
94d3eb1cfb
;doc: journal: periodic transactions: more fixes, clarifications
...
[ci skip]
2019-09-09 07:45:09 -07:00
Simon Michael
901e5174d7
;doc: journal: highlight some gotchas with periodic transactions
...
[ci skip]
2019-09-09 07:10:26 -07:00
Simon Michael
3b35e0afca
;site: manuals: fix many links that went to a prerelease manual
...
[ci skip]
2019-09-09 06:24:08 -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
c7746131fc
;lib: clarify parser monad transformers a little
...
[ci skip]
2019-09-08 10:40:47 -07:00
Simon Michael
89c3011df4
;doc: 1.15.2 changelogs
...
[ci skip]
2019-09-05 15:35:59 -07:00
Simon Michael
7ae75022bf
;doc: regen manuals
2019-09-05 15:35:44 -07:00
Simon Michael
cd5af48165
lib, cli: bump version to 1.15.2
2019-09-05 15:35:19 -07:00
Simon Michael
a7f172b085
valuation: -V/-X respects report end date, code/doc cleanups ( #1083 )
...
-V (and -X) now respects a report end date set with -e/-p/date: when
choosing the valuation date, similar to hledger 1.14 and Ledger.
This means that -V/-X aren't exactly like either --value=end or
--value=now. The "Effect of --value on reports" doc has been extended
accordingly, and much of it has been reworded and made more accurate.
2019-09-05 13:41:36 -07:00
Simon Michael
6d4d43dc62
;lib, cli: fix 1.15.1 changelog heading
...
[ci skip]
2019-09-02 12:53:51 -07:00
Simon Michael
90e5a5f95b
;lib, cli: don't forget to commit the cabal file
2019-09-02 12:31:06 -07:00
Simon Michael
08e011af37
lib: note doctests fix (omitted from 1.15), bump to 1.15.1
2019-09-02 12:25:29 -07:00
Simon Michael
16a3c96da0
;doc: regen manuals
...
[ci skip]
2019-09-02 11:11:56 -07:00
Simon Michael
e9c28fd9a3
;doc: journal: drop unused file
...
[ci skip]
2019-09-02 06:10:22 -07:00
Simon Michael
b919c92892
;doc: journal: change some comments to avoid confusing markdown-mode
...
[ci skip]
2019-09-02 06:09:35 -07:00
Simon Michael
ede6a51f08
;doc: finalise changelogs
...
[ci skip]
2019-09-01 08:53:06 -07:00
Simon Michael
00f3ad8d3f
;doc: changelogs
...
[ci skip]
2019-09-01 08:53:06 -07:00
Simon Michael
b1859769ac
;doc: regen man pages
...
[ci skip]
2019-09-01 08:53:06 -07:00
Simon Michael
29f7654c3a
bump versions to 1.15
2019-09-01 08:53:06 -07:00
Simon Michael
095badd7f9
;fix doctests
2019-08-31 17:15:48 -07:00
Simon Michael
c2736be4aa
;doc: changelogs
...
[ci skip]
2019-08-30 21:26:23 -07:00
Simon Michael
f55985eb9b
;site: stop using pandoc's fenced_code_attributes
...
[ci skip]
2019-08-26 18:41:33 -07:00
Simon Michael
da6718806a
;doc: don't add page TOCs any more, sphinx has it covered
...
[ci skip]
2019-08-26 09:37:03 -07:00
Simon Michael
5925808108
lib, web: unhide exports, fix build
2019-08-19 12:30:54 +01:00
Simon Michael
8a7905ac73
;doc: changelogs
...
[ci skip]
2019-08-19 12:03:54 +01:00
Simon Michael
11519744d8
;lib: Valuation: hide some exports
2019-08-19 11:59:32 +01:00
Simon Michael
62e96b1b20
;lib: move PriceGraph, PriceOracle, ValuationType to Valuation.hs
2019-08-19 02:21:30 +01:00
Simon Michael
1cbbe8f43d
memoise market valuation, making it fast ( #999 )
2019-08-19 02:16:39 +01:00
Simon Michael
4beb416070
lib: currying helpers
2019-08-19 02:09:27 +01:00
Simon Michael
7177f533b2
;lib: pricesAtDate: refactor
2019-08-01 18:31:39 +02:00
Simon Michael
c14f22b975
;lib: depend on timeit
...
Allows easy benchmarking at ghci prompt and I expect will be used for
reporting timing info later.
2019-08-01 18:31:39 +02:00
Simon Michael
70986769ef
;lib: derive NFData for MultiBalanceReport, PriceGraph for criterion
...
Allow these to be timed with criterion at ghci prompt.
2019-08-01 18:31:39 +02:00
Simon Michael
d193d757ea
;lib: multiBalanceReport: fix error message typo
2019-08-01 18:22:14 +02:00
Simon Michael
c7f9356fd1
;doc: edit changelogs
...
[ci skip]
2019-07-25 12:33:58 +01:00
Simon Michael
02ed4f5d04
;lib: intervalFromRawOpts: replace undefined with an error message
2019-07-25 10:46:45 +01:00
Simon Michael
030a409dd3
;doc: update changelogs
...
[ci skip]
2019-07-25 08:48:01 +01:00
Simon Michael
35799142dd
Merge pull request #914 from simonmichael/rule-tags
...
tags for matching rule-generated txns and postings
2019-07-17 18:38:14 +01:00
Simon Michael
6e3a264f17
lib: export aliasnamep for hledger-check ( #1072 )
2019-07-16 23:30:15 +01:00
Simon Michael
e560afccd2
;lib: package.yaml comment cleanups
...
[ci skip]
2019-07-15 17:18:28 +01:00
Caleb Maclennan
11d9e5eb6a
code: Strip extraneous trailing whitespace from Haskell sources
2019-07-15 16:40:49 +01:00
Caleb Maclennan
7e332fda20
docs: Explain in more detail the parsing of the payee vs. notes fields
2019-07-15 08:22:16 +01:00
Simon Michael
6b61d1e0f1
;lib: move transactionNote/Payee to Transaction.hs
2019-07-15 08:22:16 +01:00
Simon Michael
a5372168bc
;lib: suppress doctest failures with GHC < 8.2
...
[ci skip]
2019-07-14 04:40:07 -07:00
Simon Michael
6f2f8d7638
;deps: a better fix for nubSortBy with ghc 7.10, 8.0
...
nubSortBy and nub . sortBy are not equivalent, it seems.
I didn't notice the failing valuation func tests.
2019-07-13 00:13:33 -07:00
Simon Michael
503d21ef77
;lib: also update fgl bounds in cabal file
2019-07-13 08:08:36 +01:00
Simon Michael
40dd5e41cb
;deps: bump fgl lower bound to fix ghc 7, 8.0 builds
2019-07-12 15:25:19 -07:00
Simon Michael
7d5f33441e
;doc: draft changelogs
...
[ci skip]
2019-07-12 23:24:10 +01:00
Simon Michael
a6e9b11a54
;cabal: bump tested-with, regen cabal files
...
[ci skip]
2019-07-12 23:24:10 +01:00
Simon Michael
ec310aea73
;lib: avoid nubSortBy which breaks ghc 7, 8.0 builds
2019-07-12 15:21:57 -07:00
Simon Michael
f8cc60d287
;csv: doc: link to #1051
...
[ci skip]
2019-07-08 08:02:54 +01:00
Simon Michael
5c3e4de647
;lib: periodFromRawOpts: clarify doc ( #1011 )
...
[ci skip]
2019-07-01 18:33:18 +01:00
Jakob Schöttl
e483faf7f0
Bugfix for #1011 : begin/end date options
2019-06-30 10:38:06 +02:00
Simon Michael
014db152d9
add, web: disallow unsafe trailing dot paths on windows ( fix #1056 )
...
On Windows, ensureJournalFileExists now rejects file paths
containing any problematic trailing dots, to prevent data loss.
This affects the add command and hledger-web's add form.
2019-06-26 18:19:53 +01:00
Simon Michael
2e4f047fed
;doc: journal: clarify alias docs ( #1055 )
...
[ci skip]
2019-06-23 15:56:29 -07:00
Simon Michael
d15f775695
;doc:journal: document alias application order more clearly ( #1055 )
...
[ci skip]
2019-06-21 12:12:35 -07:00
Simon Michael
33d03284c3
;valuation: more tests; document default amount style issue
...
[ci skip]
2019-06-17 08:19:23 -07:00
Simon Michael
2da50875ee
lib: setNaturalPrecisionUpTo
2019-06-14 19:04:09 -07:00
Simon Michael
5cb334514c
;lib: rename setMinimalPrecision -> setNaturalPrecision
2019-06-14 19:04:09 -07:00
Simon Michael
69defd497f
;lib: refactor: Data.Prices -> Data.Valuation
2019-06-14 19:04:09 -07:00
Simon Michael
83030a09de
;lib: Prices: refactor
2019-06-14 19:04:09 -07:00
Simon Michael
7dd0c5783a
;lib: multibalancereport: refactor
2019-06-14 19:04:09 -07:00
Simon Michael
0a3af8d9ee
csv: strip outer whitespace when interpolating CSV values ( #1051 )
...
This removes a potential snag in amount field assignments, and
hopefully is harmless and acceptable otherwise.
2019-06-14 16:43:12 -07:00
Simon Michael
d2b3185062
csv: don't show invalid inter-field spaces in CSV error messages
...
Errors involving a record like:
2000-01-01,a,"1"
displayed the record with extra spaces:
the CSV record is: "2000-01-01", "a", "1"
which was not accurate or valid RFC-4180.
2019-06-14 16:17:40 -07:00
Simon Michael
baa15d9bea
;lib: rename MultiBalanceReports.hs -> MultiBalanceReport.hs
2019-06-14 11:45:25 -07:00
Simon Michael
e664fab956
lib: try to simplify, use just one price graph ( #131 )
2019-06-13 15:50:01 -07:00
Simon Michael
dd5afbb6fe
;doc, debug output tweaks ( #131 )
2019-06-13 15:50:01 -07:00
Simon Michael
6a62bd6437
web, api: update for MarketPrice/PriceDirective change
2019-06-13 15:50:01 -07:00
Simon Michael
ce0354ddbe
lib: -X/--exchange now supports indirect price chains ( #131 )
...
Adds fgl as a dependency.
2019-06-13 15:50:01 -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
6b6c3385c9
lib: parse optional ,COMM suffix in --value ( #131 )
2019-06-13 15:50:01 -07:00
Caleb Maclennan
18e19b9ad2
;tests: normalize tests, examples, and docs using 2spcs before comments
2019-06-13 12:12:21 -07:00
Caleb Maclennan
8f3e5f9d3b
;print: differentiate posting indent (4spc) and pre-comment space (2spc)
...
Co-authored-by: Simon Michael <simon@joyful.com>
2019-06-13 12:12:21 -07:00
Henning Thielemann
4962b2696a
lib: accountTransactionsReportItems: rewrite using catMaybes and mapAccumL
...
I find the report function less convolved without the integrated recursion.
2019-06-09 18:45:58 -07:00
Simon Michael
88f3f6fc41
print: also canonicalise balance assertions' amount style ( fix #1042 )
2019-06-09 17:39:46 -07:00
Simon Michael
7ac1bdf8c1
;csv: document spaces outside quotes issue ( #1037 )
...
[ci skip]
2019-06-07 06:34:52 -07:00
Simon Michael
90af360792
csv: fix parse error printing, broken since 1.11 ( #1038 )
2019-06-06 23:10:31 -07:00
Simon Michael
45198d3faa
lib: debug helpers: add ptraceAtWith, dbgNWith
2019-06-02 08:48:41 -07:00
Simon Michael
42ce95aaef
; refactor: centralise valuation logic #131
2019-05-31 15:29:09 -07:00
Simon Michael
ad83919c6a
; lib: drop the Maybe from SummaryPosting
2019-05-31 15:29:09 -07:00
Simon Michael
69d72e8c48
;refactor amountValue
2019-05-25 05:34:29 -07:00
Simon Michael
bba9c32607
;doc: journal: clarify commodity directive does not affect parsing
...
[ci skip]
2019-05-25 05:29:49 -07:00
Simon Michael
34a0ad00b1
;lib: encapsulate Prices db
2019-05-25 05:29:34 -07:00
Simon Michael
aa99743096
make -V do --value=end in multiperiod reports ( #329 )
2019-05-24 10:30:35 -07:00
Simon Michael
ea5050963f
web: try to fix RegisterR warning
2019-05-23 22:34:31 -07:00
Simon Michael
5e54920160
;regen embedded manuals
2019-05-23 22:26:43 -07:00
Simon Michael
20bc386b80
restore TransactionsReport
...
hledger-web's register chart uses it, I didn't see it
because it's called from a hamlet template.
2019-05-23 22:15:40 -07:00
Simon Michael
7212b92079
cleanups ( #329 )
2019-05-23 22:07:50 -07:00
Simon Michael
54c1529638
lib: drop TransactionsReport, BalanceHistoryReport
...
They seem unused.
2019-05-23 21:55:19 -07:00
Simon Michael
04a30fa084
lib: TransactionsReport/AccountTransactionsReport cleanup
...
Split them into separate files, rename journalTransactionsReport to
transactionsReport.
2019-05-23 21:55:19 -07:00
Simon Michael
9977739c76
bal etc.: replace --value=transaction with --value=cost ( #329 )
2019-05-23 21:55:18 -07:00
Simon Michael
adbce22152
bal: --budget: don't always convert to cost
...
And don't show a percentage when budgeted and actual amounts are in
different commodities.
2019-05-23 21:55:18 -07:00
Simon Michael
2355da0f93
reg: replace --value=transaction with --value=cost
2019-05-23 21:55:18 -07:00
Simon Michael
ace215f5f3
print: replace --value=transaction with --value=cost
2019-05-23 21:55:18 -07:00
Simon Michael
37c0edb1f9
lib: drop postingValueAtDate
2019-05-23 21:55:18 -07:00
Simon Michael
4a75971c6d
lib: postingTransformAmount, postingToCost, postingValue
2019-05-23 21:55:17 -07:00
Simon Michael
e5cb082fb5
lib: amountToCost, mixedAmountToCost
2019-05-23 13:11:34 -07:00
Simon Michael
f999bf78e6
opts: new -B/--cost, -V/--market, --value flags ( #329 )
2019-05-23 13:11:20 -07:00
Simon Michael
e21afc466a
bal/bs/bse: -H or --cumulative now disables -T ( #329 )
...
To reduce confusion, multiperiod balance reports using -H/--historical
or --cumulative, which show end balances, no longer show a Totals
column since summing end balances generally doesn't make sense.
Also the underlying MultiBalanceReport now returns zero for those
totals when in cumulative or historical mode.
2019-05-11 20:43:28 -07:00
Simon Michael
76342a3fd0
bal/bs/cf/is: mention valuation type in report title
2019-05-09 15:39:43 -07:00
Simon Michael
e5339218f7
lib: valueTypeFromOpts helper
2019-05-09 15:36:26 -07:00
Simon Michael
d15869f855
;doc: typo
...
[ci skip]
2019-05-09 12:22:48 -07:00
Simon Michael
d77fd5743d
bal/bs/cf/is: support --value-at with -H; fix row/col/grand totals
...
This also includes a big cleanup of multiBalanceReport, which got
accidentally mingled.
2019-05-09 07:58:45 -07:00
Simon Michael
2ffe7914be
;improve valuation code docs
2019-05-07 16:19:49 -07:00
Simon Michael
74e653bfbc
;lib: declare Period exports
2019-05-06 11:52:10 -07:00
Simon Michael
72214a5747
reg: fix --value-at=transaction with -M ( #329 )
2019-05-06 08:07:16 -07:00
Simon Michael
ad00da244b
reg: support --value-at with -H ( #329 )
2019-05-05 17:47:38 -07:00
Simon Michael
2ba0281335
bal: fix --value-at for old-style single period balance reports ( #329 )
2019-05-05 10:51:07 -07:00
Simon Michael
629b590de1
;lib: cleanup
2019-05-05 10:38:13 -07:00
Simon Michael
76542458e6
lib: mapJournalTransactions, mapJournalPostings, mapTransactionPostings
2019-05-05 10:35:49 -07:00
Simon Michael
5a13bc632d
;clarify ledgerFromJournal doc
2019-05-05 10:09:40 -07:00
Simon Michael
1ad82d5b77
;lib: balanceReport cleanup
2019-05-05 09:57:03 -07:00
Simon Michael
f4b0381043
;lib: more docs for balanceReport
2019-05-05 09:50:29 -07:00
Simon Michael
8d7eacd73f
bal: support --value-at=p/t with multiperiod reports ( #329 )
2019-05-05 09:30:01 -07:00
Simon Michael
74c381cc88
;lib: more docs for multiBalanceReport
2019-05-04 17:46:52 -07:00
Simon Michael
66b1599058
;lib: postingsReport cleanup
2019-05-04 17:09:16 -07:00
Simon Michael
cc05f48697
;lib: multiBalanceReport cleanup
2019-05-04 12:34:59 -07:00
Simon Michael
12c0bfb39b
;lib: brValue cleanup
2019-05-04 12:22:00 -07:00
Simon Michael
ec1b98434c
reg: support --value-at=period with periodic reports ( #329 )
2019-05-04 12:22:00 -07:00
Simon Michael
dd8c403c81
;cli: option help tweaks
2019-05-04 12:22:00 -07:00
Simon Michael
cca0b7aec6
;update changelogs
2019-05-04 12:21:54 -07:00
Simon Michael
ebf5ed93f2
valuation: more thorough --value-at; document status ( #329 , #999 )
...
This feature turns out to be quite involved, as valuation interacts
with the many report variations. Various bugs/specs have been
fixed/clarified relating to register's running total, balance totals
etc. Eg register's total should now be the sum of the posting amount
values, not the values of the original sums. Current level of support
has been documented.
When valuing at transaction date, we once again do early valuation of
all posting amounts, to get more correct results. variants. This means
--value-at=t can be slower than other valuation modes when there are
many transactions and many prices. This could be revisited for
optimisation when things are more settled.
2019-05-03 12:24:02 -07:00
Simon Michael
696e3098c8
reg: support --value-at in register reports; cleanups, tests
2019-04-26 12:08:46 -07:00
Simon Michael
7306e61646
bal: support --value-at in single column balance reports
2019-04-26 12:08:32 -07:00
Simon Michael
00975fb226
bal*: support --value-at in multicolumn balance reports
2019-04-26 12:08:31 -07:00
Simon Michael
65934958f9
rename --value-date -> --value-at; --value-at implies -V
2019-04-26 12:08:31 -07:00
Simon Michael
6626778012
lib: amountValue, commodityValue doc cleanups
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
9d3eb8c069
bal, reg, print: -V prefers non-future valuation dates again ( #999 )
2019-04-24 08:31:21 -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
Simon Michael
c23fc8b671
speed up -V/--value by converting reports, not the journal ( #999 )
...
Instead of converting all journal amounts to value early on, we now
convert just the report amounts to value, before rendering.
This was basically how it originally worked (for the balance command),
but now it's built in to the four basic reports used by print,
register, balance and their variants - Entries, Postings, Balance,
MultiBalance - each of which now has its own xxValue helper.
This should mostly fix -V's performance when there are many
transactions and prices (the price lookups could still be optimised),
and allow more flexibility for report-specific value calculations.
+------------------------------------------++-----------------+-------------------+--------------------------+
| || hledger.999.pre | hledger.999.1sort | hledger.999.after-report |
+==========================================++=================+===================+==========================+
| -f examples/1000x1000x10.journal bal -V || 1.08 | 0.96 | 0.76 |
| -f examples/2000x1000x10.journal bal -V || 1.65 | 1.05 | 0.73 |
| -f examples/3000x1000x10.journal bal -V || 2.43 | 1.58 | 0.84 |
| -f examples/4000x1000x10.journal bal -V || 4.39 | 1.96 | 0.93 |
| -f examples/5000x1000x10.journal bal -V || 7.75 | 2.99 | 1.07 |
| -f examples/6000x1000x10.journal bal -V || 11.21 | 3.72 | 1.16 |
| -f examples/7000x1000x10.journal bal -V || 16.91 | 4.72 | 1.19 |
| -f examples/8000x1000x10.journal bal -V || 27.10 | 9.83 | 1.40 |
| -f examples/9000x1000x10.journal bal -V || 39.73 | 15.00 | 1.51 |
| -f examples/10000x1000x10.journal bal -V || 50.72 | 25.61 | 2.15 |
+------------------------------------------++-----------------+-------------------+--------------------------+
There's one new limitation, not yet resolved: -V once again can pick a
valuation date in the future, if no report end date is specified and
the journal has future-dated transactions. We prefer to avoid that,
but reports currently are pure and don't have access to today's date.
2019-04-23 17:39:01 -07:00
Simon Michael
9ac1d7869b
lib: journalStartDate, journalEndDate
2019-04-23 13:58:32 -07:00
Simon Michael
168edb910e
lib: try a single filter again to speed up -V; simplify a bit ( #999 )
...
There was no speedup, in fact.
2019-04-22 16:38:42 -07:00
Simon Michael
028303acd7
lib: speed up -V by sorting market prices just once ( #999 )
...
-V is still quite a bit slower than no -V, but not as much as before:
+===========================================================++=======+
| hledger.999.pre -f examples/10000x10000x10.journal bal || 5.20 |
| hledger.999.pre -f examples/10000x10000x10.journal bal -V || 57.20 |
| hledger.999 -f examples/10000x10000x10.journal bal || 5.34 |
| hledger.999 -f examples/10000x10000x10.journal bal -V || 17.50 |
+-----------------------------------------------------------++-------+
2019-04-20 13:12:53 -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
Simon Michael
13dc1096a5
reg: test and fix for --average, broken since 1.12 ( #1003 )
2019-04-06 11:00:38 -07:00
Simon Michael
71f9b74b0e
csv: doc: more tweaks ( #1000 )
...
[ci skip]
2019-04-06 10:51:18 -07:00
Simon Michael
bd08dd3858
csv: doc: more tweaks ( #1000 )
...
[ci skip]
2019-04-03 13:25:50 -07:00
Simon Michael
9f4decb4f6
csv: doc: clarify amount, balance tips ( #1000 )
...
[ci skip]
2019-04-03 13:14:59 -07:00
Simon Michael
61e8ccbf88
csv: accept a balance field assignment instead of an amount ( #1000 )
2019-04-03 10:46:26 -07:00
Simon Michael
c9e16b83ef
; propagate dev version bump
2019-03-20 17:13:59 -07:00
Simon Michael
124aaffd34
; merge latest changelogs
2019-03-20 16:18:04 -07:00
Simon Michael
3d206ad6bd
; changelogs from 1.14 branch
2019-03-20 16:18:04 -07:00
Simon Michael
fee0e39320
; lib, cli, ui, web, api: bump to dev version
2019-03-20 16:18:04 -07:00
Dmitry Astapov
5067d0f984
doc: document balance1 and balance2 in csv parser
2019-03-15 16:18:43 -07:00
Dmitry Astapov
3c3200fa66
lib: csv parser support for 'balance2', 'balance' renamed to 'balance1'
2019-03-15 16:18:43 -07:00
Hans-Peter Deifel
489b7fd870
Constrain easytest dependency to fix cabal build
...
This constraints the easytest dependency to <0.3, because hledger and
hledger-lib currently don't build with 0.3.
Of course the better solution would be to fix the build errors, but easytest-0.3
is not even in stackage nightly yet and I just need it to build right now :-)
2019-03-15 12:33:16 -07:00
Simon Michael
1ae36fe02c
;doc: journal: promote "auto postings" term; clarify scope
...
[ci skip]
2019-03-08 19:59:45 -08:00
Simon Michael
c5df73910f
csv: update some parse errors which weren't in human format
...
cf
https://www.reddit.com/r/plaintextaccounting/comments/axekse/hledger_how_to_create_curved_brackets_with_rule/
2019-03-05 06:23:11 -08:00
Simon Michael
172dbc7a90
doc: changelogs
...
[ci skip]
2019-03-01 17:46:37 -08:00
Simon Michael
0cd5545e26
regen cabal files/manuals
...
[ci skip]
2019-03-01 16:17:25 -08:00
Simon Michael
68e5c41d52
bump version, manual dates
...
[ci skip]
2019-03-01 16:11:15 -08:00
Simon Michael
9fab3257e8
regen cabal files
2019-03-01 15:44:40 -08:00
Simon Michael
9bb6f75bc8
update tested-with, add ghc 8.6
...
[ci skip]
2019-03-01 15:10:42 -08:00
Simon Michael
16157bc711
lib, web: tweaks to keep building with GHC 7
2019-03-01 15:07:17 -08:00
Simon Michael
420eef4a40
lib: fix some transaction balancing cases
...
I needed to be more careful about ordering, as johannesgerer's original
code was, and the tests missed it. I think I have it now.
Found the PR whose code I have been reworking, it was #438 .
2019-02-21 16:50:32 -08:00
Simon Michael
ca565795ad
lib: transaction, [v]post*, balassert* constructors, for tests etc.
2019-02-21 16:20:04 -08:00
Simon Michael
0bc16d4af6
lib, cli, web: rename porigin -> poriginal
2019-02-20 20:23:54 -08:00
Simon Michael
8620e5414f
regen manuals
...
[ci skip]
2019-02-20 17:37:25 -08:00
Simon Michael
ba850f3871
lib: more transaction balancing/assertions/assignments cleanup
2019-02-20 09:14:30 -08:00
Simon Michael
8789a442a8
lib: inclusive balance assertions (=* and ==*)
2019-02-20 09:14:30 -08:00
Simon Michael
3b47b58aec
lib: clarify transaction balancing & balance assertion checking
2019-02-20 09:14:30 -08:00
Simon Michael
b34b262c76
lib: document mapM'
...
[ci skip]
2019-02-17 08:36:59 -08:00
Simon Michael
bc7a1476ed
refactor: lib: hlint cleanups
2019-02-14 05:15:49 -08:00
Simon Michael
03877057fb
refactor: cli: commands: hlint clean
2019-02-14 05:15:49 -08:00
Simon Michael
226add41d3
lib: slight cleanup (spelling, hlint)
...
[ci skip]
2019-02-14 05:15:49 -08:00
Simon Michael
17c4a47a85
regen cli help, manuals
...
[ci skip]
2019-02-14 05:15:49 -08:00
Simon Michael
9e3cdef1e9
lib: balance assertion docs ( #290 )
...
[ci skip]
2019-02-13 15:52:07 -08:00
Simon Michael
eed4a996f8
doc: journal: link cookbook, fix typo
...
[ci skip]
2019-02-12 10:00:25 -08:00
Simon Michael
6ff5d744b7
doc: journal: move details of editor support to cookbook
...
[ci skip]
2019-02-12 09:50:56 -08:00
Simon Michael
21fac53954
doc: regen manuals
...
[ci skip]
2019-02-11 14:15:44 -08:00
Jakob Schöttl
161ca660dc
Support register --invert option to negate amounts
2019-02-09 15:55:41 -08:00
Simon Michael
94753f1cea
bump to dev version
2019-02-08 11:33:44 -08:00
Simon Michael
a18e4e9773
hpack: drop quotes from version: field, apparently not required
...
[ci skip]
2019-02-05 06:35:40 -08:00
Simon Michael
18ffa65168
tools: move setversion to shake, use PKG/.version, set upper bounds
...
./Shake setversion will now propagate the version number in each
package's .version file, to all the places in that package where it's
needed (ie the defs.m4 file and multiple places in the package.yaml
file. Also it now updates upper bounds on other hledger packages
to the next major version. (The new lower/upper bounds may not always
be what's desired, manual review required.)
[ci skip]
2019-02-04 18:47:27 -08:00
Simon Michael
bde46f7bd0
doc: move version, release date entirely into per-package macros
...
[ci skip]
2019-02-04 15:28:23 -08:00
Simon Michael
bf6acf52ef
doc: allow per-package m4 defs, to override things like version
...
[ci skip]
2019-02-04 15:18:51 -08:00
Simon Michael
78a66594ed
lib, cli: changelogs
2019-02-02 20:23:30 -08:00
Simon Michael
6553353bc5
lib, cli: bump version to 1.13.1
2019-02-02 20:21:35 -08:00
Simon Michael
86d5652e53
stop depending on here due to slow haskell-src-meta/stackage issues
...
Using file-embed or ordinary literals instead, for now.
2019-02-02 16:34:10 -08:00
Simon Michael
f9b85a1d4c
update embedded docs
2019-02-01 17:23:12 -08:00
Simon Michael
40d1572359
bump version to 1.13
2019-02-01 17:19:19 -08:00
Simon Michael
ca0d0b0d81
doc: changelogs
2019-02-01 17:13:16 -08:00
Simon Michael
022dc09f11
doc: journal: mention "auto postings"; explain the #893 situation
...
[ci skip]
2019-02-01 16:06:09 -08:00
Simon Michael
d1f122f15e
refactor: clarify, note issues ( #893 )
2019-02-01 15:35:33 -08:00
Simon Michael
d6e075dacd
refactor journalModifyTransactions, modifyTransactions
...
API changes:
Hledger.Data.TransactionModifier
-transactionModifierToFunction
+modifyTransactions
Hledger.Read.Common.applyTransactionModifiers -> Hledger.Data.Journal.journalModifyTransactions
2019-02-01 11:31:04 -08:00
Simon Michael
9955f53b9b
doc: changelogs cleanup
...
[ci skip]
2019-01-31 15:43:08 -08:00
Simon Michael
9fe3212940
changelogs
...
[ci skip]
2019-01-28 10:45:25 -08:00
Simon Michael
2df8a6c4de
doc: regen manuals
2019-01-26 15:56:43 -08:00
Simon Michael
550aa408eb
lib: refactor, add embedFileRelative
2019-01-26 15:52:58 -08:00
Simon Michael
17cd5b2254
doc: update changelogs
...
[ci skip]
2019-01-26 11:35:08 -08:00
Simon Michael
0a31ef848f
doc: update changelogs
...
[ci skip]
2019-01-26 11:31:39 -08:00
Simon Michael
1e5e30ae87
regen cabal files
...
[ci skip]
2019-01-25 18:33:39 -08:00
Simon Michael
d517aef702
doc: changelogs: drop unnecessary backslashes before #*_<>$
...
sed commands:
s/\\#/#/g;
s/\\\*/*/g;
s/\\_/_/g;
s/\\</</g;
s/\\>/>/g;
s/\\\$/$/g;
[ci skip]
2019-01-25 18:30:09 -08:00
Simon Michael
7b67876a80
doc: changelogs: convert to clean pandoc markdown
...
pandoc options:
-f markdown-auto_identifiers
-t markdown-header_attributes-fenced_code_attributes --atx-headers --wrap=preserve
[ci skip]
2019-01-25 18:23:36 -08:00
Simon Michael
01c6f3e665
doc: changelogs: rename to CHANGES.md
...
These have been an adhoc mixture of plain text, markdown and org, and
used in each mode at different times. They will now have a definite
format, which for now is markdown. Org was another contender.
[ci skip]
2019-01-25 18:12:33 -08:00
Simon Michael
49a6e5715d
doc: changelogs: some fixes to markdown markup
...
[ci skip]
2019-01-25 18:08:24 -08:00
Dmitry Astapov
f2aaaf3310
lib, cli: merge --show-unbudgeted into --empty
2019-01-25 12:53:09 -08:00
Simon Michael
550e33a558
journal: fix balance assertions/assignments & prices ( #824 )
...
Hopefully this is will do it. This restores the past behaviour:
- parsing prices in balance assertions/assignments
- ignoring them in assertions
- using them in assignments
- and printing them
and clarifies tests and docs.
2019-01-25 12:41:10 -08:00
Simon Michael
94d5c6f111
journal: allow prices in balance assertions, but ignore ( #824 , #958 )
2019-01-25 08:59:37 -08:00
Simon Michael
b02f81572c
lib: comment
...
[ci skip]
2019-01-25 08:51:45 -08:00
Simon Michael
67dde9d4ae
doc: regenerate manuals, removing some smart typography
...
[ci skip]
2019-01-24 15:37:40 -08:00
Dmitry Astapov
5711cdf9ba
cli: added --transpose to "balance" command
2019-01-24 15:06:35 -08:00
Dmitry Astapov
f3366c7256
lib: fix behavior of nested budgets and --show-unbudgeted
2019-01-24 14:56:22 -08:00
Dmitry Astapov
92e7370f1f
lib: fix alignment in budget report
2019-01-24 14:56:22 -08:00
Simon Michael
a29b70c93f
update generated manuals
...
[ci skip]
2019-01-22 13:36:11 -08:00
Simon Michael
d4fa546d27
update generated journal, csv manuals
...
[ci skip]
2019-01-19 15:31:22 -08:00
Simon Michael
7130c75a97
doc: update account comments/tags/types
2019-01-18 16:40:35 -08:00
Simon Michael
a61216ac3c
journal: allow account types to be set with a type: tag
2019-01-18 16:40:35 -08:00
Simon Michael
573a13fc27
lib: expectParseStateOn helper
2019-01-18 16:40:35 -08:00
Simon Michael
763903ebda
journal: save account directives' comments, tags, declaration order
2019-01-18 16:40:35 -08:00
Simon Michael
90bf354566
lib: allow more account directive info in Account records
2019-01-18 16:40:35 -08:00
Simon Michael
899946f270
journal: account directive: stop supporting account sort codes
...
Eg "account 1000". (Introduced in 1.9, deprecated in 1.11, removed in 1.13.)
2019-01-18 16:40:35 -08:00
Dmitry Astapov
faa5b0fba7
lib: fix parsing of status/code/desc/comments in period txn
2019-01-16 17:17:18 -08:00
Simon Michael
9e4b302af7
lib: setFullPrecision, setMinimalPrecision ( #941 )
2019-01-16 14:45:50 -08:00
Simon Michael
c5ae8e6891
comments
2019-01-16 13:58:04 -08:00
Simon Michael
5ee79797e1
better fix for #949 , don't reverse same-day assertions with --auto
2019-01-16 09:10:58 -08:00
Simon Michael
274b1c12a1
whitespace
2019-01-15 12:58:05 -08:00
Simon Michael
f1441be404
lib: basic unit test for parseAndFinaliseJournal
2019-01-15 12:57:51 -08:00
Simon Michael
944554557a
tweak readJournalFiles type signature
2019-01-15 06:18:56 -08:00
Simon Michael
228fc9eb3c
preserve correct file order when using --auto ( fixes #949 )
...
And clarify parseAndFinaliseJournal a bit.
2019-01-15 06:14:47 -08:00
Simon Michael
40dc9b1db5
doc: make periodic txn example more robust; motivate 2 space rule
2019-01-14 15:36:22 -08:00
Simon Michael
e99f80d374
lib: try to clarify periodic transaction double-space error
2019-01-14 15:33:13 -08:00
Simon Michael
70b11ed0a4
journal: make balance assertions exact again ( #941 )
...
Going with option 1b from the issue: calculated and asserted amounts
are compared exactly, disregarding display precision.
But now balance assertion failure messages show those exact amounts at
full precision, avoiding confusion.
2019-01-08 16:51:11 +00:00
Simon Michael
9acce249bb
journal: balance assertion/precision doc tweaks ( #941 )
2019-01-07 08:33:01 +00:00
Simon Michael
c331be7f23
journal: clarify balance assertion/display precision more ( #941 )
2019-01-06 22:17:20 +00:00
Simon Michael
187fcf75ed
journal: clarify balance assertion/display precision interaction
...
Surprisingly, balance assertions were checking to maximum precision,
which meant it was possible, with a display-precision-limiting
commodity directive, to have a failing assertion with the error
message showing asserted and actual amounts that looked the same.
Now we round the calculated account balance (but not the asserted
balance) to display precision before comparing. This should ensure
assertions always behave as you would expect from visual inspection.
2019-01-06 08:30:54 +00:00
Simon Michael
72eb48bb29
lib: clarify checkBalanceAssertion etc.
2019-01-06 08:24:07 +00:00
Simon Michael
73a1de8d9b
doc: csv: emphasise the use of - in strptime patterns
2019-01-06 06:38:32 +00:00
Simon Michael
3cf21190c0
update embedded manuals
2019-01-05 07:35:54 +00:00
Simon Michael
0ed3ec08fa
bump version to 1.12.99
2019-01-05 07:35:54 +00:00
Simon Michael
86a91c514d
lib: disallow prices in balance assertions/assignments ( fix #824 )
...
(and in Ledger-style {=FIXEDLOTPRICES} )
2019-01-05 07:35:54 +00:00
Simon Michael
6f36702141
lib: rename, reposition tprecedingcomment field
2019-01-05 07:35:54 +00:00
Simon Michael
cd1455e9ea
lib: note aquantity zero with AUTO amounts
2019-01-05 07:35:54 +00:00
Simon Michael
5908414d77
lib: amultiplier -> aismultiplier
2019-01-05 07:35:54 +00:00
Simon Michael
3b0cb701ac
lib: reorder Amount fields for clearer debug output
2019-01-05 07:35:54 +00:00
Simon Michael
40713ee7aa
update embedded manuals
2018-12-02 17:26:18 -08:00
Simon Michael
67d7c82e9f
bump version to 1.12
2018-12-02 17:20:34 -08:00
Simon Michael
2e525f5600
lib: accountdirectivep: update unit tests
2018-12-02 16:41:16 -08:00
Simon Michael
552783a06b
doc: journal: rewrite balance assertions doc a little
2018-12-02 16:22:28 -08:00
Simon Michael
2d51cef88e
doc: changelogs
2018-12-02 13:29:00 -08:00
Jesse Rosenthal
11a5809c5c
journal: improve unassignable error.
2018-12-02 13:29:00 -08:00
Jesse Rosenthal
07d0a003a3
journal: fill unassignable list from account names.
2018-12-02 13:29:00 -08:00
Jesse Rosenthal
597b1b8ccd
journal: check assignments against unassignable list
2018-12-02 13:29:00 -08:00
Jesse Rosenthal
ff455689a3
journal: add new state field for unassignable accounts
...
This should eventually include accountnames from transaction
modifiers (if `--auto` is enabled), or periodic transactions (if
`--forecast` is enabled).
2018-12-02 13:29:00 -08:00
Simon Michael
df775326d9
lib: add disabled test for proposed #931 solution
2018-11-29 13:44:38 -08:00
Simon Michael
6d0ee6a590
lib: clarify what postingsAsLines does ( #931 )
2018-11-29 13:32:59 -08:00
Simon Michael
e06e300446
lib: try to pin down what isTransactionBalanced does ( #931 )
2018-11-29 13:14:49 -08:00
Simon Michael
b2b25d2523
doc: changelogs: tweak descriptions
2018-11-25 21:06:33 -08:00
Simon Michael
a2faa8dfbf
journal: doc: move multicommodity assertions doc to right place
2018-11-25 21:05:55 -08:00
Alex Chen
e4cc6f31b9
lib: update periodic transaction entry in journal docs
...
- also specify the starting date in the example periodic transaction so
that it lies on the first day of the week (it otherwise does not
parse)
2018-11-22 14:09:32 -08:00
Alex Chen
83a63a4ef5
lib: minor cleanup in 'periodictransactionp'
2018-11-22 14:09:32 -08:00
Alex Chen
519297051d
lib: restore previous period expression parser behaviour (PR #807 )
...
- parse a period expression by first extracting words separated by
single spaces, then by "re-parsing" this text with 'periodexprp'
- this way, the period expression parsers do not need to know about
the single- or double-space rules
2018-11-22 14:09:32 -08:00
Alex Chen
880e6e0a32
lib: add a custom parse error for "re-parsing"
...
- for pretty-printing parse errors thrown from the parsing of excerpts
of the source text as if they were thrown from the parsing of the
source text itself
2018-11-22 14:09:32 -08:00
Simon Michael
a711ae60fb
journal: doc: more detail on transaction modifiers ( #928 )
...
[ci skip]
2018-11-13 18:15:51 -08:00
Simon Michael
b00aa32d7b
journal: txn modifier multipliers multiply total-priced amounts ( #928 )
...
A different approach: instead of converting to unit prices and fiddling
with the display precision, just multiply the total prices by the same
multiplier (and keep them positive).
This seems a little more natural. I'm not sure if one of these will be
more robust than the other.
2018-11-13 17:50:30 -08:00
Simon Michael
d7919003ae
lib: (divide|multiply)[Mixed]AmountAndPrice ( #928 )
...
Divide/multiply amounts *and* their total price, if they have one.
Helpful for keeping transactions balanced when transaction modifiers are
multiplying amounts.
2018-11-13 17:43:15 -08:00
Simon Michael
b053942e9b
lib: flip the arguments of (divide|multiply)[Mixed]Amount (api change)
...
Also, start using a mapMixedAmount helper.
2018-11-13 17:28:24 -08:00
Simon Michael
9e8b1612b0
journal: fix txn modifier multipliers with total-priced amounts ( #928 )
...
Transaction modifier multipliers have never multiplied total-priced amounts
correctly (and prior to hledger 1.10, this could generate unbalanced
transactions).
Now, the generated postings in this situation will have unit prices,
and an extra digit of display precision. This helps ensure that
the modified transaction will remain balanced. I'm not sure yet if
it's guaranteed.
2018-11-13 16:35:46 -08:00
Simon Michael
4b5b9f46db
lib: TransactionModifier: clarify
2018-11-13 16:35:46 -08:00
Simon Michael
80b34ea48d
lib: TransactionModifier: cleanup
2018-11-13 11:25:36 -08:00
Mykola Orliuk
99bfebd1a1
ui: support all results of showGenericSourcePos
...
Resolves simonmichael/hledger#904
2018-10-26 16:32:16 -07:00
Peter Simons
027d084878
Drop undecidable Ord instance for ParseError.
...
That code fails to compile with ghc-8.6.1 because the instance is undecidable.
I suppose we could enable the appropriate compiler extension to support it, but
I've found that simply removing the instance causes no problems whatsoever: the
entire repository still compiles fine and it passes all test suites, too.
2018-10-24 10:35:11 -07:00
Peter Simons
4e8f2c11d3
Allow building with base-4.12.
...
The build succeeds just fine and all test suites pass, too.
2018-10-24 10:35:11 -07:00
Mykola Orliuk
1aac38d3d3
lib: include source info in txn balance errors
...
Partially address simonmichael/hledger#904
2018-10-23 15:54:38 -07:00
Simon Michael
3f6922b51f
lib: showTransaction: comment
...
[ci skip]
2018-10-22 14:28:18 -07:00
Samuel May
e57ef9e9a9
lib: journal: Add support for exact assertions
2018-10-22 09:55:14 -07:00
Samuel May
6c31393dd3
lib: Groundwork allowing multi-commodity assertions
2018-10-22 09:55:14 -07:00
Samuel May
cde91fc5f4
lib: Make BalanceAssertion a full datatype
...
Note: simplifies/moves whitespace parsing out of the balance assertion
parser.
2018-10-22 09:55:14 -07:00
Simon Michael
0d531bb24f
lib: showTransaction: fix a case showing multiple missing amounts
...
Noticed by peti: showTransaction could sometimes hide the last posting's
amount even if one of the other posting amounts was already implcit,
producing invalid transaction output.
2018-10-22 07:23:40 -07:00
Simon Michael
b5a90432ff
lib: document and test showTransaction*, posting*AsLines
2018-10-22 06:46:31 -07:00
Simon Michael
20f006f7f6
lib: transaction: drop commented code
2018-10-22 04:03:29 -07:00
Simon Michael
80dc2ef03f
update cabal files with hpack 0.31
...
As in latest stack release. Hopefully this won't unleash horrors.
2018-10-18 14:44:16 -07:00
Simon Michael
b5df5fb5f0
lib: comment
2018-10-18 14:43:00 -07:00
Simon Michael
74611a7be1
ui: accounts: fix balances when there's only periodic txns
...
And clarify multiBalanceReport.
2018-10-18 14:43:00 -07:00
Simon Michael
2c2d10f9c2
lib: plog, plogAt: add missing newline, note issue
2018-10-18 14:43:00 -07:00
Jesse Rosenthal
a6a73e36e3
Finish removing journalFinalise ( #903 )
...
* journal: Get rid of `journalFinalise` and use granular functions
Complete the process started in 53b3e2bd . This gets rid of the
`journalFinalise` function and uses the smaller steps, in order to
have more granular control.
* journal: Change order of operations in finalization
We want to make sure that we add the filepath after the order is
reversed, so the added filepath is on the head and not the tail (as it
would be if it were reversed after it was added).
* journal: Refine granular finalization functions
This commit fixes two of the granular finalization functions:
1. Rename `journalSetTime` to `journalSetLastReadTime` and improve
documentation.
2. Remove `journalSetFilePath`. It's redundant with `journalAddFile`
currently in `Hledger.Read.Common`. The only difference between the
functions is where the file is added (we keep the one in which it
is added to the tail), so we change the position vis-a-vis
reversal.
2018-10-16 08:51:51 -07:00
Simon Michael
0f2a31bea7
docs: journal: account: a little bit more about sorting
...
[ci skip]
2018-10-15 12:07:44 -07:00
Simon Michael
4a399e50cb
acc: don't require an explicit --flat to make --drop work
2018-10-13 13:22:11 -07:00
Simon Michael
b72f9697a2
lib: journal: account: allow whitespace or a comment after the account name
2018-10-13 13:09:49 -07:00
Simon Michael
4f2d9dde4c
docs: journal: clarify transaction modifiers
...
[ci skip]
2018-10-12 09:12:06 -07:00
Jesse Rosenthal
53b3e2bd94
journal: split up the parts of journalFinalise, and use them as needed.
...
`journalFinalise` is only used in the `parseAndFinaliseJournal`
functions, but it needs to be run differently at different stages when
transaction modifiers are applied. This change breaks it into smaller
functions, and uses those smaller parts in `parseAndFinaliseJournal`
as needed.
2018-10-12 07:39:53 -07:00
Jesse Rosenthal
20f134c96b
read: only run finalise twice if there are modifiers
...
Previously we ran if `--auto` was set. But this adds a small
performance hit if `--auto` becomes default. Now we only run twice if
there are transactionModifiers AND `--auto` is set. So even if auto is
specified, there will be no penalty if there are no modifiers.
2018-10-12 07:39:53 -07:00
Jesse Rosenthal
5a3462ce48
read: Integrate transaction modifiers with journal finalization
...
Currently, automated transactions are added before the journal is
finalized. This means that no inferred values will be picked up. We
change the procedure, if `auto_` is set, to
1. first run `journalFinalise` without assertion checking (assertions
might be wrong until automated transactions), but with reordering
2. Insert transaction modifiers
3. Run `journalFinalise` again, this time with assertion checking as
set in the options, and without reordering.
If `auto_` is not set, all works as before.
Closes : #893
2018-10-12 07:39:53 -07:00
Jesse Rosenthal
b346d7f701
Journal: make reordering optional in journalFinalise
...
Currently `journalFinalise` always reverses the order of
entries. However, if there are automated transactions, we might need
to run it twice. This adds a boolean flag to make reordering
optional. This will be used in the `parseAndFinaliseJournal`
functions.
2018-10-12 07:39:53 -07:00
Simon Michael
51bf8cbccc
docs: journal: account: a gotcha when changing builtin account types
...
[ci skip]
2018-10-11 16:16:33 -07:00
Simon Michael
a899f7924f
docs: journal: account: update directives intro
...
[ci skip]
2018-10-11 15:53:06 -07:00
Simon Michael
e4215c094e
doc: journal: document setting account types
...
[ci skip]
2018-10-09 14:24:59 -10:00
Simon Michael
605a082d77
bs/bse/cf/is: use account type declarations if any
...
These commands now detect the account types declared by account directives.
Whenever such declarations are not present, built-in regular expressions
are used, as before.
2018-10-09 14:24:59 -10:00
Simon Michael
c1236fa6e9
journal: account directives can declare account types
...
Previously you had to use one of the standard english account names
(assets, liabilities..) for top-level accounts, if you wanted to use
the bs/bse/cf/is commands.
Now, account directives can specify which of the big five categories
an account belongs to - asset, liability, equity, revenue or expense -
by writing one of the letters A, L, E, R or X two or more spaces after
the account name (where the numeric account code used to be).
This might change. Some thoughts influencing the current syntax:
- easy to type and read
- does not require multiple lines
- does not depend on any particular account numbering scheme
- allows more types later if needed
- still anglocentric, but only a little
- could be treated as syntactic sugar for account tags later
- seems to be compatible with (ignored by) current Ledger
The current design permits unlimited account type declarations anywhere
in the account tree. So you could declare a liability account somewhere
under assets, and maybe a revenue account under that, and another asset
account even further down. In such cases you start to see oddities like
accounts appearing in multiple places in a tree-mode report. In theory
the reports will still behave reasonably, but this has not been tested
too hard. In any case this is clearly too much freedom. I have left it
this way, for now, in case it helps with:
- modelling contra accounts ?
- multiple files. I suspect the extra expressiveness may come in handy
when combining multiple files with account type declarations,
rewriting account names, apply parent accounts etc.
If we only allowed type declarations on top-level accounts, or
only allowed a single account of each type, complications seem likely.
2018-10-09 14:24:59 -10:00
Mykola Orliuk
8c6a418325
lib: fix home path expansion in includes
...
fixes simonmichael/hledger#896
2018-10-09 13:35:40 -10:00
Simon Michael
6c57629b8c
lib: fix posting-date-and-balance-assignment error properly ( #894 )
2018-10-09 16:08:47 -07:00
Simon Michael
8c7c59017a
lib: fix my wrong merge of #880 more
2018-10-09 15:26:15 -07:00
Simon Michael
36fdeceb6c
lib: tweak posting-date-no-amount-balance-assertion error ( #894 )
2018-10-09 14:15:52 -07:00
Simon Michael
f6e095e794
lib: fix my wrong merge of #880
2018-10-09 14:06:22 -07:00
Simon Michael
88887e5458
Merge branch 'master' into ExceptTLayer
2018-10-09 10:31:32 -10:00
Simon Michael
278802e648
journal: Y affects dates in periodic transactions ( fix #892 )
2018-10-09 11:54:40 -07:00
Simon Michael
ab26220b23
lib: document SmartDate
...
[ci skip]
2018-10-09 10:43:03 -07:00
Alex Chen
2cbc41e088
Merge branch 'master' into ExceptTLayer
2018-10-09 11:19:45 -06:00
Alex Chen
e45070aab5
Update dependency bounds for megaparsec
2018-10-09 11:15:33 -06:00
Alex Chen
a8d642d5b5
lib: revise comments for "final" parse errors
...
- also simplify their implementation a bit
2018-10-09 11:05:46 -06:00
Simon Michael
862fb873b4
update embedded manuals
2018-10-06 09:42:27 -10:00
Simon Michael
ff2a546319
bump version to 1.11.99
2018-10-06 09:42:12 -10:00
Simon Michael
e687ef1a79
doc: changelogs, relnotes
2018-10-06 09:40:06 -10:00
Simon Michael
2ba135e402
lib: journal: fix wrong txn rendering in balance assertion errors
2018-10-06 09:31:22 -10:00
Simon Michael
190eee5485
lib: comment
...
[ci skip]
2018-10-05 11:05:39 -10:00
Simon Michael
2c9c4ebf79
Merge branch 'master' into ExceptTLayer
2018-10-04 21:04:02 -10:00
Simon Michael
7bc500ccd2
update embedded manuals
2018-09-30 20:08:15 -10:00
Simon Michael
b798c48040
bump version to 1.11
2018-09-30 20:07:45 -10:00
Simon Michael
92c8a6fffb
changelogs
2018-09-30 20:05:26 -10:00
Alex Chen
3d2584d869
lib: switch to megaparsec 7
2018-09-30 20:15:12 -06:00
Alex Chen
26369c28a3
lib: remove old code for include file parse errors
2018-09-29 22:55:10 -06:00
Alex Chen
31d4e930e7
lib: Re-implement 'includedirectivep' with the new 'ExceptT' layer
...
- Parse errors encountered in include files are treated as "final" parse
errors in the parent file, preventing backtracking and fixing an issue
in #853
2018-09-29 22:54:49 -06:00
Alex Chen
3e54fc77a4
lib: make 'includedirectivep' an 'ErroringJournalParser'
...
- Update tests as well, requiring test utilities in Utils/Test.hs
analogous to the those for 'JournalParser' but instead for
'ErroringJournalParser'
2018-09-29 22:34:52 -06:00
Alex Chen
855a8f1985
lib: Re-implement the 'ExceptT' layer of the parser
...
We previously had another parser type, 'type ErroringJournalParser =
ExceptT String ...' for throwing parse errors without the possibility of
backtracking. This parser type was removed under the assumption that it
would be possible to write our parser without this capability. However,
after a hairy backtracking bug, we would now prefer to have the option
to prevent backtracking.
- Define a 'FinalParseError' type specifically for the 'ExceptT' layer
- Any parse error can be raised as a "final" parse error
- Tracks the stack of include files for parser errors, anticipating the
removal of the tracking of stacks of include files in megaparsec 7
- Although a stack of include files is also tracked in the 'StateT
Journal' layer of the parser, it seems easier to guarantee correct
error messages in the 'ExceptT FinalParserError' layer
- This does not make the 'StateT Journal' stack redundant because the
'ExceptT FinalParseError' stack cannot be used to detect cycles of
include files
2018-09-29 22:33:34 -06:00
Alex Chen
2b3c97e1af
lib: tweak custom parse errors
...
- Don't immediately throw custom parse errors into 'ParsecT'; rather,
just construct and return them
- This anticipates the re-implementation of an 'ExceptT' layer of the
parser, which should be able throw custom parse errors
2018-09-29 22:32:34 -06:00
Alex Chen
5e1f0ba6f7
lib: add a field to 'Journal' for a stack of include files
...
- In anticipation of megaparsec 7, which removes support for stacks of
include files (as far as I can tell)
- Intended for the 'StateT Journal' layer of the parser
- A stack of include files would be better in a 'ReaderT' layer, but I
don't want to add another layer to the parser
- Intended for detecting cycles of include files
- Potential issue: for proper error messages for include file cycles,
we must remember to provide the filepath of the root journal file via
the initial journal state passed to a 'JournalParser'; I imagine
that we may forget to do so because in all other cases it is okay
not to do so.
2018-09-29 22:32:27 -06:00
Simon Michael
2960c9209f
lib: whitespace
2018-09-27 10:51:36 -10:00
Simon Michael
f42b140d53
lib: note about strict Map
2018-09-27 10:51:36 -10:00
Simon Michael
855bd54d19
budget: declaration and (actual) amount sorting for bal --budget
...
Account declaration-aware sorting is the default throughout hledger now.
2018-09-24 08:31:19 -10:00
Simon Michael
f2b4fca9b0
docs: journal: more account sorting updates
...
[ci skip]
2018-09-23 18:04:20 -10:00
Simon Michael
7a9ca5f6a9
docs: journal: more account sorting updates
...
[ci skip]
2018-09-23 17:55:21 -10:00
Simon Michael
477caa31c5
docs: journal: remove account code from example
...
[ci skip]
2018-09-23 17:48:19 -10:00
Dmitry Astapov
8c79d6529d
lib: fix balance --budget in the presence of --value
2018-09-23 07:45:34 -10:00
Simon Michael
3de8c11de1
journal: a new account sorting mechanism, and a bunch of sorting fixes
...
A bunch of account sorting changes that got intermingled.
First, account codes have been dropped. They can still be parsed and
will be ignored, for now. I don't know if anyone used them.
Instead, account display order is now controlled by the order of account
directives, if any. From the mail list:
I'd like to drop account codes, introduced in hledger 1.9 to control
the display order of accounts. In my experience,
- they are tedious to maintain
- they duplicate/compete with the natural tendency to arrange account
directives to match your mental chart of accounts
- they duplicate/compete with the tree structure created by account
names
and it gets worse if you think about using them more extensively,
eg to classify accounts by type.
Instead, I plan to just let the position (parse order) of account
directives determine the display order of those declared accounts.
Undeclared accounts will be displayed after declared accounts,
sorted alphabetically as usual.
Second, the various account sorting modes have been implemented more
widely and more correctly. All sorting modes (alphabetically, by account
declaration, by amount) should now work correctly in almost all commands
and modes (non-tabular and tabular balance reports, tree and flat modes,
the accounts command). Sorting bugs have been fixed, eg #875 .
Only the budget report (balance --budget) does not yet support sorting.
Comprehensive functional tests for sorting in the accounts and balance
commands have been added. If you are confused by some sorting behaviour,
studying these tests is recommended, as sorting gets tricky.
2018-09-22 21:45:07 -10:00
Simon Michael
598129ad6a
lib: pushAccount -> pushDeclaredAccount
2018-09-22 21:06:29 -10:00
Simon Michael
8c18bada0c
lib, cli, ui, web: update cabal files
2018-09-22 21:01:23 -10:00
Simon Michael
03acd40668
lib, cli, ui, web: upper bound to avoid megaparsec 7 for now
2018-09-20 20:48:47 -10:00
Simon Michael
059ad9eb76
refactor: jaccounts -> jdeclaredaccounts
2018-09-17 05:52:13 -07:00
Simon Michael
8d3cddc907
drop another old csv import
2018-09-07 12:51:10 -07:00
Simon Michael
362705a981
update cabal files
2018-09-07 12:44:52 -07:00
Simon Michael
23bdac41d9
csv: merge lucamolteni's cassava/custom separators (squashed) ( #829 )
...
commit 5ba464de761b298e50d57a8b7d14bc28adb30d5d
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Sep 7 17:54:12 2018 +0200
Fix CI 2
commit f060ae9449f4b61a915b0ed4629fc1ba9b66fb4a
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Sep 7 17:30:08 2018 +0200
Fix CI build
commit af0719a33b9b72ad244ae80198d881a1f7145e9d
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Sep 7 17:19:01 2018 +0200
Fix rebase
commit 1a24ddfa54dfb4ff1326e1a51005ffa82d3dc3c8
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Aug 10 16:25:24 2018 +0200
Fixed some GHC warnings
commit 1ac43398a359b5925ef71f53347698f1c6c510ef
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Aug 10 16:14:49 2018 +0200
Fix .cabal
commit 422456b925d8aa4ab3e869f51e98c2b1c3dcde0a
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jul 1 22:56:20 2018 +0200
Removed to-do list
commit 1118b762e4fd15c4fe7ba48ba86676706ea3a5a5
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jul 1 22:53:28 2018 +0200
Better test
commit 1146ed0941655668bf7684f18aa15c5f4b9b20c2
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jul 1 15:32:28 2018 +0200
Fix parsing
commit 4fc2374b2b81802990da30c96756aab54d77399c
Author: Luca Molteni <volothamp@gmail.com>
Date: Thu Jun 21 22:11:11 2018 +0200
Parsing of separator
commit f7a61737f1ad4460ba20ca9b2e86eb21468abb33
Author: Luca Molteni <volothamp@gmail.com>
Date: Thu Jun 21 14:29:23 2018 +0200
Almost separator in options
commit ac8841cf3b9c80914bc3271ad9b9ff4ae9ba48a7
Author: Luca Molteni <volothamp@gmail.com>
Date: Thu Jun 21 14:16:59 2018 +0200
Separator in parseCSV
commit 92a8b9f6ba77ea4237f769641e03029ac88542ea
Author: Luca Molteni <volothamp@gmail.com>
Date: Thu Jun 21 13:30:41 2018 +0200
separator option
commit ec417a81ae625647cf35e61776cdf02bdb2c6aea
Author: Luca Molteni <volothamp@gmail.com>
Date: Thu Jun 21 10:45:26 2018 +0200
Removed one qualified import
commit 8b2f386c2f780adcd34cff3de7edceacc1d325a7
Author: Luca Molteni <volothamp@gmail.com>
Date: Wed Jun 20 14:01:12 2018 +0200
Removed string conversions
commit a14d0e099e28a286bb81770cfc9cb8f5c7e5cf1f
Author: Luca Molteni <volothamp@gmail.com>
Date: Wed Jun 20 10:23:20 2018 +0200
custom delimiter in cassava
commit 694d48e2bc1ada0037b90367c017f3082f68ed45
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jun 10 17:51:54 2018 +0200
Use Text.getContents - remove UTF-8 compatibility library
commit a7ada2cc60033ebdd796ca34cc2ec69a4f387843
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jun 10 17:49:34 2018 +0200
todo list
commit 58ec47d3987909f6bace50e3e647e30dadd5bf03
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jun 10 17:45:22 2018 +0200
CSV test now has unicode characters
commit b7851e94c3f1683b63ec7250a12bcde3b7bed691
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jun 10 16:59:39 2018 +0200
Use decode from Text
commit 79f59fd28ccaca08fcd718fcd8d00b1c1d65d7e1
Author: Luca Molteni <volothamp@gmail.com>
Date: Sun Jun 10 13:28:57 2018 +0200
Use Text and Lazy Bytestring
commit 470c9bcb8dc00669beb4ef0303a1e7d9f7aecc89
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 15:30:22 2018 +0200
Use megaparsec error
commit f978848ba249ef4f67b855bea5d4e549290c205c
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 15:22:07 2018 +0200
Renamed qualify and remove Parsec
commit 152587fde204c43a55798d212e43f37cd3038c2e
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 15:12:36 2018 +0200
Use cassava mega parsec
commit cf281577a3d3a071196484a6fc8485f2ea1f7d67
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 14:01:47 2018 +0200
Removed Data.Vector
commit 1272e8e758369d8cc5778029a705b277355a5029
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 12:16:18 2018 +0200
Removed Parsec ParseError
commit ae07f043135a19307fd65b281ade37a74c76acb2
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 12:06:14 2018 +0200
Type sinonim for ParsecError
commit 8e15b253c11bd1c0c35a7641aeb18aa54e0ba9b0
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 11:16:08 2018 +0200
Replaced with typeclasses
commit 1ed46f9c175603611325f3d377004e4b85f29377
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 11:01:33 2018 +0200
Replaced Text/CSV with Cassava
commit 362f4111b5854145703174b976fc7acbd71b8783
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 10:34:37 2018 +0200
Use cassava parsin instead of Text/CSV
commit 83e678e371618687cf7c15a4e2cfa67f570b6b64
Author: Luca Molteni <volothamp@gmail.com>
Date: Sat Jun 9 08:22:51 2018 +0200
Text CSV error messages
commit f922df71d274beeacab9fb2530b16c97f005cc08
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Jun 8 21:45:20 2018 +0200
Better types
commit edd130781c84790a53bff2283e6041eb8232e7cf
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Jun 8 21:34:59 2018 +0200
Conversion to Text CSV type
commit 0799383214483018ad2d977a3c8022414959c2b2
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Jun 8 16:06:21 2018 +0200
First function with cassava
commit e92aeb151ff527b383ff3d0ced7764e81b71af82
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Jun 8 13:47:34 2018 +0200
Added cassava as dependency
commit 5ea005c558a3939af7e5f0cd735a9b4da931228e
Author: Luca Molteni <volothamp@gmail.com>
Date: Fri Jun 8 13:18:47 2018 +0200
Better .gitignore for multi idea modules
2018-09-07 12:34:51 -07:00
Simon Michael
65807162b3
tests: make doctests suite run with old ghcs
...
(Require a newer doctest which supports --fast and --verbose.)
2018-09-07 12:34:51 -07:00
Simon Michael
86750d5cde
tests: make doctests suite build with ghc 7.10
2018-09-07 12:34:51 -07:00
Simon Michael
91b111b60d
rename easytests_* to tests_*
2018-09-06 13:13:26 -07:00
Simon Michael
f388d9311a
update embedded manuals
2018-09-06 12:03:50 -07:00
Simon Michael
622153e022
lib: doctests: note ghc 7.10 build failure
...
[ci skip]
2018-09-04 14:42:03 -07:00
Simon Michael
ce96001cfc
lib: keep Tests building with ghc 7.10
...
The doctests test suite fails to bulid with ghc 7.10, not fixed.
2018-09-04 14:27:10 -07:00
Simon Michael
d14d6e2b68
tests: update doctests after Transaction Show change
2018-09-04 14:02:04 -07:00
Simon Michael
d893ed64a5
lib: drop hunittests test suite & HUnit dependency
2018-09-04 13:53:59 -07:00
Simon Michael
cc0cf995b3
lib: fix easytests test suite
2018-09-04 13:53:16 -07:00
Simon Michael
4003264129
lib: drop HUnit helpers, rename expectEqPP
2018-09-04 13:52:36 -07:00
Simon Michael
54db19e857
tests: convert & re-enable StringFormat tests
2018-09-04 13:51:08 -07:00
Simon Michael
51618adc37
tests: use is in a few more places
2018-09-04 13:39:21 -07:00
Simon Michael
7370f2a553
tests: Hledger -> easytest
2018-09-04 12:25:52 -07:00
Simon Michael
09d9fbf487
tests: Reports -> easytest
2018-09-04 12:23:07 -07:00
Simon Michael
241d0dbebd
tests: ReportOptions -> easytest
2018-09-04 11:54:40 -07:00
Simon Michael
3b63c2ff2f
tests: Transaction, Data -> easytest
2018-09-04 11:54:15 -07:00
Simon Michael
a8175d8b14
tests: Timeclock -> easytest
2018-09-04 11:30:48 -07:00
Simon Michael
8d1506a4a4
tests: Posting -> easytest
2018-09-04 10:26:22 -07:00
Simon Michael
c5cd0dc648
tests: Ledger -> easytest
2018-09-04 10:24:07 -07:00
Simon Michael
d5c756e6c8
tests: Journal -> easytest
2018-09-04 10:10:10 -07:00
Simon Michael
0499b3f7e5
tests: Amount -> easytest
2018-09-04 10:01:26 -07:00
Simon Michael
dcc44d10a5
lib: export HasCallStack from Hledger.Utils.Test
2018-09-04 09:59:48 -07:00
Simon Michael
c3755f9a52
tests: AccountName -> easytest
2018-09-04 07:40:27 -07:00
Simon Michael
5de679ce62
tests: Query -> easytest
2018-09-04 07:29:48 -07:00
Simon Michael
bbecb28cae
tests: Utils -> easytest
2018-09-03 15:54:53 -07:00
Simon Michael
f713a413ff
clarify expectEq' arguments
2018-09-03 15:54:13 -07:00
Simon Michael
f3709f241d
tests: port Read tests to easytest
2018-09-03 15:42:24 -07:00
Simon Michael
d1cff46ba7
tests: port CsvReader tests to easytest
2018-09-03 15:30:52 -07:00
Simon Michael
1fced57c81
lib: export expectEq' helper
2018-09-03 15:30:27 -07:00
Simon Michael
cd67f8ea68
tests: clear out old boilerplate
2018-08-31 18:12:17 -07:00
Simon Michael
d1a7cc1c09
port remaining Read.Common tests
2018-08-31 18:12:17 -07:00
Simon Michael
f124007acf
tests: dehyphenate test names
2018-08-31 18:12:17 -07:00
Simon Michael
be7866da59
tests: parsedate -> fromGregorian
2018-08-31 18:12:17 -07:00
Simon Michael
f108b56e61
uniquify modules' easytests, simplify imports
2018-08-20 14:31:31 +01:00
Simon Michael
6568784bf6
port remaining JournalReader tests
2018-08-20 14:31:31 +01:00
Simon Michael
9733e0378e
journal: restore/port more old unit tests
2018-08-20 10:38:51 +01:00
Simon Michael
776d575610
test helpers: more line breaks, clarify monadic behaviour
2018-08-20 10:38:02 +01:00
Simon Michael
d6fb96cb4c
tests: expectParse, expectParseError helpers; parse to end of input
2018-08-20 08:59:06 +01:00
Simon Michael
5d9d9a8edb
tests: drop obsolete helpers
2018-08-20 08:25:03 +01:00
Simon Michael
9c0483fef2
tests: port another to easytest
2018-08-20 08:22:31 +01:00
Simon Michael
1a38beaad1
drop old transactionp hunit tests
2018-08-19 19:12:26 +01:00
Simon Michael
7706f8498e
tests: comment
2018-08-19 19:05:59 +01:00
Simon Michael
89357bb7b6
another parse test helper, use the IO variant always, port more tests
2018-08-19 19:02:59 +01:00
Simon Michael
3e6159e632
replace a bunch of custom Show instances for easier troubleshooting
...
Custom Show instances were obscuring important details in test failure
output again. The best policy seems to be: stick with default derived
Show instances as far as possible, but when necessary customize them
to conform to haskell syntax so pretty-show can do its thing (eg when
they contain Day values, cf https://github.com/haskell/time/issues/101 ).
2018-08-19 18:17:49 +01:00
Simon Michael
2778f6cf8f
lib: restore some old unit tests
...
Also change nullsourcepos, tests prefer JournalSourcePos for some reason.
2018-08-19 18:13:01 +01:00
Simon Michael
150b40e465
tests: remove empty scope
2018-08-19 18:07:33 +01:00
Simon Michael
bdcfba4eaa
whitespace
2018-08-18 20:31:47 +01:00
Simon Michael
fc11b5130f
journal: another failing test from #807
2018-08-18 19:50:15 +01:00
Simon Michael
7ab8bc2685
tests: import cleanups
2018-08-18 19:47:52 +01:00
Simon Michael
a8031de729
tests: fix build error with GHC < 8.4
2018-08-18 19:26:07 +01:00
Simon Michael
6081fead11
lib: clarify package test suites, run all easytests
2018-08-18 15:20:15 +01:00
Simon Michael
582e088325
lib: tests/ -> test/
2018-08-18 15:20:15 +01:00
Simon Michael
d778a92561
tests: export HUnit/EasyTest from Hledger.Utils.Test; more helpers
2018-08-18 15:19:59 +01:00
Simon Michael
4d578c008f
typo
2018-08-18 13:40:01 +01:00
Simon Michael
e0e21a2c6c
lib: note
2018-08-18 07:30:23 +01:00
Simon Michael
9c3a57f615
lib: some test fixes ( #823 )
2018-08-17 14:18:24 +01:00
Simon Michael
b4c336c874
test/_test/it/_it helpers; refactor easytests
...
This makes skipping/unskipping tests easier, and improves readability
a bit.
Note it's also possible to just write the test name with no preceding
function, when the type is constrained (see Journal.hs).
2018-08-17 13:40:37 +01:00
Simon Michael
626247bacd
journal: unit tests (2 skipped) for periodtransactionp ( #823 )
2018-08-17 12:42:43 +01:00
Simon Michael
b1bbbf0d93
lib: expectParseEqIO helper
2018-08-17 12:42:05 +01:00
Simon Michael
43d973e8ab
lib: more verbose show instance for PeriodicTransaction
2018-08-17 12:41:45 +01:00
Simon Michael
1d775a7a9c
lib: D should not affect automated posting multiplier amounts ( fix #860 )
2018-08-17 07:39:17 +01:00
Simon Michael
13436637c6
lib: "decimal point" -> "decimal separator" in error message
2018-08-17 07:37:26 +01:00
Simon Michael
e35dd19cc8
lib: refactor: tighten up amountwithoutpricep
2018-08-17 06:51:07 +01:00
Simon Michael
e9c5d13ac1
lib: update old failing amountp/postingp tests, at last ( #812 )
2018-08-16 06:42:52 +01:00
Simon Michael
dab75d98c8
lib: expectEq', expectParseEq: pretty-print compared values ( #812 )
2018-08-16 06:31:37 +01:00
Simon Michael
536eadb809
lib: improve expectParseEq ( #812 )
...
Show a pretty parse error, and avoid sequenced scopes
which are confusing (you can't run only the second).
2018-08-16 06:03:44 +01:00
Simon Michael
09d8e302db
lib: use unspaced scopes to simplify command lines ( #812 )
2018-08-16 05:58:17 +01:00
Simon Michael
50d666d5a0
test: refactor, document, organise easytests, port amountp tests ( #812 )
2018-08-15 19:58:07 +01:00
Simon Michael
69325da110
comment out failing tests to fix CI ( #812 )
2018-08-15 11:30:53 +01:00
Simon Michael
ab7dc3294e
lib: more informative failure output for amount tests ( #812 )
2018-08-15 11:24:52 +01:00