VibeNL / GhostfolioSidekick

A continuous running Docker container (a sidecar) to automatically import files from several brokers & crypto exchanges. And more.... See the readme.md for more information
MIT License
12 stars 4 forks source link

English language? #277

Open fugkco opened 1 month ago

fugkco commented 1 month ago

Any chance for English language support?

Example:

Date,Time,Value date,Product,ISIN,Description,FX,Change,,Balance,,Order Id
04-07-2024,07:40,03-07-2024,HP INC,US40434L1052,Dividend Tax,,USD,-0.21,USD,1.17,
04-07-2024,07:40,03-07-2024,HP INC,US40434L1052,Dividend,,USD,1.38,USD,1.38,
06-11-2023,15:33,06-11-2019,HP INC,US40434L1052,FX Credit,1.2868,USD,106.55,USD,0,dbe4ec4d-6a6e-4315-b661-820dd1f1d58d
06-11-2023,15:33,06-11-2019,HP INC,US40434L1052,FX Debit,,GBP,-82.8,GBP,138.89,dbe4ec4d-6a6e-4315-b661-820dd1f1d58d
06-11-2023,15:33,06-11-2019,HP INC,US40434L1052,DEGIRO Transaction and/or third party fees,,GBP,-0.43,GBP,221.69,dbe4ec4d-6a6e-4315-b661-820dd1f1d58d
06-11-2023,15:33,06-11-2019,HP INC,US40434L1052,DEGIRO Transaction and/or third party fees,,GBP,-0.02,GBP,222.12,dbe4ec4d-6a6e-4315-b661-820dd1f1d58d
06-11-2023,15:33,06-11-2019,HP INC,US40434L1052,Buy 5 HP Inc@21.31 USD (US40434L1052),,USD,-106.55,USD,-106.55,dbe4ec4d-6a6e-4315-b661-820dd1f1d58d
VibeNL commented 1 month ago

Hey @fugkco ,

Of course we can add support for English since you provided an example 😀.

I'll put it on top of my Todo list.

VibeNL commented 1 month ago

@fugkco , I have made a change to parse the files. Could give it a try and lets me know if it works 👼 : docker pull vibenl/ghostfoliosidekick:pr-278

VibeNL commented 4 weeks ago

Merged it the the main branch, in case there are issues let me know

fugkco commented 1 week ago

@VibeNL sorry it took so long to look at this. I'm unable to test it (or maybe it's a bug?). I get the following error:

sidekick-1  | fail: GhostfolioSidekick.FileImporter.FileImporterTask[0]
sidekick-1  |       Error The input string '' was not in a correct format.
sidekick-1  |       System.FormatException: The input string '' was not in a correct format.
sidekick-1  |          at System.Number.ThrowFormatException[TChar](ReadOnlySpan`1 value)
sidekick-1  |          at System.Number.ParseDecimal[TChar](ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info)
sidekick-1  |          at System.Decimal.Parse(String s, IFormatProvider provider)
sidekick-1  |          at GhostfolioSidekick.Parsers.DeGiro.DeGiroRecordEN.GetQuantity() in /src/Parsers/DeGiro/DeGiroRecordEN.cs:line 85
sidekick-1  |          at GhostfolioSidekick.Parsers.DeGiro.DeGiroParserBase`1.ParseRow(T record, Int32 rowNumber) in /src/Parsers/DeGiro/DeGiroParserBase.cs:line 41
sidekick-1  |          at GhostfolioSidekick.Parsers.RecordBaseImporter`1.ParseActivities(String filename, IHoldingsCollection holdingsAndAccountsCollection, String accountName) in /src/Parsers/RecordBaseImporter.cs:line 62
sidekick-1  |          at GhostfolioSidekick.FileImporter.FileImporterTask.DoWork() in /src/GhostfolioSidekick/FileImporter/FileImporterTask.cs:line 87
sidekick-1  | info: GhostfolioSidekick.TimedHostedService[0]
sidekick-1  |       Service FileImporterTask has executed.

I'm unsure which line is causing the problem, or what to look for to see what might be the issue.

VibeNL commented 1 week ago

It seems not to be able to parse the description in a file to get the quantity correctly. You can view the testfiles I have added to view if there are any lines different from your file:

https://github.com/VibeNL/GhostfolioSidekick/blob/master/Parsers.UnitTests/TestFiles/DeGiro/EN/BuyOrders/single_buy_usd.csv?plain=1 https://github.com/VibeNL/GhostfolioSidekick/blob/master/Parsers.UnitTests/TestFiles/DeGiro/EN/CashTransactions/single_dividend.csv?plain=1

fugkco commented 1 week ago

I think I've narrowed it down to the following bit:

Date,Time,Value date,Product,ISIN,Description,FX,Change,,Balance,,Order Id
09-08-2024,16:10,09-08-2024,MORGAN STANLEY GBP LIQUIDITY FUND,LU0904784781,Money Market fund conversion: Buy 0.5 at 1 GBP,,,,GBP,116.31,
08-08-2024,15:27,31-07-2024,MORGAN STANLEY GBP LIQUIDITY FUND,LU0904784781,Fund Distribution,,GBP,0.50,GBP,116.31,
07-08-2024,15:30,06-08-2024,MORGAN STANLEY GBP LIQUIDITY FUND,LU0904784781,Money Market fund conversion: Sell 0.02 at 1 GBP,,,,GBP,115.81,
03-08-2024,06:42,02-08-2024,,,FX Debit,,GBP,-0.02,GBP,115.81,
03-08-2024,06:42,02-08-2024,,,FX Credit,1.1706,EUR,0.02,EUR,0.00,

It seems to be specifically the money market funds distribution. It's a weird way they've done the fund distributions. It seems the error comes up for all three records if I put them there individually.

VibeNL commented 1 week ago

I think I've narrowed it down to the following bit:

Date,Time,Value date,Product,ISIN,Description,FX,Change,,Balance,,Order Id
09-08-2024,16:10,09-08-2024,MORGAN STANLEY GBP LIQUIDITY FUND,LU0904784781,Money Market fund conversion: Buy 0.5 at 1 GBP,,,,GBP,116.31,
08-08-2024,15:27,31-07-2024,MORGAN STANLEY GBP LIQUIDITY FUND,LU0904784781,Fund Distribution,,GBP,0.50,GBP,116.31,
07-08-2024,15:30,06-08-2024,MORGAN STANLEY GBP LIQUIDITY FUND,LU0904784781,Money Market fund conversion: Sell 0.02 at 1 GBP,,,,GBP,115.81,
03-08-2024,06:42,02-08-2024,,,FX Debit,,GBP,-0.02,GBP,115.81,
03-08-2024,06:42,02-08-2024,,,FX Credit,1.1706,EUR,0.02,EUR,0.00,

It seems to be specifically the money market funds distribution. It's a weird way they've done the fund distributions. It seems the error comes up for all three records if I put them there individually.

This wasn't in the provided examples 👼 . Will see if I can get the parser to cooperate.

VibeNL commented 4 days ago

@fugkco , you could try the new build:

docker pull vibenl/ghostfoliosidekick:pr-290

Let me know if there are any issues (or misinterpertations 👼 )