Comments (8)
Проверил, задвоение происходит в программе, при экспорте не нашел где это указывается.
jal имортирует секцию TransactionTax
отсюда и задвоение. Т.е. у вашем варианте получается, что вы плюсуете поле taxes
к комиссии в операции покупки/продажи и этот же налог импортируется отдельной операцией из TransactionTax
.
По хорошему конечно этот налог надо бы привязать к покупке-продаже бумаг и учесть как расход на сделку. Но есть ещё, например, комиссии за ADR - я не помню идут ли они в TransactionTax
или в CashTransactions
, но они точно не привязаны к Trade
. Я это к тому, что по хорошему, нужно сделать общий механизм такой привязки.
Поэтому наверное пока остаётся импорт из TransactionTax
, а потом посмотрю как это сделать более универсальным способом.
from jal.
Те, что с явным указанием номера сделки (как в этом примере для stamp tax для LSE) включил в комиссии за сделки, будет в 2024.2.2.
Те, что без указания на сделки (как за ADR) возможно потом добавлю, но там надо подумать будет как лучше сделать.
from jal.
Спасибо, вроде всё хорошо в коде, сделаю merge.
Меня только в этом всём всегда смущало поле ibCommissionCurrency
. Я пока не делал поддержку отдельных валют.
А вот с taxes
- оно всегда в валюте сделки идёт? Не было других вариантов?
И второй вопрос сразу назрел.
Я тут проверил пример другого счёта с покупкой бумаги в фунтах - там эти 0.5% идут как отдельная кэшевая транзакция с описанием UK Stamp Tax
. У вас после такого трейда нет списания тех же самых taxes="-6.48"
в секции CashTransactions
? А то как бы задвоения учёта не получилось...
from jal.
Спасибо, вроде всё хорошо в коде, сделаю merge. Меня только в этом всём всегда смущало поле
ibCommissionCurrency
. Я пока не делал поддержку отдельных валют. А вот сtaxes
- оно всегда в валюте сделки идёт? Не было других вариантов?
Валюта сделки и валюта комиссии могут отличаться, например при обмене валют RUB -> USD будет валюта сделки USD, а комиссия может быть в RUB.
<Trade accountId="ID" acctAlias="" model="" currency="USD" fxRateToBase="62.26" assetCategory="CASH" symbol="GBP.USD" description="GBP.USD" conid="12087797" securityID="" securityIDType="" cusip="" isin="" listingExchange="" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" tradeID="2639766768" putCall="" reportDate="20191220" principalAdjustFactor="" dateTime="20191220;063037" tradeDate="20191220" settleDateTarget="20191224" transactionType="ExchTrade" exchange="IDEALFX" quantity="2468" tradePrice="1.30298" tradeMoney="3215.75464" proceeds="-3215.75464" taxes="0" ibCommission="-124.52" ibCommissionCurrency="RUB" netCash="0" closePrice="0" openCloseIndicator="" notes="" cost="0" fifoPnlRealized="0" fxPnl="0" mtmPnl="-423.347886" origTradePrice="0" origTradeDate="" origTradeID="" origOrderID="0" clearingFirmID="" transactionID="11759388420" buySell="BUY" ibOrderID="1292164609" ibExecID="00013493.5df6c0d0.01.01" brokerageOrderID="004d97f6.0001a850.5dfc5e55.0001" orderReference="" volatilityOrderLink="" exchOrderId="N/A" extExecID="NYC03201DWJJ5R4B" orderTime="20191220;044508" openDateTime="" holdingPeriodDateTime="" whenRealized="" whenReopened="" levelOfDetail="EXECUTION" changeInPrice="0" changeInQuantity="0" orderType="LMT" traderID="" isAPIOrder="N" accruedInt="0" serialNumber="" deliveryType="" commodityType="" fineness="0.0" weight="0.0 ()" />
Насчет taxes
не могу сказать, тк у меня везде совпадает с валютой сделки, уточнение снизу.
И второй вопрос сразу назрел. Я тут проверил пример другого счёта с покупкой бумаги в фунтах - там эти 0.5% идут как отдельная кэшевая транзакция с описанием
UK Stamp Tax
. У вас после такого трейда нет списания тех же самыхtaxes="-6.48"
в секцииCashTransactions
? А то как бы задвоения учёта не получилось...
Есть секции TransactionTax
, там как раз указывается точная валюта, пока не видел отличий в валюте.
<TransactionTaxes>
<TransactionTax accountId="ID" acctAlias="" model="" currency="GBP" fxRateToBase="80.952" assetCategory="STK" symbol="POG" description="PETROPAVLOVSK PLC" conid="37099428" securityID="GB0031544546" securityIDType="ISIN" cusip="" isin="GB0031544546" listingExchange="LSE" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" date="20191220;081205" taxDescription="UK Stamp Tax" quantity="10000" reportDate="20191220" taxAmount="-6.48" tradeId="2639777352" tradePrice="0.1296" source="TRADE" code="" levelOfDetail="SUMMARY" serialNumber="" deliveryType="" commodityType="" fineness="0.0" weight="0.0 ()" />
<TransactionTax accountId="ID" acctAlias="" model="" currency="GBP" fxRateToBase="80.952" assetCategory="STK" symbol="POG" description="PETROPAVLOVSK PLC" conid="37099428" securityID="GB0031544546" securityIDType="ISIN" cusip="" isin="GB0031544546" listingExchange="LSE" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" date="20191220;082246" taxDescription="UK Stamp Tax" quantity="8930" reportDate="20191220" taxAmount="-5.78664" tradeId="2639778690" tradePrice="0.1296" source="TRADE" code="" levelOfDetail="SUMMARY" serialNumber="" deliveryType="" commodityType="" fineness="0.0" weight="0.0 ()" />
</TransactionTaxes>
И сделки к ним:
<Trades>
<Trade accountId="ID" acctAlias="" model="" currency="GBP" fxRateToBase="80.952" assetCategory="STK" symbol="POG" description="PETROPAVLOVSK PLC" conid="37099428" securityID="GB0031544546" securityIDType="ISIN" cusip="" isin="GB0031544546" listingExchange="LSE" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" tradeID="2639777352" putCall="" reportDate="20191220" principalAdjustFactor="" dateTime="20191220;081205" tradeDate="20191220" settleDateTarget="20191224" transactionType="ExchTrade" exchange="LSE" quantity="10000" tradePrice="0.1296" tradeMoney="1296" proceeds="-1296" taxes="-6.48" ibCommission="-1.17" ibCommissionCurrency="GBP" netCash="-1303.65" closePrice="0.1256" openCloseIndicator="O" notes="P" cost="1303.65" fifoPnlRealized="0" fxPnl="0" mtmPnl="-40" origTradePrice="0" origTradeDate="" origTradeID="" origOrderID="0" clearingFirmID="" transactionID="11759430440" buySell="BUY" ibOrderID="1292171566" ibExecID="0001609a.5dfc7515.01.01" brokerageOrderID="004d97f6.0001a850.5dfc5e66.0001" orderReference="" volatilityOrderLink="" exchOrderId="N/A" extExecID="2251280873450203/B" orderTime="20191220;064221" openDateTime="" holdingPeriodDateTime="" whenRealized="" whenReopened="" levelOfDetail="EXECUTION" changeInPrice="0" changeInQuantity="0" orderType="LMT" traderID="" isAPIOrder="N" accruedInt="0" serialNumber="" deliveryType="" commodityType="" fineness="0.0" weight="0.0 ()" />
<Trade accountId="ID" acctAlias="" model="" currency="GBP" fxRateToBase="80.952" assetCategory="STK" symbol="POG" description="PETROPAVLOVSK PLC" conid="37099428" securityID="GB0031544546" securityIDType="ISIN" cusip="" isin="GB0031544546" listingExchange="LSE" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" tradeID="2639778690" putCall="" reportDate="20191220" principalAdjustFactor="" dateTime="20191220;082246" tradeDate="20191220" settleDateTarget="20191224" transactionType="ExchTrade" exchange="LSE" quantity="8930" tradePrice="0.1296" tradeMoney="1157.328" proceeds="-1157.328" taxes="-5.78664" ibCommission="-0.28706376" ibCommissionCurrency="GBP" netCash="-1163.40170376" closePrice="0.1256" openCloseIndicator="O" notes="P" cost="1163.40170376" fifoPnlRealized="0" fxPnl="0" mtmPnl="-35.72" origTradePrice="0" origTradeDate="" origTradeID="" origOrderID="0" clearingFirmID="" transactionID="11759493161" buySell="BUY" ibOrderID="1292171566" ibExecID="0001609a.5dfc753b.01.01" brokerageOrderID="004d97f6.0001a850.5dfc5e66.0001" orderReference="" volatilityOrderLink="" exchOrderId="N/A" extExecID="2251280873450948/B" orderTime="20191220;064221" openDateTime="" holdingPeriodDateTime="" whenRealized="" whenReopened="" levelOfDetail="EXECUTION" changeInPrice="0" changeInQuantity="0" orderType="LMT" traderID="" isAPIOrder="N" accruedInt="0" serialNumber="" deliveryType="" commodityType="" fineness="0.0" weight="0.0 ()" />
</Trades>
from jal.
Проверил, задвоение происходит в программе, при экспорте не нашел где это указывается.
from jal.
Я заметил, что вы PR подправили. Может был и просто автоматический merge с моими изменениями, но может у нас возникло какое-то недопонимание.
Т.к. в итоге вы подтвердили, что происходит задвоение, то я думаю пока оставить код как есть, не включая ваш PR.
В будущем я попробую сделать привязку комиссий и прочего к бумаге, но тут надо подумать как это лучше реализовать.
Т.е. в итоге я закрываю эту Issue и отклоняю PR, не возражаете?
from jal.
Да, там просто обновил ветку, чтобы сгенерировать отчет для налоговой. Привязку сделать сложнее гораздо, посмотрел код.
PR да, issue мб оставить для конечного фикса? Тут как удобнее.
from jal.
Да, пусть наверное issue будет, чтобы эта идея как-то была озвучена. Может летом после ОоДДС сделаю.
from jal.
Related Issues (20)
- Duplicated records after several dcX exports
- Menu "Data-Backup..." error HOT 2
- Keep last selected path for file operations HOT 1
- Error during installation HOT 8
- Не все котировки загружаются HOT 5
- Failed to download currency rates HOT 1
- Corporate action type is not supported HOT 7
- котировки в источниках не за единицу валюты приводят к некорректным расчетам
- Ошибка на операциях замены акций HOT 2
- Error after db upgrade HOT 4
- TypeError: object.__init__() takes exactly one argument (the instance to initialize) HOT 2
- Include information about known cost basis distribution for corporate actions
- Can't create 2nd account without "Bank" but with the same currency HOT 1
- Correct UI-class usage HOT 1
- Дивиденды при короткой позиции HOT 3
- Операции купли-продажи бумаг, которые попали на сплит HOT 2
- Округление комиссий HOT 2
- Align russian readme with english version
- unable to open database file Error opening database HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jal.