-
Notifications
You must be signed in to change notification settings - Fork 1
Things #1
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
Things #1
Conversation
stefanmoro
commented
Mar 26, 2025
•
edited
Loading
edited
- Filter out order types not relevant for K4 (E.g. STC since they are form other countries)
- Use exchange rates from files exported from riksbanken (No copy paste error & daily rates)
- Support both yearly and daily exchange rates (allow optimizing for minimum gain and tax)
Hämta växelkurs från: | ||
https://www.riksbank.se/sv/statistik/rantor-och-valutakurser/valutakurser-till-deklarationen/ | ||
Uppdatera `usd_sek_daily/yearly.xlsx` genom att exportera årlig/daglig USD/SEK som xlsx från | ||
https://www.riksbank.se/sv/statistik/rantor-och-valutakurser/sok-rantor-och-valutakurser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you just pull this down with the script or is the URL not known?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can check that out when I get time. Worst case it's a "once per year" manual job (https://xkcd.com/1205/ :) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha yeah good point but in that case, maybe we remove the local files and make it a flag instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That definitely works as well - no strong opinions!
The exports currently checked in are yearly respective daily rates for the timeperiod [2020-01-01,2024-12-31]. I checked them in for convenience. By having them checked in, someone would update them once a year, and everyone else would just pull the latest changes. and be able to calculate for the new year.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made it use flags instead mostly so that I got a chance to play with cursor 😜
k4.py
Outdated
@@ -5,6 +5,18 @@ | |||
from dataclasses import dataclass | |||
|
|||
SALES_PER_PAGE = 7 | |||
BLACKLISTED_ORDER_TYPES = ["RS STC"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are RS or STC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it stands for "Restricted Stocks Sell To Cover"
Filter out order types not relevant for k4. E.g. exclude "RS STC" from other countries and ESPP if added to the export.
* Use xlsx exports from riksbanken for exchange rates, reduce risk of incorrect rate * Support both yearly/daily exchange rates, allowing user to choose the one that gives lowest gain (and hence tax)