Code Monkey home page Code Monkey logo

Comments (11)

KonishchevDmitry avatar KonishchevDmitry commented on June 16, 2024 1

To not be misunderstood: I recommend to generate final tax statement in March, but it's still better to try in January to generate intermediate results (as you do now) - just to be sure that your broker statement is still parsable and to have a time to fix possible issues until March.

from investments.

KonishchevDmitry avatar KonishchevDmitry commented on June 16, 2024

Hi! It's configuration option - not command line one. So it should be specified in the configuration file. Here is an example -

# Tax remapping rules (https://github.com/KonishchevDmitry/investments/blob/master/docs/brokers.md#ib-tax-remapping)
#tax_remapping:
# - date: 2020.02.13
# description: BND(US9219378356) Cash Dividend 0.19834500 USD per Share - US Tax
# to_date: 2019.02.06

from investments.

IlyaKarpelyuk avatar IlyaKarpelyuk commented on June 16, 2024

Thank you for your quick response, Dmitry!
However, my tax_remapping throws an error:

image

There is my config file:

image

I really have a tax payment on this date, according to Interactive Brokers reports.
Do you have any ideas how I can fix it, maybe I missed something somewhere?

from investments.

KonishchevDmitry avatar KonishchevDmitry commented on June 16, 2024

It's hard to debug such things without real statement on hands, but, from the error, it looks like there is no tax with such description and date in the statement. What grep -E '^(Dividends|Withholding Tax),.*,STOR' *.csv shows?

P.S.: Looking on the dates you have problem with, I see that you've sent your 2021 tax statement too early, so I'd recommended you to look at recommendations on https://github.com/KonishchevDmitry/investments/blob/master/docs/taxes.md#dividend-reclassifications and generate your final tax statement in march when the broker statement should contain all reclassifications.

from investments.

IlyaKarpelyuk avatar IlyaKarpelyuk commented on June 16, 2024

Thank you!
I will probably do so, I will generate a IB report in March.

from investments.

fughur avatar fughur commented on June 16, 2024

@KonishchevDmitry Hello and thank you for this wonderful tool!
I'm having the same problem with getting rid of tax-remapping issues this year and it looks like my IB report is already contain all the recent dividend reclassification info added in march
image
The problem is that I can't really understand the tax_remapping problem and syntax.

grep -E '^(Dividends|Withholding Tax),.*,AGG' 20220103_20221230.csv shows that 2022 report have two tax withholding items for the instrument & date combination mentioned in error

// (I've changed the actual numbers in order to depersonalise the data, could share the original report by mail if needed)
Withholding Tax,Data,USD,2022-02-10,AGG(US4642872265) Cash Dividend USD _0.01_ per Share - US Tax,0.02,
Withholding Tax,Data,USD,2022-02-10,AGG(US4642872265) Cash Dividend USD _0.01_ per Share - US Tax,-0.01,

The first one contain positive number (tax applied?) and the second one is negative (tax returned?).
There is also a only one positive dividend item in the whole 2022 report

Dividends,Data,USD,2022-02-07,AGG(US4642872265) Cash Dividend USD _0.05_ per Share (Ordinary Dividend),1.00

So if I understand it right, we should link the 02-10 taxes to 02-07 dividends like so

    tax_remapping:
     - date: 10.02.2022
       description: AGG(US4642872265) Cash Dividend USD 0.01 per Share - US Tax
       to_date: 07.02.2022

Which results in following error
image

Could you please help me to understand how to use tax_remapping syntax and debug such errors?
Am I using the right syntax? Is it possible that 10.02.2022 tax are somehow applied to 2021 dividends?

from investments.

KonishchevDmitry avatar KonishchevDmitry commented on June 16, 2024

@fughur, yes - you do it right (almost).

The first one contain positive number (tax applied?) and the second one is negative (tax returned?).

Yes, but vice versa (the positive one is reversal and negative one is withholding).

Is it possible that 10.02.2022 tax are somehow applied to 2021 dividends?

Yes, and this is the most likely case actually. Please read here for more information.

The general rule of debugging such cases is the following. You should see the following lines in your statements:

Withholding Tax,Data,USD,2021-02-05,AGG(US4642872265) Cash Dividend USD $dividend_amount per Share - US Tax,-$tax_withheld_1,
Withholding Tax,Data,USD,2022-02-10,AGG(US4642872265) Cash Dividend USD $dividend_amount per Share - US Tax,$tax_withheld_1,
Withholding Tax,Data,USD,2022-02-10,AGG(US4642872265) Cash Dividend USD $dividend_amount per Share - US Tax,-$tax_withheld_2,

where:

  • $dividend_amount is the same (in most cases)
  • -$tax_withheld_1 - withheld tax, $tax_withheld_1 - the reversal (the same amount)
  • -$tax_withheld_2 - new withheld tax amount

There may be more than one withholding/reversals and you should find lines with the same $dividend_amount (the most cases, again - but there are more complicated ones) + one or more pairs of -$amount_1 + $amount_1 and a final withheld -$amount_2. Dates may be almost arbitrary and not in order.

I also have AGG, so I can see your case in my statements, and yes - it's reversal of 2021 tax withholding and the following line should solve the issue:

tax_remapping:
 - {date: 2022.02.10, to_date: 2021.02.05, description: AGG(US4642872265) Cash Dividend USD 0.191959 per Share - US Tax}

from investments.

fughur avatar fughur commented on June 16, 2024

@KonishchevDmitry God bless you! 2022.02.10 -> 2021.02.05 linkage is worked like a charm!

from investments.

IlyaKarpelyuk avatar IlyaKarpelyuk commented on June 16, 2024

Hello, Dmitry!
Unfortunately, the latest 10th march statament does not help to solve the issue.
Do you have any ideas, how this can be solved?
Is there really only one option left, remapping?
If this is the case, can you tell me how to correctly implement tax remapping and how to determine on what date?

image

from investments.

KonishchevDmitry avatar KonishchevDmitry commented on June 16, 2024

@IlyaKarpelyuk, text output would be much friendlier than the image to debug such things. ;)

Here is what I see according to d597ba6:

Something old and not interesting to us:

Withholding Tax,Data,USD,2020-10-15,STOR(US8621211007) Cash Dividend USD 0.36 per Share - US Tax,3.96,
Withholding Tax,Data,USD,2020-10-15,STOR(US8621211007) Cash Dividend USD 0.36 per Share - US Tax,-3,

Original dividends:

#1 dividend:
Dividends,Data,USD,2021-01-15,STOR(US8621211007) Cash Dividend USD 0.36 per Share (Ordinary Dividend),39.6,
Withholding Tax,Data,USD,2021-01-15,STOR(US8621211007) Cash Dividend USD 0.36 per Share - US Tax,-3.96,

#2 dividend:
Dividends,Data,USD 2021-04-15,STOR(US8621211007) Cash Dividend USD 0.36 per Share (Ordinary Dividend),39.6,
Withholding Tax,Data,USD,2021-04-15,STOR(US8621211007) Cash Dividend USD 0.36 per Share - US Tax,-3.96,

#3 dividend:
Dividends,Data,USD 2021-07-15,STOR(US8621211007) Cash Dividend USD 0.36 per Share (Ordinary Dividend),39.6,
Withholding Tax,Data,USD,2021-07-15,STOR(US8621211007) Cash Dividend USD 0.36 per Share - US Tax,-3.96,

Refunds:

#2 dividend:
Withholding Tax,Data,USD,2021-04-15,STOR(US8621211007) Cash Dividend USD 0.36 per Share - US Tax,3.96,
Withholding Tax,Data,USD,2021-04-15,STOR(US8621211007) Cash Dividend USD 0.36 per Share - US Tax,-3.14,

#3 dividend:
Withholding Tax,Data,USD,2021-07-15,STOR(US8621211007) Cash Dividend USD 0.36 per Share - US Tax,3.96,
Withholding Tax,Data,USD,2021-07-15,STOR(US8621211007) Cash Dividend USD 0.36 per Share - US Tax,-3.14,

Problem refunds:

Withholding Tax,Data,USD,2022-01-25,STOR(US8621211007) Cash Dividend USD 0.36 per Share - US Tax,3.96,
Withholding Tax,Data,USD,2022-01-25,STOR(US8621211007) Cash Dividend USD 0.36 per Share - US Tax,-3.14,

which look like #1 dividend one's.

So I believe that you need:

tax_remapping:
  - {date: 2022.01.25, to_date: 2021.01.15, description: STOR(US8621211007) Cash Dividend USD 0.36 per Share - US Tax}

from investments.

IlyaKarpelyuk avatar IlyaKarpelyuk commented on June 16, 2024

Thank you very much, Dmitry.
I've successfully remapped my problem ticket.

from investments.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.