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

"Could not convert CORP to EUR" for commodity in USD #53

Open
alietz opened this issue Dec 7, 2024 · 1 comment
Open

"Could not convert CORP to EUR" for commodity in USD #53

alietz opened this issue Dec 7, 2024 · 1 comment

Comments

@alietz
Copy link

alietz commented Dec 7, 2024

I am testing fava-portfolio-returns for stocks valued in USD, but would like to see their values in EUR. I get a "Could not convert CORP to EUR at 2024-12-04" error when opening Portfolio Returns in Fava. If I switch the group's currency to USD, everything is ok.

beangrow works fine with my example configuration, and the detailed display in fava-portfolio-returns works in EUR, too. Am I doing something wrong here or is there an issue with currency conversion?

option "operating_currency" "USD"
option "operating_currency" "EUR"

1980-05-12 custom "fava-option" "language" "en"
1980-05-12 custom "fava-extension" "fava_portfolio_returns" "{
  'beangrow_config': 'beangrow-example.pbtxt',
}"

2023-01-01 open Assets:US:ETrade:CORP "FIFO"
2023-01-01 open Assets:US:ETrade:Cash USD

2023-01-01 commodity CORP
2023-02-01 price CORP                                   1 USD
2023-07-01 price CORP                                   1.05 USD
2023-08-01 price CORP                                   1.15 USD

2023-02-01 * "Buy 100 CORP"
  Assets:US:ETrade:Cash                           -100.00 USD
  Assets:US:ETrade:CORP                               100 CORP {1 USD}

2010-01-01 commodity EUR 
2023-02-01 price EUR                             1.0697474 USD
2024-12-04 price EUR                                1.0518 USD

The beangrow config is

investments {
  investment {
    currency: "CORP"
    asset_account: "Assets:US:ETrade:CORP"
    cash_accounts: "Assets:US:ETrade:Cash" 
  }
}

groups {
  group {
    name: "CORP"
    currency: "EUR"
    investment: "Assets:US:ETrade:CORP"
  }
}
@alietz alietz changed the title "Please add additional price directives" for currency different from commodity "Could not convert CORP to EUR" for commodity in USD Dec 7, 2024
@andreasgerstmayr
Copy link
Owner

I think the error message is correct, as there is no price directive for CORP to EUR on 2024-12-04, and iirc beancount does not compute transitive prices (first convert CORP to USD and then USD to EUR).

As to why beangrow and the detail page works.. I'm not sure. Possibly the conversion silently fails.

I'm currently working on a UI/UX redesign of this plugin, I'll revisit this ticket again when I'm done.

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

No branches or pull requests

2 participants