Bug 492459 - Sign dependent CSV import
Summary: Sign dependent CSV import
Status: RESOLVED NOT A BUG
Alias: None
Product: skrooge
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR wishlist
Target Milestone: 25.1.0
Assignee: Stephane MANKOWSKI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-31 16:00 UTC by pat_h
Modified: 2024-09-01 14:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
csv export (559 bytes, text/csv)
2024-09-01 04:12 UTC, pat_h
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pat_h 2024-08-31 16:00:34 UTC
Skrooge only has the field recipient for a transaction. In a transaction the sign of the amount determines whether the user is the actual recipient or whether the person listed in the field recipient is the actual recipient. In other words, the person listed in the field recipient is either the recipient or the payer depending on the sign of the amount.

However, this functionality is not available for CSV import. There the recipient is always taken from the same field. That was okay with the CSV export of my bank up to now, because they also put the other person into that field, i.e. either the recipient or the payer. However, due to a change of my bank, they now always export two fields: recipient and payer, so neither field is the correct one to import as recipient for Skrooge in general.

To follow Skrooge's logic, the import should use the payer field for positive amounts and the recipient field for negative amounts. It would be great, if there were another checkbox in the Import/Export setting dialog at the recipient configuration where you could select "Use separate field for positive amounts" with another regular expression to be entered. Obviously, the corresponding logic should also be implemented. :-)
Comment 1 Stephane MANKOWSKI 2024-08-31 18:46:42 UTC
Hi,

Could you provide me a sample csv file ? 
(2 lines should be enough, one for positive value and one for negative value)
Don't forget to anonymize it.
Comment 2 pat_h 2024-09-01 04:12:18 UTC
Created attachment 173186 [details]
csv export

After some introduction lines, the CSV header line is line 5.
In line 6 the 5th field is relevant for Skrooge because the 9th field is negative.
In line 7 the 4th field is relevant for Skrooge because the 9th field is positive.
Comment 3 Stephane MANKOWSKI 2024-09-01 09:15:22 UTC
Hi,

You can do what you want with already existing features like this:
1- Configure your CSV import to import all columns you need. The best is may be to import for negative values + the field 4 as property.
2- Create a rule (see "Search and Process") to copy the property into the payee when the amount is positive.

That's all !
Comment 4 pat_h 2024-09-01 14:47:53 UTC
Hi,

took me a bit to get the hang of properties, but in the end I managed to solve the problem with your solution description. Thanks a lot for the support (and the great program)!