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

How to create a report for former years? #134

Open
tobias-p opened this issue May 15, 2022 · 8 comments
Open

How to create a report for former years? #134

tobias-p opened this issue May 15, 2022 · 8 comments
Labels
bug Something isn't working Taxman

Comments

@tobias-p
Copy link

Another - maybe stupid - question and/or a feature request:

Is it possible to create reports for each year without having a file for each year and running the app several times?

@provinzio
Copy link
Owner

provinzio commented May 15, 2022

You can currently only run and get the report for a specific year (selected in config.ini).

How long does it take for you to create a report for a year? (Without price fetching as this will be saved for future runs)

Consecutive runs shouldn't take as long as the first one

What do you mean by "a file for each year". Do you want s report that covers more than one year? I don't see the reason for that.

Please explain further.

@tobias-p
Copy link
Author

You can currently only run and get the report for a specific year (selected in config.ini).

This was something I missed in config (overread it)... I just wanted to be able to create a report for each year I had coins but never thought about reaching them in in my tax (never really sold some of them before 2020, so that shouldn't be a problem).

Creating the report for 2021 didn't took so long since the price fetching was done... it was at max 3 mins...

@provinzio
Copy link
Owner

Ok. 3 min is not perfect but I find it acceptable for now.

Price fetching is currently really bad as each price is fetched on its own. So each line is one price fetch.
Adding this information to the readme is a good idea.

#16 does work on that by grouping the required prices and fetching them all at once.

@tobias-p
Copy link
Author

3 mins for the really huge report is pretty good i thin (check out in discussion, I wrote how many lines I've got for each part).. Checked out the log, it was less than 2 mins

Another thing I found after creating all reports from former years: in 2021 I have everything of all former years within... This shouldn't happen, because sellings/airdrops/etc of former years should not appear in 2021

maybe I missed another thing in the config?

@provinzio
Copy link
Owner

There is only one tax year option in the config file. Sounds like a bug. Please debug the taxman.py and checkt that the function is_in_tax_year is called before something is added to the export. Looking forward to your findings.

@tobias-p
Copy link
Author

tobias-p commented May 15, 2022

There is only one tax year option in the config file. Sounds like a bug. Please debug the taxman.py and checkt that the function is_in_tax_year is called before something is added to the export. Looking forward to your findings.

the bug is in the book.py where you only check if utc_time.year <= config.TAX_YEAR and change != 0
since everything in eg 2014 happened befor 2021, everything will be added...
EDIT1: found this in _append_operation and append_operation

EDIT 2: strikethrough wrong suggestion.

EDIT3: the upper ones were wrong... here's the correct destination:
I think the bug is in the taxman.py where you assert op.utc_time.year <= config.TAX_YEAR in line 621

EDIT 4: the striked suggestion is possibly not so wrong as I thought, since you add the single operations in book after you got the prices... so the bug is in the book.py where you only check if utc_time.year <= config.TAX_YEAR and change != 0 and this should be the right one 😄

@provinzio
Copy link
Owner

provinzio commented May 16, 2022

Each evaluation is done by scratch. It's necessary to add all operations to the book and balance them to calculate the correct balance at the beginning of the year.

So in evaluation: everything has to be balanced. But only the tax year operations should be added to the export. (TaxReportEntry)

@provinzio
Copy link
Owner

Another thing I found after creating all reports from former years: in 2021 I have everything of all former years within... This shouldn't happen, because sellings/airdrops/etc of former years should not appear in 2021

I checked this out and this doesn't happen for me. I can not reproduce your problem. All transactions before TAX_YEAR are added to the operations variable. All operations are balanced but only the transactions in TAX_YEAR are added to the report (see taxman.py).

Please debug your evaluation. You might want to set a breakpoint in taxman.export_evaluation_as_excel and check which older operations get added and debug from there. Looking forward for your reply.

@provinzio provinzio added bug Something isn't working Taxman labels Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Taxman
Projects
None yet
Development

No branches or pull requests

2 participants