diff --git a/jal/data_export/tax_reports/portugal.json b/jal/data_export/tax_reports/portugal.json index 30521bb0..addf5311 100644 --- a/jal/data_export/tax_reports/portugal.json +++ b/jal/data_export/tax_reports/portugal.json @@ -1,57 +1,8 @@ { "2022": { - "tax_treaty": ["ad", "ae","ao","at","bb", "be", "bg","bh", "br", "ca", "ch", "ci", "cl", "co", "cn", "cv", "cu", "cy", "cz", "de", "dk", "dz", "ee", "es", "et", "fr", "gb", "ge", "gr", "gw", "hk", "hr", "hu", "id", "ie", "il", "in", "is", "it", "jp", "ke", "kr", "kw", "lv", "lt", "lu", "ma", "md", "me", "mo", "mt", "mx", "mz", "nl", "no", "om", "pa", "pe", "pk", "pl", "qa", "ro", "ru", "sa", "se", "sg", "si", "sk", "sm", "sn", "st", "tl", "tn", "tr", "ua", "us", "uy", "ve", "vn", "za"], - "currency_devaluation": { - "2000": 1.44, - "2001": 1.35, - "2002": 1.30, - "2003": 1.26, - "2004": 1.24, - "2005": 1.21, - "2006": 1.17, - "2007": 1.15, - "2008": 1.11, - "2009": 1.13, - "2010": 1.11, - "2011": 1.07, - "2012": 1.04, - "2013": 1.04, - "2014": 1.04, - "2015": 1.04, - "2016": 1.03, - "2017": 1.02, - "2018": 1.01, - "2019": 1.01, - "2020": 1.01, - "2021": 1.00 - } + "tax_treaty": ["ad", "ae","ao","at","bb", "be", "bg","bh", "br", "ca", "ch", "ci", "cl", "co", "cn", "cv", "cu", "cy", "cz", "de", "dk", "dz", "ee", "es", "et", "fr", "gb", "ge", "gr", "gw", "hk", "hr", "hu", "id", "ie", "il", "in", "is", "it", "jp", "ke", "kr", "kw", "lv", "lt", "lu", "ma", "md", "me", "mo", "mt", "mx", "mz", "nl", "no", "om", "pa", "pe", "pk", "pl", "qa", "ro", "ru", "sa", "se", "sg", "si", "sk", "sm", "sn", "st", "tl", "tn", "tr", "ua", "us", "uy", "ve", "vn", "za"] }, "2023": { - "tax_treaty": ["ad", "ae","ao","at","bb", "be", "bg","bh", "br", "ca", "ch", "ci", "cl", "co", "cn", "cv", "cu", "cy", "cz", "de", "dk", "dz", "ee", "es", "et", "fr", "gb", "ge", "gr", "gw", "hk", "hr", "hu", "id", "ie", "il", "in", "is", "it", "jp", "ke", "kr", "kw", "lv", "lt", "lu", "ma", "md", "me", "mo", "mt", "mx", "mz", "nl", "no", "om", "pa", "pe", "pk", "pl", "qa", "ro", "ru", "sa", "se", "sg", "si", "sk", "sm", "sn", "st", "tl", "tn", "tr", "ua", "us", "uy", "ve", "vn", "za"], - "currency_devaluation": { - "2000": 1.56, - "2001": 1.46, - "2002": 1.40, - "2003": 1.36, - "2004": 1.34, - "2005": 1.31, - "2006": 1.26, - "2007": 1.24, - "2008": 1.20, - "2009": 1.22, - "2010": 1.20, - "2011": 1.16, - "2012": 1.12, - "2013": 1.12, - "2014": 1.12, - "2015": 1.12, - "2016": 1.11, - "2017": 1.10, - "2018": 1.09, - "2019": 1.09, - "2020": 1.09, - "2021": 1.08, - "2022": 1.00 - } + "tax_treaty": ["ad", "ae","ao","at","bb", "be", "bg","bh", "br", "ca", "ch", "ci", "cl", "co", "cn", "cv", "cu", "cy", "cz", "de", "dk", "dz", "ee", "es", "et", "fr", "gb", "ge", "gr", "gw", "hk", "hr", "hu", "id", "ie", "il", "in", "is", "it", "jp", "ke", "kr", "kw", "lv", "lt", "lu", "ma", "md", "me", "mo", "mt", "mx", "mz", "nl", "no", "om", "pa", "pe", "pk", "pl", "qa", "ro", "ru", "sa", "se", "sg", "si", "sk", "sm", "sn", "st", "tl", "tn", "tr", "ua", "us", "uy", "ve", "vn", "za"] } } \ No newline at end of file diff --git a/jal/data_export/tax_reports/portugal.py b/jal/data_export/tax_reports/portugal.py index 09b210f1..d05ae1e8 100644 --- a/jal/data_export/tax_reports/portugal.py +++ b/jal/data_export/tax_reports/portugal.py @@ -1,5 +1,4 @@ from decimal import Decimal -from datetime import datetime, timezone from jal.constants import PredefinedAsset, PredefinedCategory from jal.db.operations import AssetPayment, CorporateAction from jal.data_export.taxes import TaxReport @@ -49,15 +48,6 @@ def prepare_dividends(self): self.insert_totals(dividends_report, ["amount", "amount_eur", "tax", "tax_eur"]) return dividends_report - def inflation(self, timestamp: int) -> Decimal: - year = datetime.fromtimestamp(timestamp, tz=timezone.utc).strftime('%Y') - inflation_coefficients = self._parameters['currency_devaluation'] - try: - coefficient = Decimal(inflation_coefficients[year]) - except KeyError: - coefficient = Decimal('1') - return coefficient - # ---------------------------------------------------------------------------------------------------------------------- def prepare_stocks_and_etf(self): deals_report = [] @@ -72,10 +62,6 @@ def prepare_stocks_and_etf(self): if trade.qty() >= Decimal('0'): # Long trade value_realization = round(trade.close_amount(no_settlement=ns), 2) value_acquisition = round(trade.open_amount(no_settlement=ns), 2) - inflation = self.inflation(trade.open_operation().settlement()) - if inflation != Decimal('1'): - value_acquisition = value_acquisition * inflation - note = f"Acquisition inflation coefficient {inflation:.2f} for year {datetime.fromtimestamp(trade.open_operation().settlement(), tz=timezone.utc).strftime('%Y')}\n" else: # Short trade value_realization = round(trade.open_amount(no_settlement=ns), 2) value_acquisition = round(trade.close_amount(no_settlement=ns), 2)