Closed Sonlis closed 7 months ago
Thanks for reporting this! I thought I had this covered with isBuyOrSellRecordSet()
, which checks for n+1 and n-1 (ie tx+buy and buy+tx). I will add a unit test for this case and look why my current method is not working.
I managed to find 2 problems:
French reports' fees record is "Frais DEGIRO de courtage et/ou de parties tierces" which gets skipped in the isIgnoredRecord()
method, because
record.description.toLocaleLowerCase().indexOf(t) > -1
returns true as an ignored record type is ag
, which is a substring of the word courtage
. Since the fee is an index before the transaction, when the code checks the transaction it finds no fees afterwards.
In the sample report, the structure is as follows:
record 0: transaction A record 1: transaction B fees record 2: transaction B
So the code sees that record 0 and record 0+1 are a transaction and fees, but it does not check if they belong to the same transaction, combine them, then goes to record 2 and finds no fees afterwards.
I removed ag
from the ignored records. I have no recollection why it is in there to be honest. Can you try the 0.7.2-beta
version I just pushed?
Seems to work properly now 👍
@Sonlis I merged your change with the order id match. This is now available in 0.7.4.
Are your issues resolved by these changes?
Yup they are! Thanks 👍
The fees paid during a transaction are not linked to said transaction.
Error
In my example, using this CSV:
The fees are not added to the transaction, even though they are from the same order.
Using the degiro sample export csv, the same error arises:
The commision is added to the first transaction instead of the second, while it belongs to the second as the order number suggests.
Problem within the code
The code always tries to match a transaction and fee with transaction being n, and fee n+1. However, it is not always the case, as my example export shows, and even the sample one. https://github.com/dickwolff/Export-To-Ghostfolio/blob/e4d0ee324d4dfc46250a9cfab318da1f649f0ff5/src/converters/degiroConverterV2.ts#L114
Possible solution
Add also a check to n-1 or/and add a check if the order number is the same between the order and the fee.
I could work on it if needed 👍