Commit Graph

5601 Commits

Author SHA1 Message Date
Dmitry Astapov
f1b4618f2d lib: support "every 11th Nov" in period expressions
Useful for periodic transactions
Without it, once-per-year periodic transactions always occur on 1st Jan.
2017-11-26 14:57:37 +00:00
Dmitry Astapov
7acb5d45aa lib: make month names in period expressions case-insensitive
Currently only lower-case account names are supported, both on the
command line, and in the journal (in periodic transactions):

This works:
$ hledger balance -p nov

This does not:
$ hledger balance -p Nov

First transaction will parse, second will not:
```
cat every-month.journal                                                                                                                                ~/devel/haskell/darcs-get/hledger/examples
~ aug to sep
    assets
    expenses    $1

~ Aug to Sep
    assets
    expenses    $2
```

$../bin/hledger-budget bal -f every-month.journal
hledger-budget: Failed to parse "Aug to Sep": date parse error ()

This commit fixes both cases.
2017-11-26 00:25:08 +00:00
Dmitry Astapov
4049455f26 lib: Fix splitSpan for nthdayof{week,month} - start of DateSpan was not covered
Demonstration:

Consider year-test.journal:
```
2015/02/01 first half
    expenses  $1
    assets

2015/07/01 second half
    expenses  $2
    assets

2016/02/01 first half
    expenses  $4
    assets

2016/07/01 second half
    expenses  $8
    assets

2017/02/01 first half
    expenses  $16
    assets

2017/07/01 second half
    expenses  $32
    assets
```

Year balances are good:
```
$ hledger balance -f year-test.journal -p yearly
Balance changes in 2015/01/01-2017/12/31:

          || 2015  2016  2017
==========++==================
 assets   ||  $-3  $-12  $-48
 expenses ||   $3   $12   $48
----------++------------------
          ||    0     0     0
```

Note how first transaction in 2015 is not included. Note that this is old period expression, so this bug exsits in master:
```$ hledger balance -f year-test.journal -p 'every 2nd day of month'
Balance changes in 2015/07/02-2017/07/01:

          || 2015/07/02-2015/08/01  2015/08/02-2015/09/01  2015/09/02-2015/10/01  2015/10/02-2015/11/01  2015/11/02-2015/12/01  2015/12/02-2016/01/01  2016/01/02-2016/02/01  2016/02/02-2016/03/01  2016/03/02-2016/04/01  2016/04/02-2016/05/01  2016/05/02-2016/06/01  2016/06/02-2016/07/01  2016/07/02-2016/08/01  2016/08/02-2016/09/01  2016/09/02-2016/10/01  2016/10/02-2016/11/01  2016/11/02-2016/12/01  2016/12/02-2017/01/01  2017/01/02-2017/02/01  2017/02/02-2017/03/01  2017/03/02-2017/04/01  2017/04/02-2017/05/01  2017/05/02-2017/06/01  2017/06/02-2017/07/01
==========++========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
 assets   ||                     0                      0                      0                      0                      0                      0                    $-4                      0                      0                      0                      0                    $-8                      0                      0                      0                      0                      0                      0                   $-16                      0                      0                      0                      0                   $-32
 expenses ||                     0                      0                      0                      0                      0                      0                     $4                      0                      0                      0                      0                     $8                      0                      0                      0                      0                      0                      0                    $16                      0                      0                      0                      0                    $32
----------++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
          ||                     0                      0                      0                      0                      0                      0                      0                      0                      0                      0                      0                      0                      0                      0                      0                      0                      0                      0                      0                      0                      0                      0                      0                      0
```

Note how 2015 is absent entirely. This is new expression, but i think that general nature of bug is the same...
```
$ hledger balance -f year-test.journal -p 'every 4th Apr'
Balance changes in 2016/04/04-2018/04/03:

          || 2016/04/04-2017/04/03  2017/04/04-2018/04/03
==========++==============================================
 assets   ||                  $-24                   $-32
 expenses ||                   $24                    $32
----------++----------------------------------------------
          ||                     0                      0
```
2017-11-25 21:43:13 +00:00
Dmitry Astapov
fbd28be6cb Allow hledger-budget to generate transactions past the end date of the last real transaction if -b/-e are supplied 2017-11-16 16:45:08 -08:00
Simon Michael
7698d3171e api: allow swagger2 2.2 2017-11-10 20:21:54 -08:00
Simon Michael
56529daadc stack: test with latest nightly resolver 2017-11-10 19:23:09 -08:00
Simon Michael
80e4f2af83 ui: allow brick 0.29 2017-11-10 19:22:48 -08:00
Simon Michael
d3d80a3736 doc: faq: hledger doesn't allow mixed journal/timeclock syntax
[ci skip]
2017-11-09 19:12:58 -08:00
Simon Michael
f5a39f7bc4 doc: csv: expand description part, include examples
[ci skip]
2017-11-05 17:30:31 -08:00
Simon Michael
b312d51b8f doc: csv: drop redundant link to reference
[ci skip]
2017-11-05 17:29:40 -08:00
Simon Michael
0ea9793d81 doc: examples: simplify amazon csv rules slightly
[ci skip]
2017-11-05 17:29:05 -08:00
Simon Michael
49090d9e53 bin: stop listing addons after compiling them 2017-11-01 08:05:17 -07:00
Simon Michael
4ab71f0d0a journal: clarify that txn/posting comments must start with semicolon 2017-11-01 08:04:25 -07:00
Simon Michael
0e4d791371 doc: journal: use consistent semicolon comments in examples
About to add support for # posting comments, but using the semicolon
in examples makes them easier to test with Ledger.

[ci skip]
2017-11-01 06:12:55 -07:00
Simon Michael
949c53e203 doc: introduction cleanups, blurbs
[ci skip]
2017-10-31 14:05:31 -07:00
Simon Michael
c5cf6bcaad doc: move tutorial to Guide, update addons, blurbs
[ci skip]
2017-10-31 13:36:06 -07:00
Simon Michael
18d7c4b02c doc: rename Cookbook to Guide
Might need to be more specific or rename the developer/contributor guide
later. For users, for now, it's Introduction, Guide and Reference.
Still TBD where the basic getting started tutorial lives.

[ci skip]
2017-10-31 13:04:00 -07:00
Simon Michael
e3fc891ea6 doc: argument files: fix typos, add links
[ci skip]
2017-10-31 12:52:23 -07:00
Simon Michael
419395e3d5 doc: argument files: fix cookbook link
[ci skip]
2017-10-31 12:41:05 -07:00
Simon Michael
676eb6e1a2 update embedded manuals 2017-10-31 12:38:37 -07:00
Simon Michael
a3fa09b604 doc: rename/flesh out "argument files" doc, add to cookbook 2017-10-31 12:37:13 -07:00
Simon Michael
a9c4ac24cd prices: doc: link to market prices doc 2017-10-31 12:37:13 -07:00
Simon Michael
a29646cb57 examples: csv: coinbase tweak 2017-10-31 12:37:13 -07:00
Mick Dekkers
df22ba585c doc: fix readme markdown formatting on github 2017-10-31 12:03:26 -07:00
Mykola Orliuk
39d13d68ef test: equity/prices/rewrite now builtin
Fix shell-tests for add-ons that became built-in commands.
2017-10-28 07:14:48 -07:00
Simon Michael
da1cf3b72d update embedded manuals 2017-10-17 07:08:20 -07:00
Simon Michael
24d8336728 tag: first arg filters tag names, the rest filter transactions (#261) 2017-10-17 07:07:34 -07:00
Simon Michael
bf234431ef install: bump version
[ci skip]
2017-10-16 20:31:02 -07:00
Simon Michael
9700387715 install: let hledger-irr use older hledger-lib as it currently requires
We won't need to specify it explicitly I think.

[ci skip]
2017-10-16 20:28:12 -07:00
jeevcat
3a9ea65b99 Rewrite of BalanceAssertion type to track its source position.
Fixes #481.
2017-10-16 13:25:03 -07:00
Simon Michael
87567c9514 doc: investments: avoid capitalising hledger
Lowercase "hledger" is a proper name. Rearranged sentence following per
https://english.stackexchange.com/questions/93127/upper-or-lowercase-letter-if-name-at-the-start-of-the-sentence !

[ci skip]
2017-10-16 08:07:42 -07:00
Simon Michael
8369143a25 tools: travis: note occasional breakage on PRs
[ci skip]
2017-10-16 08:03:43 -07:00
Matthias Kauer
bcb6102940 change capital gains example to use bal without modifier 2017-10-16 08:00:38 -07:00
Matthias Kauer
6d35c91580 Improve investment advice on hledger.org
- Added examplary stock sale to demonstrate how capital gain can be taken
  into account.
- Made value tracking and cost basis caveats more explicit.
- Added links for further reading.
2017-10-16 08:00:38 -07:00
Simon Michael
78c97650f5 budget: include docs in command line help
[ci skip]
2017-10-15 19:35:02 -07:00
Sam Jeeves
b7f8ca2cda Modified test to check for single line number of posting. 2017-10-14 15:11:19 -07:00
Sam Jeeves
11684843a0 Balance assertion errors now show line of failed assertion posting. Fixes #481. 2017-10-14 15:11:19 -07:00
Simon Michael
e33cce52bc import: make --dry output valid journal format
[ci skip]
2017-10-14 08:59:09 -07:00
Simon Michael
08acad3f42 site: contributing: stars! up to 63
[ci skip]
2017-10-10 15:38:46 -07:00
Simon Michael
453e4513c8 site: download: drop comment
[ci skip]
2017-10-10 15:34:10 -07:00
Simon Michael
9c52095f4d site: download: fix comment
[ci skip]
2017-10-10 15:32:56 -07:00
Simon Michael
615f9f10d1 ui: downgrade hpack version string to avoid warnings
[ci skip]
2017-10-10 15:21:23 -07:00
Simon Michael
23c28f140d site: download: use direct github https url for now
[ci skip]
2017-10-10 15:12:58 -07:00
Hans-Peter Deifel
1e609d12a9 ui: Allow brick <0.28 and vty <5.19 2017-10-07 08:57:25 -10:00
Simon Michael
2d75180d37 install: latest 1.4-compatible hledger-diff
[ci skip]
2017-10-05 07:02:45 -10:00
Simon Michael
1bdfbcd106 ui: allow brick < 0.27 2017-10-04 14:55:52 -10:00
Mykola Orliuk
7cb7554ad1 bin: budget: re-factor to use hledgerCommandMode
This is preparation to make it part of of hledger.
2017-10-02 20:17:57 -10:00
Simon Michael
2342951edc site: link 1.4 manuals snapshot
[ci skip]
2017-10-02 17:56:42 -10:00
Simon Michael
e658c301e2 import: doc: update builtin manuals
[ci skip]
2017-10-02 17:56:13 -10:00
Simon Michael
376cfe352c doc: add 1.4 manuals snapshot
[ci skip]
2017-10-02 17:50:15 -10:00