[GH-ISSUE #4069] [Bug]: QFX amounts are lumped together in Amount column despite having distinct positive and negative values #43390

Closed
opened 2026-04-26 03:48:01 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @bverkron on GitHub (Jan 2, 2025).
Original GitHub issue: https://github.com/actualbudget/actual/issues/4069

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

When attempting to import a QFX file from my credit card company Actual Budget lumps all the values, regardless if they're positive or negative, into an "Amount" column. If I complete the import like this all the credit card charges go into the deposit column instead of the payment column and are treated as payments on the credit card instead of charges.

I am not intimately familiar with the QFX file format but I can see in the file that the transactions have positive values for payments and negative values for charges and are marked as Debit or Credit so not sure why this isn't picked up by AB and put into the Amount columns.

Have tried Safari and Brave, same behaviour.

How can we reproduce the issue?

Try to import this file...
credit_card_sample.qfx.zip

Example snippet...

...

</CCACCTFROM>
<BANKTRANLIST>
<DTSTART>20250101
<DTEND>20250101
<STMTTRN>
<TRNTYPE>DEBIT <--- Shows Debit
<DTPOSTED>20250101120000
<TRNAMT>-5.55  <--- Shows negative amount
<FITID>123456789098765
<NAME>Patreon* Membership

</STMTTRN>
<STMTTRN>
<TRNTYPE>CREDIT <--- Shows Credit
<DTPOSTED>20241225120000
<TRNAMT>200 <--- Shows positive amount
<FITID>453826288711501122222225990000221500
<NAME>THANK YOU

...

Should see results like this...
image

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Chrome, Safari

Operating System

Mac OSX

Originally created by @bverkron on GitHub (Jan 2, 2025). Original GitHub issue: https://github.com/actualbudget/actual/issues/4069 ### Verified issue does not already exist? - [X] I have searched and found no existing issue ### What happened? When attempting to import a QFX file from my credit card company Actual Budget lumps all the values, regardless if they're positive or negative, into an "Amount" column. If I complete the import like this all the credit card charges go into the deposit column instead of the payment column and are treated as payments on the credit card instead of charges. I am not intimately familiar with the QFX file format but I can see in the file that the transactions have positive values for payments and negative values for charges and are marked as Debit or Credit so not sure why this isn't picked up by AB and put into the Amount columns. Have tried Safari and Brave, same behaviour. ### How can we reproduce the issue? Try to import this file... [credit_card_sample.qfx.zip](https://github.com/user-attachments/files/18287177/credit_card_sample.qfx.zip) Example snippet... ``` ... </CCACCTFROM> <BANKTRANLIST> <DTSTART>20250101 <DTEND>20250101 <STMTTRN> <TRNTYPE>DEBIT <--- Shows Debit <DTPOSTED>20250101120000 <TRNAMT>-5.55 <--- Shows negative amount <FITID>123456789098765 <NAME>Patreon* Membership </STMTTRN> <STMTTRN> <TRNTYPE>CREDIT <--- Shows Credit <DTPOSTED>20241225120000 <TRNAMT>200 <--- Shows positive amount <FITID>453826288711501122222225990000221500 <NAME>THANK YOU ... ``` Should see results like this... ![image](https://github.com/user-attachments/assets/91a0170a-f4cb-4ffe-bad4-4fa02b568f74) ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Chrome, Safari ### Operating System Mac OSX
GiteaMirror added the bug label 2026-04-26 03:48:02 -05:00
Author
Owner

@jx34tech commented on GitHub (Jan 11, 2025):

I just want to add that I have seen this bug the same way (pulled via docker) for myself, Every file format shown in this way except for QIF, that appeared to import the data correctly

<!-- gh-comment-id:2585068008 --> @jx34tech commented on GitHub (Jan 11, 2025): I just want to add that I have seen this bug the same way (pulled via docker) for myself, Every file format shown in this way except for QIF, that appeared to import the data correctly
Author
Owner

@matt-fidd commented on GitHub (Jan 30, 2025):

I can't seem to replicate this on edge, has it been fixed?

https://github.com/user-attachments/assets/49ce8530-64e8-40b9-8b46-a0007a7da465

<!-- gh-comment-id:2625743257 --> @matt-fidd commented on GitHub (Jan 30, 2025): I can't seem to replicate this on edge, has it been fixed? https://github.com/user-attachments/assets/49ce8530-64e8-40b9-8b46-a0007a7da465
Author
Owner

@bverkron commented on GitHub (Feb 3, 2025):

Strange it's working for your. I just tried edge and I get the same behaviour as described originally. Everything goes into the Amount column as a positive value, both with the attached sample file and a fresh file from my credit card company.

Tried wiping all cache in my browser as well. No change. Tried Safari and Brave (basically Chrome) on macOS.

Image

Not sure how to better check the version of Actual I'm running. The UI just says 25.1.0 but says nothing about edge or finer versions.

$ docker images | grep actual
ghcr.io/actualbudget/actual-server           edge               823d1676e97d   4 hours ago     283MB
ghcr.io/actualbudget/actual-server           25.1.0             3472601b8aac   3 weeks ago     258MB
<!-- gh-comment-id:2629963010 --> @bverkron commented on GitHub (Feb 3, 2025): Strange it's working for your. I just tried edge and I get the same behaviour as described originally. Everything goes into the Amount column as a positive value, both with the attached sample file and a fresh file from my credit card company. Tried wiping all cache in my browser as well. No change. Tried Safari and Brave (basically Chrome) on macOS. ![Image](https://github.com/user-attachments/assets/dd723413-5ea1-4efe-9afd-639893d66446) Not sure how to better check the version of Actual I'm running. The UI just says 25.1.0 but says nothing about edge or finer versions. ```shell $ docker images | grep actual ghcr.io/actualbudget/actual-server edge 823d1676e97d 4 hours ago 283MB ghcr.io/actualbudget/actual-server 25.1.0 3472601b8aac 3 weeks ago 258MB ```
Author
Owner

@langelgjm commented on GitHub (Feb 12, 2025):

Confirming I see the same issue on version 25.2.1 on Mac OS, installed from a DMG I downloaded today. My credit card company provides a QFX export with negative numbers for debits and positive for credits, but when imported into Actual, both negative and positive amounts appears in the "Deposit" column, so that debits look like credits.

In both the sample provided in this bug report and my data file, the OFX file has DATA:OFXSGML and VERSION:102 headers, so it is an older version of the OFX standard. In contrast my bank provides a QFX file that's version 202 and uses XML, and when I import the XML-based QFX file debits and credits show up correctly.

In packages/loot-core/src/server/accounts/ofx2json.ts I can see that SGML-based OFX data is first converted to XML before being parsed, but I didn't see anything obvious that would cause the sign of the transaction to be lost. I don't have a proper development environment set up yet but would be happy to dig into this further.

<!-- gh-comment-id:2654830841 --> @langelgjm commented on GitHub (Feb 12, 2025): Confirming I see the same issue on version 25.2.1 on Mac OS, installed from a DMG I downloaded today. My credit card company provides a QFX export with negative numbers for <TRNAMT> debits and positive for credits, but when imported into Actual, both negative and positive amounts appears in the "Deposit" column, so that debits look like credits. In both the sample provided in this bug report and my data file, the OFX file has DATA:OFXSGML and VERSION:102 headers, so it is an older version of the OFX standard. In contrast my bank provides a QFX file that's version 202 and uses XML, and when I import the XML-based QFX file debits and credits show up correctly. In packages/loot-core/src/server/accounts/ofx2json.ts I can see that SGML-based OFX data is first converted to XML before being parsed, but I didn't see anything obvious that would cause the sign of the transaction to be lost. I don't have a proper development environment set up yet but would be happy to dig into this further.
Author
Owner

@langelgjm commented on GitHub (Feb 13, 2025):

Upon further research, the only way I can reproduce this issue is with the following steps:

  1. Import a CSV to an account. During import, check "in/out identifier" in the "amount options" section and specify a string (like "DEBIT") to identify negative amounts.
Image
  1. Import a QFX containing the same transactions to the same account. During import, Actual treats all transactions as deposits, and thus can only merge deposits. All payments (debits) get incorrectly added as deposits.
Image
  • If I import the QFX without having first imported the CSV, the issue doesn't occur.
  • If I import the CSV but don't use the "in/out identifier", then import the QFX, the issue doesn't occur.
  • If I create a manual transaction that is a duplicate of a transaction in the QFX, then import the QFX, the issue doesn't occur.

This suggests to me the issue has nothing to do with OFX parsing. Instead, it seems that having chosen to previously use an "in/out identifier" is affecting how amounts are read from subsequent imports.

I'm attaching a sample CSV file that contains the same transactions as the sample QFX.

I confirmed the issue is present in the current repo code built with Docker Compose.

credit_card_sample.csv

<!-- gh-comment-id:2655815289 --> @langelgjm commented on GitHub (Feb 13, 2025): Upon further research, the only way I can reproduce this issue is with the following steps: 1. Import a CSV to an account. During import, check "in/out identifier" in the "amount options" section and specify a string (like "DEBIT") to identify negative amounts. <img width="818" alt="Image" src="https://github.com/user-attachments/assets/713c9848-fefd-47c8-ba0f-c8cd7659c1f7" /> 2. Import a QFX containing the same transactions to the same account. During import, Actual treats all transactions as deposits, and thus can only merge deposits. All payments (debits) get incorrectly added as deposits. <img width="815" alt="Image" src="https://github.com/user-attachments/assets/5a81e6bc-8d91-41f1-a2e7-6f8bf60e77c8" /> - If I import the QFX without having first imported the CSV, the issue doesn't occur. - If I import the CSV but don't use the "in/out identifier", then import the QFX, the issue doesn't occur. - If I create a manual transaction that is a duplicate of a transaction in the QFX, then import the QFX, the issue doesn't occur. This suggests to me the issue has nothing to do with OFX parsing. Instead, it seems that having chosen to previously use an "in/out identifier" is affecting how amounts are read from subsequent imports. I'm attaching a sample CSV file that contains the same transactions as the sample QFX. I confirmed the issue is present in the current repo code built with Docker Compose. [credit_card_sample.csv](https://github.com/user-attachments/files/18780256/credit_card_sample.csv)
Author
Owner

@bverkron commented on GitHub (Feb 13, 2025):

Great find @langelgjm.

I can confirm that recently I have been using .csv imports with this account because my bank was going through some changes and was only providing .csv as an option (though they had other formats before). So, this could very well be the cause of the issue for me too. Will try to confirm when I have time but I think it’s very likely the case for me.

<!-- gh-comment-id:2657456133 --> @bverkron commented on GitHub (Feb 13, 2025): Great find @langelgjm. I can confirm that recently I have been using .csv imports with this account because my bank was going through some changes and was only providing .csv as an option (though they had other formats before). So, this could very well be the cause of the issue for me too. Will try to confirm when I have time but I think it’s very likely the case for me.
Author
Owner

@langelgjm commented on GitHub (Feb 14, 2025):

I opened #4382 which checks to see if the file being imported is an OFX file, and if so, ignores the "inOutMode" which is CSV-specific, and it resolves the issue for me locally. Not sure if this should also check for CAMT files.

<!-- gh-comment-id:2660276008 --> @langelgjm commented on GitHub (Feb 14, 2025): I opened #4382 which checks to see if the file being imported is an OFX file, and if so, ignores the "inOutMode" which is CSV-specific, and it resolves the issue for me locally. Not sure if this should also check for CAMT files.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#43390