Commit Graph

378 Commits

Author SHA1 Message Date
Simon Michael
d897bacdfe journal: more failing tests for spaced amounts (#749)
[ci skip]
2018-05-17 16:17:06 -07:00
Simon Michael
1c6702d598 budget: note some todos
[ci skip]
2018-05-17 08:12:14 -07:00
Simon Michael
5e725ff36e journal: add tests for #749, commented 2018-05-17 07:51:47 -07:00
Simon Michael
5516622472 journal: consolidate amount/commodity func tests 2018-05-17 06:57:27 -07:00
Simon Michael
3bf0f19bb5 budget: another func test against my confusion 2018-05-16 17:23:15 -07:00
Simon Michael
999080af89 fix budget func test 2018-05-16 12:55:06 -07:00
Simon Michael
330c58d2b4 budget: extra func test for something I get confused about with aliases 2018-05-16 11:25:30 -07:00
Simon Michael
9151f5004e budget: show a budget report even with no interval (for whole journal period) 2018-04-24 23:12:42 -07:00
Simon Michael
568a442307 budget: tweak hiding/grouping of unbudgeted accounts
It now works slightly differently. Eg:

- <unbudgeted>'s subaccounts are hidden by default
- --show-unbudgeted shows all unbudgeted accounts, including subaccounts of budgeted parents
- --show-unbudgeted doesn't affect the grouping under <unbudgeted>

IMHO it's a nice simplification and increase in consistency, while still meeting the original intent.
2018-04-24 13:42:12 -07:00
Simon Michael
8759f12b63 budget: more consistent display of percentage 2018-04-23 18:52:28 -07:00
Simon Michael
0c140d7238 budget: allow multi-interval budgets again
Budgets were restricted to a single interval in 1.9, but this was
a mistake. This restores the 1.5 behaviour, where a budget can be built
up from multiple periodic transactions with different intervals.
2018-04-23 18:52:28 -07:00
Simon Michael
43287a3e26 budget: use a new first-class BudgetReport for --budget 2018-04-23 18:52:28 -07:00
Simon Michael
0b380971f7 journal: require a decimal point in commodity/format/D directives
A commodity directive that doesn't specify the decimal point character
increases ambiguity and the chance of misparsing numbers, especially
as it overrides all style information inferred from the journal amounts.
In some cases it caused amounts with a decimal point to be parsed as if
with a digit group separator so 1.234 became 1234.

We could augment it with extra info from the journal amounts, when available,
but it would still be possible to be ambiguous, and that won't be obvious.

A commodity directive is what we recommend to nail down the style.
It seems the simple and really only way to do this reliably is to require
an explicit decimal point character. Most folks probably do this already.

Unfortunately, it makes another potential incompatiblity with ledger and
beancount journals. But the error message will be clear and easy to
work around.
2018-04-20 21:56:06 -07:00
Simon Michael
3f2827424c refactor: number parsing docs 2018-04-20 21:39:06 -07:00
Simon Michael
3d4f5600ae journal: infer and balance amounts with standard amount styles (fix #737)
Inferred amounts now have the appropriate standard amount style applied.
And when checking for balanced transactions, amount styles declared with
commodity directives are also used (previously only inferred amount styles were).
2018-04-20 13:40:05 -07:00
Dmitry Astapov
0c835acd18 lib, app: better descriptions for forecast transactions 2018-04-18 16:05:08 -07:00
Dmitry Astapov
d82370d10b lib, app, web: remove differences between command line and journal file aliases 2018-04-17 16:09:11 -07:00
Dmitry Astapov
93814652f8 lib: auto postings are generated right after posting that triggered them (#729) 2018-04-17 14:33:32 -07:00
Simon Michael
a5d70debbb cli: disable failing test (#727) 2018-04-08 18:38:54 -07:00
Simon Michael
cc1db7be98 bal: failing test for account code sorting (#727)
[ci skip]
2018-04-06 05:42:00 -07:00
Simon Michael
4822b53f69 scientific notation test notes (#704, #706) 2018-03-31 02:42:37 +01:00
Simon Michael
c95982381b remove test unrelated to scientific notation (#704, #706) 2018-03-31 01:50:06 +01:00
Mykola Orliuk
b377bff90a lib: support scientific number notation (#704, #706)
closes simonmichael/hledger#704
2018-03-31 01:49:46 +01:00
Simon Michael
2a87ea56ff budget: refactor; show budget goals even with no or zero actual
This makes budget reports more intuitive. It is a temporary hack which
can misorder columns in some cases (if actual and budget activity
occur in a different range of columns). We should redo this in a more
principled way.
2018-03-30 03:26:32 +01:00
Simon Michael
fc3a71bc46 budget: more tests 2018-03-29 16:36:31 +01:00
Simon Michael
38289686b7 budget: convert tests to format 3 2018-03-29 15:56:09 +01:00
Simon Michael
6f8714cdbd update budget func. tests 2018-03-29 15:49:31 +01:00
Simon Michael
10a4392b24 update functional tests for new monthly headings 2018-03-29 14:54:36 +01:00
Simon Michael
fb5c0dba22 bin: delete hledger-budget func. tests 2018-03-21 12:36:26 +00:00
Simon Michael
7550a1dcb8 convert register tests to new format, test stderr, reveal travis issue 2018-02-16 01:22:08 -08:00
Simon Michael
e491f513a1 cli: tabular reports no longer have a trailing blank line added
Tabular reports from bal, bs etc. have until now been rendered on
the terminal with one final blank line, for readability.
This change drops the blank line.

This is consistent with the non-tabular balance and register output
(not print, which is a special case), and with most unix commands.
The real reason for it, which I admit is flimsy, is that I can now omit
the final delimiter (>=0) when using shelltestrunner 1.9's new format,
making functional tests easier to maintain and more readable.
If there's opposition, this could be reverted.
2018-01-23 12:47:56 -08:00
Simon Michael
e43c430a61 bal: clarify some todo tests, use shelltestrunner's format 3 2018-01-23 12:17:14 -08:00
Simon Michael
6c60e4a97b bs/cf/is: always show a tabular report, even with no report interval
Previously, if you specified no report interval, the text output of
these commands was a simple report like the original balance command,
with amounts on the left and account names on the right. Also,
balances used arithmetic sign like the balance command.
Now it always draws a table, with account names in the left
column, and shows balances with normal-positive sign, consistent with
the multicolumn reports. Less code, fewer bugs.
2018-01-23 11:05:01 -08:00
Simon Michael
c4b778bfb9 update report titles in func. tests 2018-01-22 07:58:01 -08:00
Simon Michael
6b349e3123 bs/bse/cf/is: show all balances as normally-positive (experimental)
Income, liability and equity balances, which until now we have
always displayed as negative numbers, are now shown as normally positive
by these reports.
Negative numbers now indicate a contra-balance (eg an overdrawn
checking account), a net loss, a negative net worth, etc.
This makes these reports more like conventional financial statements,
and easier to read and share with normal people.
2018-01-18 11:01:07 -08:00
Simon Michael
1234671c69 equity: rename to close 2018-01-03 17:02:35 -08:00
Simon Michael
31effcd731 equity: ignore any begin date; closed balances are historical 2018-01-03 13:50:16 -08:00
Simon Michael
2d66f8cf04 fix some 2017-isms in func. tests 2018-01-01 15:47:31 -08:00
Simon Michael
ecdbc05703 Merge branch 'feature/space-as-digits-sep' of https://github.com/ony/hledger into ony-feature/space-as-digits-sep 2017-12-30 09:29:22 -08:00
Simon Michael
8f55b6137d uses today's prices, not those of last txn date, for -V (fix #683,#648) 2017-12-29 21:42:59 -08:00
Dmitry Astapov
58c755df86 lib: fix budget display to always show %% consumed and handle costs
For multi-column balance report, if there are no transactions in the
given period for budgeted account, display [0% of <budget>] for
consistency.

If balance is a mix of commodities, convert to cost basis for the
purposes of computing percent of balance spent.
2017-12-01 15:52:29 -08:00
Mykola Orliuk
47766ea9d4 journal: support space as digits sep
Resolves simonmichael/hledger#330
2017-11-29 17:20:18 +01:00
Mykola Orliuk
e58272f28f journal: use groups sep and prec for decimal hint
Use whole AmountStyle in process of resolving decimal/groups separator
ambiguity.

Resolve simonmichael/hledger#399
2017-11-27 15:47:56 -08:00
Mykola Orliuk
7cbdeb40a4 journal: get decimal hint from default commodity
If appropriate commodity directive is missing fallback to default
commodity directive to get number representation style.
2017-11-27 15:47:56 -08:00
Mykola Orliuk
b7dbe044b0 journal: use decimal sep hint for amount parser
Make use of commodity format directive as a hint for parsing amount.

Kinda resolves simonmichael/hledger#487
2017-11-27 15:47:56 -08:00
Mykola Orliuk
bcf7a1add5 journal: make numbers parsing more strict
- Hunt down adjacent punctuations with altering char.
- Add some tests dedicated to parsing amounts.
2017-11-27 15:47:56 -08:00
Mykola Orliuk
53ad035b24 journal: limit scope of directives backtracking
Effectively improves error reporting for directives.

Resolves simonmichael/hledger#402
2017-11-27 14:32:48 -08:00
Dmitry Astapov
8cd58b71ab bal: show percentage of budget spent 2017-11-26 14:57:41 +00:00
Dmitry Astapov
6ea5da2d9d bal: --budget shows budget performance
Budget goals specified with periodic transactions (as with
hledger-budget) can now be displayed in balance report (but not in bs/is/cf).

--budget shows the target amount and percentage alongside the actual
amount, per account and period.

Unbudgeted accounts will be hidden, unless --show-unbudgeted is used.

Budgeted accounts are displayed folded (depth-clipped) at a depth
matching the budget specification. Unbudgeted accounts, if shown, are
displayed at their usual depth (in full detail, or according to --depth).
2017-11-26 14:57:41 +00:00
Dmitry Astapov
23f3da4e92 cli: --auto adds automated postings to reports
Ledger-style automated postings, previously supported only by
hledger-budget, have landed as a first-class feature.  The --auto
flag activates them, so that any postings they generate are
included in reports.
2017-11-26 14:57:41 +00:00