From 8728dd31278b255bcfdf1e94043c65172543f2b0 Mon Sep 17 00:00:00 2001 From: Vlad <55182132+titov-vv@users.noreply.github.com> Date: Fri, 24 May 2024 13:20:11 +0100 Subject: [PATCH] Bond russian tax report handling was improved. --- jal/data_export/dlsg.py | 8 +- jal/data_export/tax_reports/russia.py | 9 +- tests/test_data/taxes_bond_rus.json | 225 +++---- tests/test_data/taxes_rus.json | 919 +++++++++++++------------- 4 files changed, 585 insertions(+), 576 deletions(-) diff --git a/jal/data_export/dlsg.py b/jal/data_export/dlsg.py index e3b6f125..1521aa59 100644 --- a/jal/data_export/dlsg.py +++ b/jal/data_export/dlsg.py @@ -270,13 +270,13 @@ def append_dividend(self, dividend): self._tax_form['sections']['@DeclForeign'][next_label] = income def append_stock_trade(self, trade): - if trade['qty'] < 0: # short position - swap close/open dates/rates + if trade['c_qty'] < 0: # short position - swap close/open dates/rates trade['cs_date'] = trade['os_date'] trade['cs_rate'] = trade['os_rate'] if self._broker_as_income: income_source = self.broker_name else: - income_source = f"Доход от сделки с {trade['symbol']} ({trade['isin']})" + income_source = f"Доход от сделки с {trade['c_symbol']} ({trade['c_isin']})" income_iso_country = self.broker_iso_country if self._year == 2020: income = (13, '1530', '(01)Доходы от реализации ЦБ (обращ-ся на орг. рынке ЦБ)', @@ -325,13 +325,13 @@ def append_bond_interest(self, interest): self._tax_form['sections']['@DeclForeign'][next_label] = income def append_derivative_trade(self, trade): - if trade['qty'] < 0: # short position - swap close/open dates/rates + if trade['c_qty'] < 0: # short position - swap close/open dates/rates trade['cs_date'] = trade['os_date'] trade['cs_rate'] = trade['os_rate'] if self._broker_as_income: income_source = self.broker_name else: - income_source = f"Доход от сделки с {trade['symbol']}" + income_source = f"Доход от сделки с {trade['c_symbol']}" income_iso_country = self.broker_iso_country if self._year == 2020: income = (13, '1532', diff --git a/jal/data_export/tax_reports/russia.py b/jal/data_export/tax_reports/russia.py index db6e4144..2c9ebf27 100644 --- a/jal/data_export/tax_reports/russia.py +++ b/jal/data_export/tax_reports/russia.py @@ -186,9 +186,12 @@ def prepare_bonds(self): spending_rub = round(trade.close_amount(self._currency_id, no_settlement=ns), 2) + round(trade.fee(self._currency_id), 2) - round(trade.close_operation().accrued_interest(self._currency_id), 2) line = { 'report_template': "bond_trade", - 'symbol': trade.asset().symbol(self.account_currency.id()), - 'isin': trade.asset().isin(), - 'qty': trade.qty(), + 'c_symbol': trade.asset().symbol(self.account_currency.id()), + 'c_isin': trade.asset().isin(), # May be not used in template (for derivatives as example) + 'c_qty': trade.qty(), + 'o_symbol': trade.open_operation().asset().symbol(), + 'o_isin': trade.open_operation().asset().isin(), + 'o_qty': trade.open_qty(), 'principal': trade.asset().principal(), 'country_iso': country.iso_code(), 'o_type': "Покупка" if trade.qty() >= Decimal('0') else "Продажа", diff --git a/tests/test_data/taxes_bond_rus.json b/tests/test_data/taxes_bond_rus.json index e15a28c9..e061c60f 100644 --- a/tests/test_data/taxes_bond_rus.json +++ b/tests/test_data/taxes_bond_rus.json @@ -1,119 +1,122 @@ { - "Акции":[ + "Акции":[ - ], - "Дивиденды":[ + ], + "Дивиденды":[ - ], - "Комиссии":[ + ], + "Комиссии":[ - ], - "Криптовалюты":[ + ], + "Криптовалюты":[ - ], - "Облигации":[ - { - "c_amount":2062.5, - "c_amount_rub":149994.28, - "c_date":1632515100, - "c_fee":0.0, - "c_fee_rub":0.0, - "c_int":0.0, - "c_int_rub":0.0, - "c_number":"17849517124", - "c_price":103.125, - "c_rate":72.7245, - "c_type":"Продажа", - "country_iso":"840", - "cs_date":1632515100, - "cs_rate":72.7245, - "income":2062.5, - "income_rub":149994.28, - "isin":"US912CALAN84", - "o_amount":1274.18, - "o_amount_rub":93618.72, - "o_date":1622131065, - "o_fee":2.0, - "o_fee_rub":146.95, - "o_int":25.69, - "o_int_rub":1887.54, - "o_number":"2882737839", - "o_price":63.709, - "o_rate":73.4737, - "o_type":"Покупка", - "os_date":1622246400, - "os_rate":73.4737, - "principal":1000.0, - "profit":760.63, - "profit_rub":54341.07, - "qty":2.0, - "report_template":"bond_trade", - "spending_rub":95653.21, - "symbol":"X 6 1/4 03/15/26 - PARTIAL CALL RED DATE 9/26" - }, - { - "country_iso":"840", - "empty":"", - "income_rub":4508.46, - "interest":62.0, - "interest_rub":4508.46, - "isin":"US912909AN84", - "number":"", - "o_date":1631664000, - "profit":62.0, - "profit_rub":4508.46, - "rate":72.7171, - "report_template":"bond_interest", - "spending_rub":0.0, - "symbol":"X 6 1/4 03/15/26", - "type":"Купон" - }, - { - "country_iso":"840", - "empty":"", - "income_rub":36.36, - "interest":0.5, - "interest_rub":36.36, - "isin":"US912909AN84", - "number":"TEST_ID", - "o_date":1631664000, - "profit":0.5, - "profit_rub":36.36, - "rate":72.7171, - "report_template":"bond_interest", - "spending_rub":0.0, - "symbol":"X 6 1/4 03/15/26", - "type":"Купон" - }, - { - "country_iso":"840", - "empty":"", - "income_rub":278.89, - "interest":3.82, - "interest_rub":278.89, - "isin":"US912CALAN84", - "number":"", - "o_date":1632700800, - "profit":3.82, - "profit_rub":278.89, - "rate":73.0081, - "report_template":"bond_interest", - "spending_rub":0.0, - "symbol":"X 6 1/4 03/15/26 - PARTIAL CALL RED DATE 9/26", - "type":"Купон" - }, - { - "income_rub":154817.99, - "profit":826.95, - "profit_rub":59164.78, - "report_template":"totals", - "spending_rub":95653.21 - } - ], - "ПФИ":[ + ], + "Облигации":[ + { + "c_amount":2062.5, + "c_amount_rub":149994.28, + "c_date":1632515100, + "c_fee":0.0, + "c_fee_rub":0.0, + "c_int":0.0, + "c_int_rub":0.0, + "c_isin":"US912CALAN84", + "c_number":"17849517124", + "c_price":103.125, + "c_qty":2.0, + "c_rate":72.7245, + "c_symbol":"X 6 1/4 03/15/26 - PARTIAL CALL RED DATE 9/26", + "c_type":"Продажа", + "country_iso":"840", + "cs_date":1632515100, + "cs_rate":72.7245, + "income":2062.5, + "income_rub":149994.28, + "o_amount":1274.18, + "o_amount_rub":93618.72, + "o_date":1622131065, + "o_fee":2.0, + "o_fee_rub":146.95, + "o_int":25.69, + "o_int_rub":1887.54, + "o_isin":"US912909AN84", + "o_number":"2882737839", + "o_price":63.709, + "o_qty":2.0, + "o_rate":73.4737, + "o_symbol":"X 6 1/4 03/15/26", + "o_type":"Покупка", + "os_date":1622246400, + "os_rate":73.4737, + "principal":1000.0, + "profit":760.63, + "profit_rub":54341.07, + "report_template":"bond_trade", + "spending_rub":95653.21 + }, + { + "country_iso":"840", + "empty":"", + "income_rub":4508.46, + "interest":62.0, + "interest_rub":4508.46, + "isin":"US912909AN84", + "number":"", + "o_date":1631664000, + "profit":62.0, + "profit_rub":4508.46, + "rate":72.7171, + "report_template":"bond_interest", + "spending_rub":0.0, + "symbol":"X 6 1/4 03/15/26", + "type":"Купон" + }, + { + "country_iso":"840", + "empty":"", + "income_rub":36.36, + "interest":0.5, + "interest_rub":36.36, + "isin":"US912909AN84", + "number":"TEST_ID", + "o_date":1631664000, + "profit":0.5, + "profit_rub":36.36, + "rate":72.7171, + "report_template":"bond_interest", + "spending_rub":0.0, + "symbol":"X 6 1/4 03/15/26", + "type":"Купон" + }, + { + "country_iso":"840", + "empty":"", + "income_rub":278.89, + "interest":3.82, + "interest_rub":278.89, + "isin":"US912CALAN84", + "number":"", + "o_date":1632700800, + "profit":3.82, + "profit_rub":278.89, + "rate":73.0081, + "report_template":"bond_interest", + "spending_rub":0.0, + "symbol":"X 6 1/4 03/15/26 - PARTIAL CALL RED DATE 9/26", + "type":"Купон" + }, + { + "income_rub":154817.99, + "profit":826.95, + "profit_rub":59164.78, + "report_template":"totals", + "spending_rub":95653.21 + } + ], + "ПФИ":[ - ], - "Проценты":[ + ], + "Проценты":[ - ] + ] } \ No newline at end of file diff --git a/tests/test_data/taxes_rus.json b/tests/test_data/taxes_rus.json index ec4bd051..78fe0c93 100644 --- a/tests/test_data/taxes_rus.json +++ b/tests/test_data/taxes_rus.json @@ -1,518 +1,521 @@ { + "Акции":[ + { + "c_amount":209.5, + "c_amount_rub":13353.8, + "c_date":1582116724, + "c_fee":0.3370772, + "c_fee_rub":21.5, + "c_isin":"CA0679011084", + "c_number":"0002", + "c_price":20.95, + "c_qty":10.0, + "c_rate":63.7698, + "c_symbol":"GOLD", + "c_type":"Продажа", + "cost_basis":100.0, + "country_iso":"840", + "cs_date":1582243200, + "cs_rate":63.7413, + "income":209.5, + "income_rub":13353.8, + "note":"", + "o_amount":187.4, + "o_amount_rub":12028.7, + "o_date":1569334259, + "o_fee":0.32825725, + "o_fee_rub":20.99, + "o_isin":"CA0679011084", + "o_number":"0001", + "o_price":18.74, + "o_qty":10.0, + "o_rate":63.9453, + "o_symbol":"GOLD", + "o_type":"Покупка", + "os_date":1569456000, + "os_rate":64.1873, + "profit":21.43, + "profit_rub":1282.61, + "report_template":"trade", + "spending_rub":12071.19 + }, + { + "c_amount":52.92, + "c_amount_rub":3373.19, + "c_date":1582117021, + "c_fee":0.265096864, + "c_fee_rub":16.91, + "c_isin":"US8816242098", + "c_number":"0000000005", + "c_price":13.23, + "c_qty":4.0, + "c_rate":63.7698, + "c_symbol":"TEVA", + "c_type":"Продажа", + "cost_basis":100.0, + "country_iso":"840", + "cs_date":1582243200, + "cs_rate":63.7413, + "income":52.92, + "income_rub":3373.19, + "note":"", + "o_amount":74.08, + "o_amount_rub":4868.14, + "o_date":1549881381, + "o_fee":0.34625725, + "o_fee_rub":22.87, + "o_isin":"US8816242098", + "o_number":"0000000003", + "o_price":18.52, + "o_qty":4.0, + "o_rate":66.0628, + "o_symbol":"TEVA", + "o_type":"Покупка", + "os_date":1550016000, + "os_rate":65.7147, + "profit":-21.77, + "profit_rub":-1534.73, + "report_template":"trade", + "spending_rub":4907.92 + }, + { + "c_amount":13.23, + "c_amount_rub":843.3, + "c_date":1582117021, + "c_fee":0.066274216, + "c_fee_rub":4.23, + "c_isin":"US8816242098", + "c_number":"0000000005", + "c_price":13.23, + "c_qty":1.0, + "c_rate":63.7698, + "c_symbol":"TEVA", + "c_type":"Продажа", + "cost_basis":100.0, + "country_iso":"840", + "cs_date":1582243200, + "cs_rate":63.7413, + "income":13.23, + "income_rub":843.3, + "note":"", + "o_amount":15.8, + "o_amount_rub":1033.6, + "o_date":1553861071, + "o_fee":0.34995725, + "o_fee_rub":22.68, + "o_isin":"US8816242098", + "o_number":"0000000004", + "o_price":15.8, + "o_qty":1.0, + "o_rate":64.8012, + "o_symbol":"TEVA", + "o_type":"Покупка", + "os_date":1554163200, + "os_rate":65.4176, + "profit":-2.99, + "profit_rub":-217.2, + "report_template":"trade", + "spending_rub":1060.5 + }, + { + "c_amount":885.5, + "c_amount_rub":65013.5, + "c_date":1608044400, + "c_fee":0.35, + "c_fee_rub":25.52, + "c_isin":"US92556V1061", + "c_number":"2227095222", + "c_price":17.71, + "c_qty":50.0, + "c_rate":72.9272, + "c_symbol":"VTRS", + "c_type":"Продажа", + "cost_basis":100.0, + "country_iso":"840", + "cs_date":1608163200, + "cs_rate":73.4201, + "income":885.5, + "income_rub":65013.5, + "note":"Symbol change: Symbol change MYL->VTRS\nVIATRIS INC\n", + "o_amount":795.0, + "o_amount_rub":56047.42, + "o_date":1593604800, + "o_fee":0.35, + "o_fee_rub":24.65, + "o_isin":"NL0011031208", + "o_number":"1118233222", + "o_price":15.9, + "o_qty":50.0, + "o_rate":70.4413, + "o_symbol":"MYL", + "o_type":"Покупка", + "os_date":1593993600, + "os_rate":70.4999, + "profit":89.8, + "profit_rub":8915.9, + "report_template":"corporate_action", + "spending_rub":56097.6 + }, + { + "c_amount":75.0, + "c_amount_rub":5506.51, + "c_date":1608044400, + "c_fee":0.35, + "c_fee_rub":25.52, + "c_isin":"US4642874329", + "c_number":"B1", + "c_price":3.0, + "c_qty":25.0, + "c_rate":72.9272, + "c_symbol":"TLT", + "c_type":"Продажа", + "cost_basis":100.0, + "country_iso":"840", + "cs_date":1608163200, + "cs_rate":73.4201, + "income":75.0, + "income_rub":5506.51, + "note":"Split: Split 5:1 of TLT\niShares 20+ Year Treasury Bond ETF\n", + "o_amount":50.0, + "o_amount_rub":3525.0, + "o_date":1593604800, + "o_fee":0.175, + "o_fee_rub":12.33, + "o_isin":"US4642874329", + "o_number":"A", + "o_price":10.0, + "o_qty":5.0, + "o_rate":70.4413, + "o_symbol":"TLT", + "o_type":"Покупка", + "os_date":1593993600, + "os_rate":70.4999, + "profit":24.48, + "profit_rub":1943.66, + "report_template":"corporate_action", + "spending_rub":3562.85 + }, + { + "c_amount":62.5, + "c_amount_rub":4588.76, + "c_date":1608044400, + "c_fee":0.35, + "c_fee_rub":25.52, + "c_isin":"US4642874329", + "c_number":"B2", + "c_price":2.5, + "c_qty":25.0, + "c_rate":72.9272, + "c_symbol":"TLT", + "c_type":"Продажа", + "cost_basis":100.0, + "country_iso":"840", + "cs_date":1608163200, + "cs_rate":73.4201, + "income":62.5, + "income_rub":4588.76, + "note":"Split: Split 5:1 of TLT\niShares 20+ Year Treasury Bond ETF\n", + "o_amount":50.0, + "o_amount_rub":3525.0, + "o_date":1593604800, + "o_fee":0.175, + "o_fee_rub":12.33, + "o_isin":"US4642874329", + "o_number":"A", + "o_price":10.0, + "o_qty":5.0, + "o_rate":70.4413, + "o_symbol":"TLT", + "o_type":"Покупка", + "os_date":1593993600, + "os_rate":70.4999, + "profit":11.98, + "profit_rub":1025.91, + "report_template":"corporate_action", + "spending_rub":3562.85 + }, + { + "income_rub":92679.06, + "profit":122.93, + "profit_rub":11416.15, + "report_template":"totals", + "spending_rub":81262.91 + } + ], "Дивиденды":[ { - "report_template": "dividend", - "payment_date":1580156400, - "symbol":"GE", - "full_name":"General Electric Company", - "isin":"US3696043013", "amount":1.0, - "tax":0.1, - "rate":61.8031, + "amount_rub":61.8, "country":"США", "country_iso":"840", - "tax_treaty":"Да", - "amount_rub":61.80, - "tax_rub":6.18, + "full_name":"General Electric Company", + "isin":"US3696043013", + "note":"", + "payment_date":1580156400, + "rate":61.8031, + "report_template":"dividend", + "symbol":"GE", + "tax":0.1, "tax2pay":1.85, - "note": "" + "tax_rub":6.18, + "tax_treaty":"Да" }, { - "report_template": "dividend", - "payment_date":1581106800, - "symbol":"TLT", - "full_name":"iShares 20+ Year Treasury Bond ETF", - "isin":"US4642874329", "amount":16.94, - "tax":0.0, - "rate":62.7977, + "amount_rub":1063.79, "country":"США", "country_iso":"840", - "tax_treaty":"Да", - "amount_rub":1063.79, - "tax_rub":0.00, + "full_name":"iShares 20+ Year Treasury Bond ETF", + "isin":"US4642874329", + "note":"", + "payment_date":1581106800, + "rate":62.7977, + "report_template":"dividend", + "symbol":"TLT", + "tax":0.0, "tax2pay":138.29, - "note": "" + "tax_rub":0.0, + "tax_treaty":"Да" }, { - "report_template": "dividend", - "payment_date":1587586800, - "symbol":"ERIC", - "full_name":"Telefonaktiebolaget LM Ericsson B ADR", - "isin":"US2948216088", "amount":3.74, - "tax":1.12, - "rate":76.2562, + "amount_rub":285.2, "country":"Швеция", "country_iso":"752", - "tax_treaty":"Да", - "amount_rub":285.20, + "full_name":"Telefonaktiebolaget LM Ericsson B ADR", + "isin":"US2948216088", + "note":"", + "payment_date":1587586800, + "rate":76.2562, + "report_template":"dividend", + "symbol":"ERIC", + "tax":1.12, + "tax2pay":0.0, "tax_rub":85.41, - "tax2pay":0.00, - "note": "" + "tax_treaty":"Да" }, { - "report_template": "dividend", - "payment_date":1593205200, - "symbol":"GE", + "amount":106.8, + "amount_rub":7418.97, + "country":"США", + "country_iso":"840", "full_name":"General Electric Company", "isin":"US3696043013", - "amount":106.80, - "tax":10.68, + "note":"Дивиденд выплачен в натуральной форме (ценными бумагами)", + "payment_date":1593205200, "rate":69.466, - "country":"США", - "country_iso":"840", - "tax_treaty":"Да", - "amount_rub":7418.97, - "tax_rub":741.90, + "report_template":"dividend", + "symbol":"GE", + "tax":10.68, "tax2pay":222.57, - "note": "Дивиденд выплачен в натуральной форме (ценными бумагами)" + "tax_rub":741.9, + "tax_treaty":"Да" }, { - "report_template": "totals", - "amount": 128.48, - "amount_rub": 8829.76, - "tax": 11.90, - "tax_rub": 833.49, - "tax2pay": 362.71 + "amount":128.48, + "amount_rub":8829.76, + "report_template":"totals", + "tax":11.9, + "tax2pay":362.71, + "tax_rub":833.49 } ], - "Акции":[ - { - "report_template": "trade", - "o_symbol":"GOLD", - "o_isin":"CA0679011084", - "o_qty":1E+1, - "country_iso":"840", - "o_date":1569334259, - "o_rate":63.9453, - "os_date":1569456000, - "o_number":"0001", - "os_rate":64.1873, - "o_price":18.74, - "o_fee":0.32825725, - "c_date":1582116724, - "c_rate":63.7698, - "cs_date":1582243200, - "c_number":"0002", - "cs_rate":63.7413, - "c_price":20.95, - "c_fee":0.3370772, - "o_type":"Покупка", - "c_type":"Продажа", - "c_symbol":"GOLD", - "c_isin":"CA0679011084", - "c_qty":1E+1, - "cost_basis": 100.0, - "o_amount":187.40, - "o_amount_rub":12028.70, - "c_amount":209.50, - "c_amount_rub":13353.80, - "o_fee_rub":20.99, - "c_fee_rub":21.50, - "income": 209.5, - "income_rub":13353.80, - "spending_rub":12071.19, - "profit_rub":1282.61, - "profit":21.43, - "note":"" - }, - { - "report_template": "trade", - "o_isin": "US8816242098", - "o_symbol": "TEVA", - "o_qty": 4.0, - "c_isin": "US8816242098", - "c_symbol": "TEVA", - "c_qty": 4.0, - "cost_basis": 100.0, - "c_amount": 52.92, - "c_amount_rub": 3373.19, - "c_date": 1582117021, - "c_fee": 0.265096864, - "c_fee_rub": 16.91, - "c_number": "0000000005", - "c_price": 13.23, - "c_rate": 63.7698, - "c_type": "Продажа", - "country_iso": "840", - "cs_date": 1582243200, - "cs_rate": 63.7413, - "income": 52.92, - "income_rub": 3373.19, - "o_amount": 74.08, - "o_amount_rub": 4868.14, - "o_date": 1549881381, - "o_fee": 0.34625725, - "o_fee_rub": 22.87, - "o_number": "0000000003", - "o_price": 18.52, - "o_rate": 66.0628, - "o_type": "Покупка", - "os_date": 1550016000, - "os_rate": 65.7147, - "profit": -21.77, - "profit_rub": -1534.73, - "note": "", - "spending_rub": 4907.92 - }, - { - "report_template": "trade", - "o_isin": "US8816242098", - "o_symbol": "TEVA", - "o_qty": 1.0, - "c_isin": "US8816242098", - "c_symbol": "TEVA", - "c_qty": 1.0, - "cost_basis": 100.0, - "c_amount": 13.23, - "c_amount_rub": 843.30, - "c_date": 1582117021, - "c_fee": 0.066274216, - "c_fee_rub": 4.23, - "c_number": "0000000005", - "c_price": 13.23, - "c_rate": 63.7698, - "c_type": "Продажа", - "country_iso": "840", - "cs_date": 1582243200, - "cs_rate": 63.7413, - "income": 13.23, - "income_rub": 843.30, - "o_amount": 15.80, - "o_amount_rub": 1033.60, - "o_date": 1553861071, - "o_fee": 0.34995725, - "o_fee_rub": 22.68, - "o_number": "0000000004", - "o_price": 15.8, - "o_rate": 64.8012, - "o_type": "Покупка", - "os_date": 1554163200, - "os_rate": 65.4176, - "profit": -2.99, - "profit_rub": -217.2, - "note": "", - "spending_rub": 1060.5 - }, - { - "o_isin": "NL0011031208", - "o_symbol": "MYL", - "o_qty": 50.0, - "c_amount": 885.5, - "c_amount_rub": 65013.5, - "c_date": 1608044400, - "c_fee": 0.35, - "c_fee_rub": 25.52, - "c_number": "2227095222", - "c_price": 17.71, - "c_rate": 72.9272, - "c_type": "Продажа", - "country_iso": "840", - "cs_date": 1608163200, - "cs_rate": 73.4201, - "income": 885.5, - "income_rub": 65013.5, - "note": "Symbol change: Symbol change MYL->VTRS\nVIATRIS INC\n", - "c_isin": "US92556V1061", - "c_symbol": "VTRS", - "c_qty": 50.0, - "cost_basis": 100.0, - "o_amount": 795.0, - "o_amount_rub": 56047.42, - "o_date": 1593604800, - "o_fee": 0.35, - "o_fee_rub": 24.65, - "o_number": "1118233222", - "o_price": 15.9, - "o_rate": 70.4413, - "o_type": "Покупка", - "os_date": 1593993600, - "os_rate": 70.4999, - "profit": 89.8, - "profit_rub": 8915.9, - "report_template": "corporate_action", - "spending_rub": 56097.6 - }, + "Комиссии":[ { - "o_isin": "US4642874329", - "o_symbol": "TLT", - "o_qty": 5.0, - "c_amount": 75.0, - "c_amount_rub": 5506.51, - "c_date": 1608044400, - "c_fee": 0.35, - "c_fee_rub": 25.52, - "c_number": "B1", - "c_price": 3.0, - "c_rate": 72.9272, - "c_type": "Продажа", - "country_iso": "840", - "cs_date": 1608163200, - "cs_rate": 73.4201, - "income": 75.0, - "income_rub": 5506.51, - "note": "Split: Split 5:1 of TLT\niShares 20+ Year Treasury Bond ETF\n", - "c_isin": "US4642874329", - "c_symbol": "TLT", - "c_qty": 25.0, - "cost_basis": 100.0, - "o_amount": 50.0, - "o_amount_rub": 3525.0, - "o_date": 1593604800, - "o_fee": 0.175, - "o_fee_rub": 12.33, - "o_number": "A", - "o_price": 10.0, - "o_rate": 70.4413, - "o_type": "Покупка", - "os_date": 1593993600, - "os_rate": 70.4999, - "profit": 24.48, - "profit_rub": 1943.66, - "report_template": "corporate_action", - "spending_rub": 3562.85 + "amount":10.0, + "amount_rub":793.32, + "note":"BALANCE OF MONTHLY MINIMUM FEE FOR OCT 2020", + "payment_date":1604343555, + "rate":79.3323, + "report_template":"fee" }, { - "o_isin": "US4642874329", - "o_symbol": "TLT", - "o_qty": 5.0, - "c_amount": 62.5, - "c_amount_rub": 4588.76, - "c_date": 1608044400, - "c_fee": 0.35, - "c_fee_rub": 25.52, - "c_number": "B2", - "c_price": 2.5, - "c_rate": 72.9272, - "c_type": "Продажа", - "country_iso": "840", - "cs_date": 1608163200, - "cs_rate": 73.4201, - "income": 62.5, - "income_rub": 4588.76, - "note": "Split: Split 5:1 of TLT\niShares 20+ Year Treasury Bond ETF\n", - "c_isin": "US4642874329", - "c_symbol": "TLT", - "c_qty": 25.0, - "cost_basis": 100.0, - "o_amount": 50.0, - "o_amount_rub": 3525.0, - "o_date": 1593604800, - "o_fee": 0.175, - "o_fee_rub": 12.33, - "o_number": "A", - "o_price": 10.0, - "o_rate": 70.4413, - "o_type": "Покупка", - "os_date": 1593993600, - "os_rate": 70.4999, - "profit": 11.98, - "profit_rub": 1025.91, - "report_template": "corporate_action", - "spending_rub": 3562.85 + "amount":1.0, + "amount_rub":76.95, + "note":"ERIC(294821608) ADR Fee USD 0.02 PER SHARE - FEE", + "payment_date":1605039600, + "rate":76.9515, + "report_template":"fee" }, { - "report_template": "totals", - "income_rub": 92679.06, - "spending_rub": 81262.91, - "profit": 122.93, - "profit_rub": 11416.15 + "amount":11.0, + "amount_rub":870.27, + "report_template":"totals" } ], - "Облигации":[ - { - "report_template": "bond_trade", - "c_amount": 1600.00, - "c_amount_rub": 128000.96, - "c_date": 1604319194, - "c_fee": 2.0, - "c_fee_rub": 158.66, - "c_int": 16.89, - "c_int_rub": 1339.92, - "c_number": "2881234589", - "c_price": 80.0, - "c_rate": 79.3323, - "c_type": "Продажа", - "country_iso": "840", - "cs_date": 1604448000, - "cs_rate": 80.0006, - "income": 1616.89, - "income_rub": 129340.88, - "isin": "US912909AN84", - "o_amount": 1278.14, - "o_amount_rub": 90877.29, - "o_date": 1590587855, - "o_fee": 2.0, - "o_fee_rub": 142.28, - "o_int": 25.69, - "o_int_rub": 1827.61, - "o_number": "2881234567", - "o_price": 63.907, - "o_rate": 71.1408, - "o_type": "Покупка", - "os_date": 1590710400, - "os_rate": 71.1012, - "principal": 1000.0, - "profit": 309.06, - "profit_rub": 36335.03, - "qty": 2.0, - "spending_rub": 93005.85, - "symbol": "X 6 1/4 03/15/26" - }, + "Криптовалюты":[ { - "report_template": "bond_interest", - "country_iso": "840", - "empty": "", - "income_rub": 4669.68, - "profit_rub": 4669.68, - "spending_rub": 0.0, - "interest": 62.5, - "profit": 62.5, - "interest_rub": 4669.68, - "isin": "US912909AN84", - "number": "", - "o_date": 1600128000, - "rate": 74.7148, - "symbol": "X 6 1/4 03/15/26", - "type": "Купон" + "c_amount":36.32, + "c_amount_rub":2666.62, + "c_date":1608044400, + "c_fee":0.0, + "c_fee_rub":0.0, + "c_number":"crypto-sell", + "c_price":36321.0, + "c_rate":72.9272, + "c_type":"Продажа", + "country_iso":"840", + "cs_date":1608163200, + "cs_rate":73.4201, + "income":36.32, + "income_rub":2666.62, + "o_amount":35.12, + "o_amount_rub":2561.2, + "o_date":1607871600, + "o_fee":0.0, + "o_fee_rub":0.0, + "o_number":"crypto-buy", + "o_price":35123.0, + "o_rate":73.1195, + "o_type":"Покупка", + "os_date":1608044400, + "os_rate":72.9272, + "profit":1.2, + "profit_rub":105.42, + "qty":0.001, + "report_template":"trade", + "spending_rub":2561.2, + "symbol":"BTC" }, { - "report_template": "totals", - "income_rub": 134010.56, - "spending_rub": 93005.85, - "profit": 371.56, - "profit_rub": 41004.71 + "income_rub":2666.62, + "profit":1.2, + "profit_rub":105.42, + "report_template":"totals", + "spending_rub":2561.2 } ], - "ПФИ":[ + "Облигации":[ { - "c_isin": "", - "c_symbol": "AAL 210115C00030000", - "c_qty": -100.0, - "cost_basis": 100.0, - "report_template": "trade", - "c_amount": 131.00, - "c_amount_rub": 8775.81, - "c_date": 1582886521, - "c_fee": 1.0938, - "c_fee_rub": 71.76, - "c_number": "2716375310", - "c_price": 1.31, - "c_rate": 65.6097, - "c_type": "Покупка", - "country_iso": "840", - "cs_date": 1583107200, - "cs_rate": 66.9909, - "income": 294.0, - "income_rub": 18061.24, - "o_isin": "", - "o_symbol": "AAL 210115C00030000", - "o_qty": -1E+2, - "o_amount": 294.00, - "o_amount_rub": 18061.24, - "o_date": 1579097059, - "o_fee": 0.8018858, - "o_fee_rub": 49.25, - "o_number": "2661844383", - "o_price": 2.94, - "o_rate": 61.414, - "o_type": "Продажа", - "os_date": 1579132800, - "os_rate": 61.4328, - "profit": 161.10, - "profit_rub": 9164.42, - "spending_rub": 8896.82, - "note": "" + "c_amount":1600.0, + "c_amount_rub":128000.96, + "c_date":1604319194, + "c_fee":2.0, + "c_fee_rub":158.66, + "c_int":16.89, + "c_int_rub":1339.92, + "c_isin":"US912909AN84", + "c_number":"2881234589", + "c_price":80.0, + "c_qty":2.0, + "c_rate":79.3323, + "c_symbol":"X 6 1/4 03/15/26", + "c_type":"Продажа", + "country_iso":"840", + "cs_date":1604448000, + "cs_rate":80.0006, + "income":1616.89, + "income_rub":129340.88, + "o_amount":1278.14, + "o_amount_rub":90877.29, + "o_date":1590587855, + "o_fee":2.0, + "o_fee_rub":142.28, + "o_int":25.69, + "o_int_rub":1827.61, + "o_isin":"US912909AN84", + "o_number":"2881234567", + "o_price":63.907, + "o_qty":2.0, + "o_rate":71.1408, + "o_symbol":"X 6 1/4 03/15/26", + "o_type":"Покупка", + "os_date":1590710400, + "os_rate":71.1012, + "principal":1000.0, + "profit":309.06, + "profit_rub":36335.03, + "report_template":"bond_trade", + "spending_rub":93005.85 }, { - "report_template": "totals", - "income_rub": 18061.24, - "spending_rub": 8896.82, - "profit": 161.10, - "profit_rub": 9164.42 - } - ], - "Криптовалюты": [ - { - "c_amount": 36.32, - "c_amount_rub": 2666.62, - "c_date": 1608044400, - "c_fee": 0.0, - "c_fee_rub": 0.00, - "c_number": "crypto-sell", - "c_price": 36321.0, - "c_rate": 72.9272, - "c_type": "Продажа", - "country_iso": "840", - "cs_date": 1608163200, - "cs_rate": 73.4201, - "income": 36.32, - "income_rub": 2666.62, - "o_amount": 35.12, - "o_amount_rub": 2561.20, - "o_date": 1607871600, - "o_fee": 0.0, - "o_fee_rub": 0.0, - "o_number": "crypto-buy", - "o_price": 35123.0, - "o_rate": 73.1195, - "o_type": "Покупка", - "os_date": 1608044400, - "os_rate": 72.9272, - "profit": 1.20, - "profit_rub": 105.42, - "qty": 0.001, - "report_template": "trade", - "spending_rub": 2561.20, - "symbol": "BTC" + "country_iso":"840", + "empty":"", + "income_rub":4669.68, + "interest":62.5, + "interest_rub":4669.68, + "isin":"US912909AN84", + "number":"", + "o_date":1600128000, + "profit":62.5, + "profit_rub":4669.68, + "rate":74.7148, + "report_template":"bond_interest", + "spending_rub":0.0, + "symbol":"X 6 1/4 03/15/26", + "type":"Купон" }, { - "income_rub": 2666.62, - "profit": 1.20, - "profit_rub": 105.42, - "report_template": "totals", - "spending_rub": 2561.20 + "income_rub":134010.56, + "profit":371.56, + "profit_rub":41004.71, + "report_template":"totals", + "spending_rub":93005.85 } ], - "Комиссии":[ - { - "report_template": "fee", - "payment_date": 1604343555, - "amount": 10.0, - "amount_rub": 793.32, - "note": "BALANCE OF MONTHLY MINIMUM FEE FOR OCT 2020", - "rate": 79.3323 - }, + "ПФИ":[ { - "report_template": "fee", - "payment_date":1605039600, - "amount":1.0, - "note":"ERIC(294821608) ADR Fee USD 0.02 PER SHARE - FEE", - "rate":76.9515, - "amount_rub":76.95 + "c_amount":131.0, + "c_amount_rub":8775.81, + "c_date":1582886521, + "c_fee":1.0938, + "c_fee_rub":71.76, + "c_isin":"", + "c_number":"2716375310", + "c_price":1.31, + "c_qty":-100.0, + "c_rate":65.6097, + "c_symbol":"AAL 210115C00030000", + "c_type":"Покупка", + "cost_basis":100.0, + "country_iso":"840", + "cs_date":1583107200, + "cs_rate":66.9909, + "income":294.0, + "income_rub":18061.24, + "note":"", + "o_amount":294.0, + "o_amount_rub":18061.24, + "o_date":1579097059, + "o_fee":0.8018858, + "o_fee_rub":49.25, + "o_isin":"", + "o_number":"2661844383", + "o_price":2.94, + "o_qty":-100.0, + "o_rate":61.414, + "o_symbol":"AAL 210115C00030000", + "o_type":"Продажа", + "os_date":1579132800, + "os_rate":61.4328, + "profit":161.1, + "profit_rub":9164.42, + "report_template":"trade", + "spending_rub":8896.82 }, { - "report_template": "totals", - "amount": 11.0, - "amount_rub": 870.27 + "income_rub":18061.24, + "profit":161.1, + "profit_rub":9164.42, + "report_template":"totals", + "spending_rub":8896.82 } ], "Проценты":[ { - "report_template": "interest", - "payment_date": 1591142400, - "amount": 1.5, - "amount_rub": 103.47, - "note": "RUB CREDIT INT FOR MAY-2020", - "rate": 68.9831, - "tax_rub": 13.45 + "amount":1.5, + "amount_rub":103.47, + "note":"RUB CREDIT INT FOR MAY-2020", + "payment_date":1591142400, + "rate":68.9831, + "report_template":"interest", + "tax_rub":13.45 }, { - "report_template": "totals", - "amount": 1.5, - "amount_rub": 103.47, - "tax_rub": 13.45 + "amount":1.5, + "amount_rub":103.47, + "report_template":"totals", + "tax_rub":13.45 } ] } \ No newline at end of file