actualbudget / actual

A local-first personal finance app
https://actualbudget.org
MIT License
14.19k stars 1.14k forks source link

[Bug]: Unable to flip amounts for OFX and QFX file imports #1931

Open KyleK1782 opened 11 months ago

KyleK1782 commented 11 months ago

Verified issue does not already exist?

What happened?

When importing as a QFX of OFX there is no option to "flip amounts" which is needed when importing a credit card into an account. This option does exist for QIF and CSV.

What error did you receive?

Missing option when importing some file types.

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Chrome

Operating System

Mac OSX

joel-jeremy commented 11 months ago

Can you try disabling the Experimental OFX parser in the advanced setting to see if the old OFX parser's behavior is the same?

KyleK1782 commented 11 months ago

It shows the same behaviour with that option disabled.

I looked into the code when I was opening the ticket, it seems the amount flipping happens client side, not server side. Server side the ParseFileOptions doesn't include a flipAmmounts or anything like that while in loot-core you can see function parseAmountFields(...,flipAmount,...) parameter. This leads me to believe this is a client side operation.

Desktop code: https://github.com/actualbudget/actual/blob/master/packages/desktop-client/src/components/modals/ImportTransactions.js#L253 loot-core code: https://github.com/actualbudget/actual/blob/master/packages/loot-core/src/server/accounts/parse-file.ts#L16