Automatic transaction merging #793
Replies: 1 comment
-
Definitely it is a must to handle transactions between your own account in some way. I have 14k + imported transactions from 8+ accounts. My approach is to create a dummy transfer account for each of my accounts. Transactions between my own accounts always push and pull money to/from one of the transfer accounts, which should be at 0 balance if everything is imported correctly. I don't delete duplicates. That way I don't loose narration details. It is often the case that both duplicate transactions would contain different narration details. Especially true for Revolut (I see you have a Revolut account in the snippet above). Revolut provides very scarce transaction details in the exported csv. Having the other transactions helps a lot. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone! Just discovered beancount, having a great time with it.
I was reading through the documentation, and was surprised when the Importing Process section said that merging has to be done manually. Not sure if I've misunderstood this part, or if I'm missing some tool that makes this easier. Anyway I wrote a plugin to do what I wanted. Sharing it here in case it's useful to others, or more likely in case someone has a better way to do this.
Situation: I'm importing transaction data from multiple bank accounts, which include many transactions that transfer money between my own accounts. In this case the transaction would be logged twice, since it is seen in the logs of both bank accounts (as the documentation mentions).
Assuming every transaction was logged, any transfer that goes to another imported bank account is guaranteed to be logged twice, making it very easy to remove duplicates. Here's the whole plugin:
This is iterating over all transactions with the following logic:
If there's anything left in the "waiting" set by the end, a warning is printed to say that transactions are missing.
This feature was an absolute must-have for me as I'm importing several years of transaction data, and wasn't about to delete duplicates by hand. It seems to be working, but is there a better way? Any feedback welcome.
Beta Was this translation helpful? Give feedback.
All reactions