Balance issue after currency change in transfer updates #9487
Replies: 2 comments
-
Nice find, and thanks for submitting a fix. I'll check it out! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Nice! Merged and fixed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I encountered an issue with balances in Firefly III after making a currency change in one of my accounts. This issue specifically happens during transfer updates. Here’s the sequence of events:
PUT /api/v1/transactions
to setforeign_amount
andforeign_currency_id
for the transfer. The transfer was successfully updated.When I checked the logs, I saw errors like this (where
%d
is the journal ID):To investigate further, I ran some database queries and noticed that the
foreign_amount
andforeign_currency_id
fields wereNULL
for the destination transaction of the transfer. This mismatch caused the errors and balance issues.To resolve the immediate issue, I ran the following SQL script to fix these cases in the database:
To address the root cause, I’ve also made a code change and will be raising a PR to fix this issue. The proposed fix ensures that
foreign_amount
andforeign_currency_id
are properly set for destination transactions when handling foreign currency transfers.I’d appreciate any feedback or thoughts on this! Let me know if you’ve encountered similar issues or have suggestions for improvement.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions