Commit Graph

599 Commits

Author SHA1 Message Date
Simon Michael
b6774f47a3 balance, print: add -o and CSV output here too
Not very elegant yet, but works.
2014-10-21 12:02:23 -07:00
Simon Michael
7f6cf1f849 balance, register, register-csv: depth 0 shows summary items (#206)
Previously, a depth:0 query produced an empty report (since there are no
level zero accounts). Now, it aggregates all data into one summary item
with account name "...".

This makes it easier to see the kind of data Gwern was looking for from
register-csv (net worth over time). Eg this shows one line per month
summarising the total of assets and liabilities:

hledger register-csv -- -MHE ^assets ^liabilities depth:0

Single and multi-column balance reports behave similarly.
2014-10-19 17:53:20 -07:00
Simon Michael
0620ec9840 fix redundant compilation in the hledger packages, at last
This seems to work well now with my haddock and GHC 7.8.
Not tested with GHC 7.6 though.
2014-10-19 09:37:18 -07:00
Simon Michael
e8a58d9388 cli: add a hidden --version+ flag showing number representation (#118) 2014-10-18 12:35:58 -07:00
Simon Michael
3b70362525 switch to Decimal for representing quantities (closes #118)
hledger has represented quantities with floating point (Double) until
now.  While this has been working fine in practice, the time has come to
upgrade our number representation to something more principled: Decimal,
for now. As a bonus, this brings a ~30% speed boost to most reports.

We'll keep the old representation(s) around for a while, selectable via
hledger-lib cabal flag, for research/testing/benchmarking purposes. To
build with the old Double representation: cabal install -fdouble
hledger-lib hledger hledger-web
2014-10-18 12:33:31 -07:00
Simon Michael
e888be0bf4 clarify similarAmountsOp doc 2014-10-18 10:45:17 -07:00
Simon Michael
2b39f68682 fix a warning in TransactionsReports 2014-10-18 10:32:01 -07:00
Simon Michael
84a90374b4 make build warnings consistent 2014-10-18 10:16:22 -07:00
gwern
d1618aaca8 strip trailing whitespace from all Haskell files 2014-10-14 18:48:24 -07:00
Simon Michael
22279978af revert an unnecessary "fix" in efe7c7a that broke tests 2014-09-13 21:28:48 -07:00
Simon Michael
5d403c2bb7 doc: changelogs (resolve conflicts)
Conflicts:
	hledger-lib/CHANGES
	hledger-web/CHANGES
2014-09-12 18:41:35 -07:00
Simon Michael
efe7c7a029 journal: dates should be followed by whitespace or newline 2014-09-06 09:20:22 -07:00
Simon Michael
aa85e786b9 register: describe datespans briefly, like balance
Eg instead of 2014/01/01 - 2014/01/31, show 2014/01, as in a multicolumn
balance report. The data model is not very elegant, but works for now.
2014-08-08 07:34:11 -07:00
Simon Michael
c485017ca6 journal: require consistent separators in a Y/M/D date
Date separators can be /, - or . but only one kind should be used in
each date. Eg we now reject 2014-8/1.
2014-08-08 07:29:02 -07:00
Simon Michael
3e27f4fb8b journal: add p suffix to date[time] parsers 2014-08-08 07:29:02 -07:00
Simon Michael
a0010a294f cli: smart dates must use a consistent separator
Along with the preceding commits, this means that date:2014-8/1 is now
parsed as 2014/01/01-2014/08/01 as intended, not 2014/08/01.
2014-08-08 07:21:02 -07:00
Simon Michael
632dee668d parse period expressions and date: more strictly
Period expressions and date: query terms must now be parseable all the
way to their end; we won't ignore unparseable trailing bits.
2014-08-08 07:21:02 -07:00
Simon Michael
a675b99870 query: report an error when date:D fails to parse
Previously, a date:D query term was just ignored if D could not be
parsed as a date.
2014-08-08 07:21:02 -07:00
Simon Michael
f631e8e063 register: --average implies --empty
The -A flag now enables -E, so that with a report interval the averages
are always per-period and not per-report-line. (Without a report
interval, -E is already the default).
2014-08-07 14:03:56 -07:00
Simon Michael
d0ad571321 fix manual url in default CSV rules file 2014-08-07 13:15:40 -07:00
Julien Moutinho
a6190420b2 data: add source location to transactions 2014-08-07 16:38:44 +02:00
Simon Michael
3ce34b145c add missing dbgN helpers 2014-07-28 18:57:54 -07:00
Simon Michael
40ab1e17f6 amounts cleanups, and support zeros with commodity 2014-07-28 18:45:13 -07:00
Simon Michael
1333b2650a more showDateSpan cleanup 2014-07-26 17:07:36 -07:00
Simon Michael
a7f7c3181f balance: show compact headings for common intervals
In periodic multicolumn balance reports, column headings now show a more
compact description of common periods (years, half-years, quarters,
months, weeks) for better readability and screen space efficiency.
2014-07-26 16:54:18 -07:00
Simon Michael
f2d9c6e9c1 web: more register chart improvements
- show a background color for future and less-than-zero regions
- show points for transactions, not all line corners
- hovering over point shows balance, date, posted amount and transaction
- clicking a point scrolls towards that date
2014-07-18 16:45:46 -07:00
Simon Michael
4333cae43f web: register chart improvements
- bigger
- plot is horizontal when balance is not changing
- legend for commodities
- some work towards stable commodity colors
2014-07-17 18:56:55 -07:00
Simon Michael
663c68e8e2 web: fix 0s with search by acct within a register 2014-07-17 16:53:36 -07:00
Simon Michael
d3ede5d676 web: remove debug code 2014-07-17 16:29:14 -07:00
Simon Michael
441cae645f web: account transactions report, register clarifications
Clarify the semantics and code of account transactions report a bit.

In the web account register view, emphasise the "historical balance" vs
"running total" distinction; show it as a label for the chart as well,
to reduce confusion.
2014-07-17 16:20:34 -07:00
Simon Michael
b3da48aaa0 identify the commodity in balance assertion errors
Now that balance assertions are checking only a single commodity, it can
be confusing. Eg say all your amounts are in dollars, an assertion like
"= 0" checked the dollar balance in hledger 0.23 but always succeeds in
hledger 0.24. When an assertion fails, we now report which commodity was
checked to help troubleshooting.
2014-07-17 15:23:03 -07:00
Simon Michael
528913d1bd balance: -E adds all starting accounts to multicol rpts
multicolumn balance reports only show accounts with activity (postings)
during the report period, by default. Sometimes you want to show
accounts which have an interesting balance, even if they have no
activity during the period. -E now does this, in addition to showing
leading & trailing empty columns.
2014-07-17 15:18:40 -07:00
Simon Michael
8aec855d04 note dbg0 is like ltrace 2014-07-17 15:06:28 -07:00
Simon Michael
2bfbdd175b queryEndDate 2014-07-15 07:01:01 -07:00
Simon Michael
19d42f8c99 clarify failed balance assertion message 2014-07-15 06:55:46 -07:00
Simon Michael
9f991fa94b tweak Regex haddock 2014-07-08 11:50:19 -07:00
Simon Michael
5bebc2beb0 regex haddock fix 2014-07-06 14:08:45 -07:00
Simon Michael
3a16e6cfc7 mostly replace slow regexpr with regex-tdfa (fixes #189) 2014-07-06 14:03:28 -07:00
Simon Michael
04f6162e19 extract regular expression utils module 2014-07-06 10:11:02 -07:00
Simon Michael
16f8b78305 balance: show multi-commodity amts on one line (fixes #186)
To avoid totally breaking the layout of multicolumn balance reports when
there are multi-commodity balances, these are now rendered on a single
line, comma separated. Simple balance reports still use the old vertical
format for now.
2014-07-03 07:45:55 -07:00
Simon Michael
c31710d942 look harder for decimal point & digit groups (fixes #196)
Amount display styles have been reworked a bit; they are now calculated
after journal parsing, not during it. This allows the fix for #196:
we now search through the amounts until a decimal point is detected,
instead of just looking at the first one; likewise for digit groups.
Digit groups are now implemented with a better type.

Digit group size detection has been improved a little:
1000,000 now gives group sizes [3,4,4,...], not [3,3,...], and
10,000 gives groups sizes [3,3,...] not [3,2,2,..].
(To get [3,2,2,...] you'd use eg 00,00,000.)

There are still some old (or new ?) issues; I don't think we handle
inconsistent decimal points & digit groups too well. But for now all
tests pass.
2014-07-02 23:26:16 -07:00
Simon Michael
647d5833ff clarify dbgAtM issue 2014-07-02 23:24:58 -07:00
Simon Michael
330dfe6891 commodity & amount style parser cleanups, part 2 2014-07-02 17:41:33 -07:00
Simon Michael
9b4b85b4bf commodity & amount style parser cleanups 2014-07-02 11:23:30 -07:00
Simon Michael
8ae303f685 assert only a single commodity, like Ledger (fixes #195)
This change means you can make assertions on a multi-commodity account
balance (asserting one commodity at a time). On the flip side, you can
no longer assert the complete balance of an account (new unexpected
commodities will not be detected.) We might restore that ability later,
using the == syntax.
2014-07-02 07:35:06 -07:00
Simon Michael
0c3148ac7b add an --ignore-assertions flag
Can be helpful when reading Ledger files, where assertions may have
different semantics; or for getting some answers from your journal
to help you fix your assertions.

Could be called --no-assertions, but this might create surprise when it
has an effect contrary to --no-new-accounts.

I had to add another flag throughout the parsers & journal read
functions, ok for now.
2014-07-01 18:26:37 -07:00
Simon Michael
04cfdac0ce query: add >= and <= for amt queries 2014-06-29 11:09:13 -07:00
Simon Michael
201521dc5a a few tweaks 2014-06-24 14:51:09 -07:00
Simon Michael
2eb74d19c6 changelog 2014-06-21 20:14:11 -07:00
Simon Michael
6393293414 allow transformers 0.4* 2014-06-21 20:13:16 -07:00