Skip to content

Commit

Permalink
Absent country error message was improved for dlsg export.
Browse files Browse the repository at this point in the history
  • Loading branch information
titov-vv committed Apr 1, 2024
1 parent cab0740 commit 600aba3
Show file tree
Hide file tree
Showing 35 changed files with 184 additions and 162 deletions.
10 changes: 6 additions & 4 deletions jal/data_export/dlsg.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,18 @@ def currency_rates_record(self, rate):
return currency_record

def append_dividend(self, dividend):
if dividend["country_iso"] == '000':
logging.error(self.tr(
"Account country is not set for asset, dividend isn't include in 3-NDFL ") + f"'{dividend['symbol']}'")
return
if self._broker_as_income:
income_source = self.broker_name
income_iso_country = self.broker_iso_country
if income_iso_country == '000':
logging.error(self.tr("Account country is not set for asset, dividend isn't exported into 3-NDFL ") + f"'{income_source}'")
return
else:
income_source = f"Дивиденд от {dividend['symbol']} ({dividend['full_name']})"
income_iso_country = dividend["country_iso"]
if income_iso_country == '000':
logging.error(self.tr("Country is not set for asset, dividend isn't exported into 3-NDFL ") + f"'{income_source}'")
return
if self._year == 2020:
income = (14, '1010', 'Дивиденды', income_source, income_iso_country)
else:
Expand Down
Loading

0 comments on commit 600aba3

Please sign in to comment.