Skip to content
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

Fails for multi-currency journals #11

Open
schoettl opened this issue Aug 17, 2021 · 5 comments · May be fixed by #13
Open

Fails for multi-currency journals #11

schoettl opened this issue Aug 17, 2021 · 5 comments · May be fixed by #13

Comments

@schoettl
Copy link

schoettl commented Aug 17, 2021

With the current version of hledger-interest from stackage, it fails for multi-currency journals.

As a minimal example, I provide a shelltest file:

<
2021-01-01 deposit
  assets   100 €
  income

2021-01-01 deposit
  assets   100 $
  income

2021-07-01 deposit
  assets   100 €
  income

$ hledger-interest -f- -s income:interest -t assets:interest --act --constant=0.01 --quiet assets
>
2021/07/01 1% interest for 100 $, 100 € over 181 days
    assets:interest               0
    assets:interest               0
    income:interest               0
    income:interest               0

Install shelltestrunner und run with shelltest this-file.test. The problematic output of hledger-interest is this:

2021/07/01 1% interest for 100 $
100 € over 181 days
    assets:interest               0
    assets:interest               0
    income:interest               0
    income:interest               0

It's obviously not a valid hledger journal file.

@schoettl
Copy link
Author

Beside that, I wonder why I don't get interests in half a year?

@peti
Copy link
Owner

peti commented Sep 27, 2021

You can have any interest interval you want with --annual-schedule.

@schoettl
Copy link
Author

You can have any interest interval you want with --annual-schedule.

You mean without that option, the interest rate is only "paid" at the end of a year? But then, why is the transaction "1% interest for …" with 0 printed in the example above? If it's not paid?

@peti
Copy link
Owner

peti commented Nov 1, 2021

You mean without that option, the interest rate is only "paid" at the end of a year? But then, why is the transaction "1% interest for …" with 0 printed in the example above? If it's not paid?

Interest transactions are generated on two occasions: at the end of the interest period and every time the account's balance changes.

@schoettl
Copy link
Author

schoettl commented Nov 1, 2021

OK... So if I want to know current interests during the year, I can add a zero-transaction today...

But is it intended that hledger-interest seems to round or floor interrests? In this example I'd expect 0,5 € interests but get 0 €.

<
2021-01-01 deposit
  assets   100
  income

2021-07-01 zero transaction
  assets  0
  income

$ hledger-interest -f- -s income:interest -t assets:interest --bgb288 --constant=0.01 --quiet assets
>
2021-07-01 1% interest for 100 over 181 days
    assets:interest               0.5
    income:interest              -0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants