julien-nc / cospend-nc

💰 💲hared budget manager Nextcloud app
GNU Affero General Public License v3.0
238 stars 29 forks source link

Unable to import csv-file from splitwise in NC 27 #216

Closed Matsched closed 1 day ago

Matsched commented 1 year ago

NC Version: 27.0 Cospend Version 1.5.10

If i try to import a exported .csv-File from SplitWise i get: Fehler beim Importieren der Projektdatei: Malformed CSV, impossible to find the column names (Error while importing the project data)

This is the format from splitwise:

Datum,Beschreibung,Kategorie,Kosten,Währung,Name1,Name2
2023-06-22,Lebensmitteleinkauf REWE,Lebensmittel,2,EUR,-1,1

How i can change it to import it correctly to Cospend? Can you fix this?

kind regards

k-jell commented 1 year ago

Maybe have a look here: https://gitlab.com/eneiluj/cospend-nc/-/merge_requests/152

It only works if Splitwise account language is set to English (column names are localized)

Not sure if this is still the case, but it seems like it was, when the feature was implemented.

Edit: It is: https://github.com/julien-nc/cospend-nc/issues/159#issuecomment-1201832844

Jolg42 commented 11 months ago

It happened to me too, my account was set to French, so I switched it to English.

The language can be changed here https://secure.splitwise.com/account/settings

Screenshot 2023-12-03 at 17 31 03
Jolg42 commented 11 months ago

The code is here after a quick search https://github.com/julien-nc/cospend-nc/blob/ebfd417293f9eaa2a248354c5264c599ae41aa7a/lib/Service/ProjectService.php#L5178

Especially these lines are assuming the columns are in English https://github.com/julien-nc/cospend-nc/blob/ebfd417293f9eaa2a248354c5264c599ae41aa7a/lib/Service/ProjectService.php#L5201-L5205 https://github.com/julien-nc/cospend-nc/blob/ebfd417293f9eaa2a248354c5264c599ae41aa7a/lib/Service/ProjectService.php#L5250 https://github.com/julien-nc/cospend-nc/blob/ebfd417293f9eaa2a248354c5264c599ae41aa7a/lib/Service/ProjectService.php#L5250

Jolg42 commented 11 months ago

I created a small PR to improve the error message https://github.com/julien-nc/cospend-nc/pull/238

Matsched commented 1 month ago

Thank you for your work !! :) It worked after switching the language in the export.