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

Unrealized plugin only generates unrealized transactions after the current date (patch included) #6

Open
blais opened this issue May 18, 2016 · 4 comments

Comments

@blais
Copy link
Member

blais commented May 18, 2016

Original report by Jason Chu (Bitbucket: xentac, GitHub: xentac).


This patch will generate an unrealized transaction for once per month, negating the previous month's transaction and adding the current month. This ends up recording monthly change as well as monthly unrealized value in a reasonable way.

I'm sure my style needs help (I know you have a code style, but I haven't been bothered to track down where you may have outlined it), but please tell me if this is way off base or not.

I also couldn't be bothered to make this a proper pull request, so take that for what you will.

@blais
Copy link
Member Author

blais commented May 18, 2016

Original comment by Jason Chu (Bitbucket: xentac, GitHub: xentac).


I did realize that the text for the unrealized transactions should probably be updated to represent the relative change between the last unrealized transaction and the current one. Without that it feels a bit weird seeing "Unrealized loss ..." for 300 USD.

@blais
Copy link
Member Author

blais commented May 18, 2016

Original comment by Jason Chu (Bitbucket: xentac, GitHub: xentac).


There are a bunch of bugs in this patch. Please tell me if my idea is stupid while I work to fix them.

@blais
Copy link
Member Author

blais commented May 19, 2016

Original comment by Martin Blais (Bitbucket: blais, GitHub: blais).


Thanks Jason!
A couple of questions:

  1. Is it backwards compatible? I haven't had time to read the code yet. Focused on "booking" code for a while.
  2. Could you run it in a separate repo for a while and iron out issues as they arise? The "plugin" path can be anything in your PYTHONPATH.

I do appreciate the patch, especially if it is backwards-compatible, though I'd like to eventually find a reporting-only solution to report returns over synthesizing realizations (but plugins are a great to experiment with alternatives in any case).

@blais
Copy link
Member Author

blais commented May 19, 2016

Original comment by Jason Chu (Bitbucket: xentac, GitHub: xentac).


  1. Yes, it's entirely a drop in replacement to the previous version. In fact, if you were to change the code slightly, you can get exactly the same result by just using entries[-1].date instead of looping over every month.

  2. That sounds like a way better idea than what I did. I'll totally do that.

I'd like a reporting-only solution as well, but I'm having trouble picturing how that would actually work, apart from evaluating totals as market value instead of book value.

blais referenced this issue in beancount/beancount May 23, 2020
CSV importer should report zero valued balances

Approved-by: Martin Blais
@blais blais transferred this issue from beancount/beancount Jan 28, 2021
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

1 participant