Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction XTB error #116

Open
rubengr opened this issue Oct 6, 2024 · 12 comments · May be fixed by #135
Open

Transaction XTB error #116

rubengr opened this issue Oct 6, 2024 · 12 comments · May be fixed by #135
Assignees
Labels
Bug Something isn't working Waiting for input Waiting for more input to get a sense of the issue XTB Related to XTB

Comments

@rubengr
Copy link

rubengr commented Oct 6, 2024

Hi

I'm testing you code, but get this error:

npm run start xtb

> [email protected] start
> tsx ./src/manual.ts xtb

[i] Starting Export to Ghostfolio v0.18.2
[i] Restored 0 ISIN-symbol pairs and 0 symbols from cache..
[i] Processing file using XTB converter
[i] Read CSV file. Start processing..
{
  iD: '629854440',
  type: 'interest',
  time: '04.10.2024 11:03:40',
  symbol: '',
  comment: 'Free-funds Interest Tax 2024-09',
  amount: -0.03
}
{
  iD: '629854424',
  type: 'interest',
  time: '04.10.2024 11:03:39',
  symbol: '',
  comment: 'Free-funds Interest 2024-09',
  amount: 0.1
}
{
  iD: '624529037',
  type: 'buy',
  time: '27.09.2024 12:22:31',
  symbol: 'TXT.PL',
  comment: 'OPEN BUY 5 @ 74.10',
  amount: -87.09
}
[d]     getSecurity(): Found 0 matches by symbol TXT.PL
[d]     getSecurity(): No initial match found, trying by symbol TXT.PL
[d]     getSecurity(): No match found for TXT.PL, trying to symbol TXT
[i] ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0% | ETA 2s | Duration: 1s | 2/765We expected a redirect to guce.yahoo.com/We'll try to continue anyway - you can safely ignore this if the request succeeds
[d]             getSymbolsByQuery(): Quote 'TXT' has no symbol at Yahoo Finance undefined. Skipping..
[d]             getSymbolsByQuery(): Quote 'TXT' has no symbol at Yahoo Finance undefined. Skipping..
[d]     getSecurity(): Match found for TXT.PL
[i] ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0% | ETA 2s | Duration: 2s | 2/765{
  iD: '623424924',
  type: 'Withholding tax',
  time: '26.09.2024 11:00:23',
  symbol: 'FB.US',
  comment: 'FB.US USD WHT 15%',
  amount: -0.33
}
file:///C:/Users/Ruben/Documents/Ruben/Ghostfolio/Export-To-Ghostfolio/src/converters/xtbConverter.ts:1
var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});impor.

TypeError: Cannot read properties of null (reading '1')
    at <anonymous> (c:\Users\Ruben\Documents\Ruben\Ghostfolio\Export-To-Ghostfolio\src\converters\xtbConverter.ts:114:4)
Node.js v20.11.0
@dickwolff
Copy link
Owner

Thanks for reporting this. I will look into it when I have time!

@dickwolff
Copy link
Owner

dickwolff commented Oct 20, 2024

@rubengr I've just looked at the issue. The Withholding tax record is new for the tool, so it goes broke for some technical reason.

I assume this record is not standalone, but rather connected to another BUY/SELL record. Could you maybe send me both lines from your export, so I can use that to create a working solution?

@dickwolff
Copy link
Owner

@rubengr Could you check my latest message? Thanks!

@dickwolff dickwolff added the XTB Related to XTB label Nov 4, 2024
@rubengr
Copy link
Author

rubengr commented Dec 7, 2024

@rubengr Could you check my latest message? Thanks!

sorry for late reply. I think is related to taxes of dividends. For example:
`

<style> </style>
ID Type Time Symbol Comment Amount
623424924 Withholding tax 26.09.2024 11:00:23 FB.US FB.US USD WHT 15% -0.33
623424923 Dividend 26.09.2024 11:00:23 FB.US FB.US USD 0.5000/ SHR 2.23
`

@dickwolff dickwolff added the Bug Something isn't working label Jan 1, 2025
@dickwolff
Copy link
Owner

Sorry for the late reply. I was busy finishing things up last year. Now I have more time for this project and I will look into this issue today!

@dickwolff dickwolff linked a pull request Jan 1, 2025 that will close this issue
3 tasks
@dickwolff
Copy link
Owner

@rubengr After looking into it, it seems the XTB converter did not have support for dividends at all. I've added this just now, and used your input as test data.

Can you test if this works for you? You can clone this branch and run it yourself, or use this Docker image to verify. Please let me know if all works as expected so I can merge this.

@dickwolff dickwolff self-assigned this Jan 1, 2025
@dickwolff dickwolff added the Waiting for input Waiting for more input to get a sense of the issue label Jan 2, 2025
@rubengr
Copy link
Author

rubengr commented Jan 2, 2025

Get this error:

PS C:\Users\Ruben\Downloads\Export-To-Ghostfolio> npm run start xtb

> [email protected] start
> tsx ./src/manual.ts xtb

[i] Starting Export to Ghostfolio v0.20.1
[i] Restored 7 ISIN-symbol pairs and 7 symbols from cache..
[i] Processing file using XTB converter
[i] Read CSV file. Start processing..
file:///C:/Users/Ruben/Downloads/Export-To-Ghostfolio/src/converters/xtbConverter.ts:2
`);bar1.increment();continue}let feeAmount=0;if(record.type.toLocaleLowerCase()==="dividend"){const taxRecord=this.lookupDividendTaxRecord(records,idx);if(;                                                                                                                                                           ^
TypeError: Cannot read properties of undefined (reading 'toLocaleLowerCase')
    at <anonymous> (c:\Users\Ruben\Downloads\Export-To-Ghostfolio\src\converters\xtbConverter.ts:188:57)
    at Array.some (<anonymous>)
    at XtbConverter.isIgnoredRecord (c:\Users\Ruben\Downloads\Export-To-Ghostfolio\src\converters\xtbConverter.ts:188:35)
    at <anonymous> (c:\Users\Ruben\Downloads\Export-To-Ghostfolio\src\converters\xtbConverter.ts:88:26)
    at Parser.<anonymous> (file:///C:/Users/Ruben/Downloads/Export-To-Ghostfolio/node_modules/csv-parse/lib/index.js:118:7)
    at Parser.emit (node:events:518:28)
    at endReadableNT (node:internal/streams/readable:1696:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v20.11.0
PS C:\Users\Ruben\Downloads\Export-To-Ghostfolio>

@dickwolff
Copy link
Owner

That's a shame. Can you maybe provide me with the input you are trying with? That way I can better reproduce the issue myself. Thanks!

@rubengr
Copy link
Author

rubengr commented Jan 2, 2025

Transactions.csv

@dickwolff dickwolff removed the Waiting for input Waiting for more input to get a sense of the issue label Jan 3, 2025
@dickwolff
Copy link
Owner

Thanks! I will look into it and get back to you!

@dickwolff
Copy link
Owner

I just took a look at the file you provided, but are you sure this ia a XTB export? It looks more like a DEGIRO file.

The file you provided has a lot more headers then the one in my XTB sample (which is just ID;Type;Time;Symbol;Comment;Amount).

@dickwolff dickwolff added the Waiting for input Waiting for more input to get a sense of the issue label Jan 3, 2025
@dickwolff
Copy link
Owner

@toffee I saw you were also looking into adding dividends to the XTB converter. Could you maybe try my fix, to verify if it all processes correctly? You can use this Docker image, or clone the branch if you want to run locally. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Waiting for input Waiting for more input to get a sense of the issue XTB Related to XTB
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants