Hledger: Default year and periodic transactions

Created on 8 Oct 2018  Â·  7Comments  Â·  Source: simonmichael/hledger

Y2019

~ 4/10  Pay all 2018 Taxes
    Liabilities:Taxes Payable  = USD 0
    chase

This returns no results somehow via hledger print --forecast -p '2019/4/10'

However, this

Y2019

4/10  Pay all 2018 Taxes
    Liabilities:Taxes Payable  = USD 0
    chase

works

$hledger print --forecast  -p '2019/4/10'
2019/04/10 Pay all 2018 Taxes
    Liabilities:Taxes Payable               = USD 0
    Assets:Bank Accounts:Chase Checking

It seems that I need to specify the full year with periodic transactions. Is that true?

A BUG journal

Most helpful comment

(Thanks for the report.)

All 7 comments

I don’t think so, I think it’s that —forecast forecasts only 6 months ahead by default. Specify -e 2020 on command line and it should show up.

On Oct 8, 2018, at 10:39 AM, Tony Xiao notifications@github.com wrote:

Y2019

~ 4/10 Pay all 2018 Taxes
Liabilities:Taxes Payable = USD 0
chase
This returns no results somehow via hledger print --forecast -p '2019/4/10'

However, this

Y2019

4/10 Pay all 2018 Taxes
Liabilities:Taxes Payable = USD 0
chase
works

$hledger print --forecast -p '2019/4/10'
2019/04/10 Pay all 2018 Taxes
Liabilities:Taxes Payable = USD 0
Assets:Bank Accounts:Chase Checking
It seems that I need to specify the full year with periodic transactions. Is that true?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Hmm, this is a test case.

$ cat ./journals/test.journal                                                                                                                                       ✔  10183  18:12:17
Y2018

~ 11/2 Test trans
  bank  -10
  expenses

Y2019

~ 1/2 Test trans 2019
  bank  -10
  expenses
$ hledger -f ./journals/test.journal print --forecast                                                                                                               ✔  10184  18:12:46
2018/11/02 Test trans
    ; recur: 11/2
    bank                 -10
    expenses

notice only the 2018 transaction shows up. The 2019 one is missing and it is def. within 6 months.

I don't remember all the particulars of periodic expression parsing, but
shouldn't both of these start with "every", like "every 1/2"?

On Tue, 9 Oct 2018, 02:13 Tony Xiao, notifications@github.com wrote:

notice only the 2018 transaction shows up. The 2019 one is missing and it
is def. within 6 months.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/simonmichael/hledger/issues/892#issuecomment-428027176,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAHNKs8ty6ISBCBeGgZoGnogjKJbeCw3ks5ui_g9gaJpZM4XNo5q
.

A periodic transaction with a non-recurring date is legal.. it behaves like a regular transaction that appears only with --forecast (or in budget reports).

@tonyxiao, thanks for the test case. I agree, something's wrong there. New guess: periodic transactions do not notice Y, so it's interpreted as 2018/1/2, which is in the past and not displayed by the rules of --forecast. Periodic transactions should notice Y.

This should be fixed now. If a Y default year is in effect, partial/relative dates in periodic transactions now take Y/1/1 as their reference date, instead of today's date.

(Thanks for the report.)

Was this page helpful?
0 / 5 - 0 ratings