New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using periodic transactions #847

Closed
cnicolai opened this Issue Jul 24, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@cnicolai
Contributor

cnicolai commented Jul 24, 2018

Hi there,

let me start by thanking you for all the work you put in hledger! It is an amazing tool that I really enjoy using! :-)

Consider the following journal file test.journal:

2018/07/01 Cake
	expenses:Food			1€
	assets:Cash		       -1€

~ monthly
	expenses:Food                    19€
	assets:Cash                     -19€ 

Running hledger -f test.journal reg --forecast -e oct results in the expected output

2018/07/01 Cake                           expenses:Food                             1€            1€
                                          assets:Cash                              -1€             0
2018/08/01                                expenses:Food                            19€           19€
                                          assets:Cash                             -19€             0
2018/09/01                                expenses:Food                            19€           19€
                                          assets:Cash                             -19€             0

The following journal file used to work for me:

2018/07/01 Cake
	expenses:Food			1€
	assets:Cash			   -1€

~ every 2nd Thursday
	expenses:Food                    19€
	assets:Cash                     -19€ 

Here, ~ monthly in the periodic transaction is replaced with ~ every 2nd Thursday.
Running hledger -f test.journal reg --forecast -e oct now results in
hledger: Prelude.head: empty list.

Is this a regression or am I missing something? Any help is appreciated.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Jul 24, 2018

Owner

You are welcome! And thanks for the report. It looks like the capital T breaks it!

Owner

simonmichael commented Jul 24, 2018

You are welcome! And thanks for the report. It looks like the capital T breaks it!

@cnicolai

This comment has been minimized.

Show comment
Hide comment
@cnicolai

cnicolai Jul 24, 2018

Contributor

Thanks a lot for the quick help. The capital T indeed seems to be the problem, lower-casing the weekdays in my way more complex journal fixes the problem as well.

I have very rudimentary knowledge of Haskell and basically no knowledge about hledger, so I'm afraid I can't help fix the bug.
I'm in the process of learning Haskell, so maybe in a few months when I find bugs I can try to fix them myself.

Thanks again!

Contributor

cnicolai commented Jul 24, 2018

Thanks a lot for the quick help. The capital T indeed seems to be the problem, lower-casing the weekdays in my way more complex journal fixes the problem as well.

I have very rudimentary knowledge of Haskell and basically no knowledge about hledger, so I'm afraid I can't help fix the bug.
I'm in the process of learning Haskell, so maybe in a few months when I find bugs I can try to fix them myself.

Thanks again!

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Jul 24, 2018

Owner

That would be great. If you get the urge, you are welcome to come on #hledger and ask for help working through a fix.

Owner

simonmichael commented Jul 24, 2018

That would be great. If you get the urge, you are welcome to come on #hledger and ask for help working through a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment