[PR #4739] [MERGED] [Feature] Manually merge transactions #5563

Closed
opened 2026-02-28 21:14:28 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/4739
Author: @alecbakholdin
Created: 4/3/2025
Status: Merged
Merged: 4/17/2025
Merged by: @youngcw

Base: masterHead: merge-transactions


📝 Commits (10+)

  • b34c271 added transactions-merge action
  • 0c0a3f5 mergeTransactions now returns kept id
  • 8768d4d merge option only shows up when amount matches
  • 84a0dc5 merge now handles more errors and merges from the dropped transaction if values are present
  • 5b36435 modified merge logic slightly to avoid duplicating imported_id
  • 1ffbd4e added reconciled and cleared to merge logic
  • 84febe1 modified canMerge logic in SelectedTransactionsButton
  • 25d243a made merge undoable
  • 8edc35e added onMerge to mobile menu
  • 20c9714 release notes

📊 Changes

10 files changed (+473 additions, -26 deletions)

View changed files

📝 packages/desktop-client/src/components/accounts/Account.tsx (+13 -0)
📝 packages/desktop-client/src/components/accounts/Header.tsx (+3 -0)
📝 packages/desktop-client/src/components/mobile/transactions/TransactionList.tsx (+39 -15)
📝 packages/desktop-client/src/components/transactions/SelectedTransactionsButton.tsx (+44 -10)
📝 packages/desktop-client/src/hooks/useTransactionBatchActions.ts (+9 -0)
📝 packages/loot-core/src/server/db/index.ts (+4 -1)
📝 packages/loot-core/src/server/transactions/app.ts (+3 -0)
packages/loot-core/src/server/transactions/merge.test.ts (+286 -0)
packages/loot-core/src/server/transactions/merge.ts (+66 -0)
upcoming-release-notes/4739.md (+6 -0)

📄 Description

Attempts to implement the manual transaction merge option described first in #669 and seen again in #4676

Merge is only selectable only when two transactions with matching amounts are selected:
image
image

Does not show up with one selected on desktop
image

Greyed out on mobile when conditions are not met
image

For the two transactions, one is kept and one is dropped using the following logic:

  1. If only one of the two is bank synced (only one of them has imported_id set), that one is kept
  2. If only one of the transactions is imported by file (only one of them has imported_payee set), that one is kept
  3. The earlier transaction is kept

The following fields can be affected by merge:

  1. payee
  2. notes
  3. category
  4. cleared
  5. reconciled

If any of these fields is empty in the kept transaction (for cleared and reconciled, empty = false), they are copied from the dropped transaction.

resolves #669


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/4739 **Author:** [@alecbakholdin](https://github.com/alecbakholdin) **Created:** 4/3/2025 **Status:** ✅ Merged **Merged:** 4/17/2025 **Merged by:** [@youngcw](https://github.com/youngcw) **Base:** `master` ← **Head:** `merge-transactions` --- ### 📝 Commits (10+) - [`b34c271`](https://github.com/actualbudget/actual/commit/b34c2713590cee14dcea64b2ae1e8eeddcb3a6bd) added transactions-merge action - [`0c0a3f5`](https://github.com/actualbudget/actual/commit/0c0a3f5e83355df63518a4757e1fb5247f21cb52) mergeTransactions now returns kept id - [`8768d4d`](https://github.com/actualbudget/actual/commit/8768d4dc2d9b3e778d9bc014c0394062b4171ba7) merge option only shows up when amount matches - [`84a0dc5`](https://github.com/actualbudget/actual/commit/84a0dc5e551da2865f40adbc228ba87196da7530) merge now handles more errors and merges from the dropped transaction if values are present - [`5b36435`](https://github.com/actualbudget/actual/commit/5b36435febc055f331ba97f8d35563d06e2fc747) modified merge logic slightly to avoid duplicating imported_id - [`1ffbd4e`](https://github.com/actualbudget/actual/commit/1ffbd4e90526fc9bfdfaff94642c8a453723e181) added reconciled and cleared to merge logic - [`84febe1`](https://github.com/actualbudget/actual/commit/84febe10faa64fe65e7e7a32402ee694c39f26dd) modified canMerge logic in SelectedTransactionsButton - [`25d243a`](https://github.com/actualbudget/actual/commit/25d243adf950eb385bcce7b3fb74d0750adaeee2) made merge undoable - [`8edc35e`](https://github.com/actualbudget/actual/commit/8edc35e35237484dee6ee0fb0d9eab64c7b2df1c) added onMerge to mobile menu - [`20c9714`](https://github.com/actualbudget/actual/commit/20c97142ce87f25ff00506882c41d44d962a6863) release notes ### 📊 Changes **10 files changed** (+473 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/accounts/Account.tsx` (+13 -0) 📝 `packages/desktop-client/src/components/accounts/Header.tsx` (+3 -0) 📝 `packages/desktop-client/src/components/mobile/transactions/TransactionList.tsx` (+39 -15) 📝 `packages/desktop-client/src/components/transactions/SelectedTransactionsButton.tsx` (+44 -10) 📝 `packages/desktop-client/src/hooks/useTransactionBatchActions.ts` (+9 -0) 📝 `packages/loot-core/src/server/db/index.ts` (+4 -1) 📝 `packages/loot-core/src/server/transactions/app.ts` (+3 -0) ➕ `packages/loot-core/src/server/transactions/merge.test.ts` (+286 -0) ➕ `packages/loot-core/src/server/transactions/merge.ts` (+66 -0) ➕ `upcoming-release-notes/4739.md` (+6 -0) </details> ### 📄 Description Attempts to implement the manual transaction merge option described first in #669 and seen again in #4676 Merge is only selectable only when two transactions with matching amounts are selected: <img width="1287" alt="image" src="https://github.com/user-attachments/assets/2919d016-b827-4cd5-9fb2-27c9869e4c00" /> <img width="443" alt="image" src="https://github.com/user-attachments/assets/9ca6600a-8d90-4d1e-a090-1a4c18b14168" /> Does not show up with one selected on desktop <img width="1295" alt="image" src="https://github.com/user-attachments/assets/73a8b359-5c94-4404-9b0e-69ac3c6579d0" /> Greyed out on mobile when conditions are not met <img width="427" alt="image" src="https://github.com/user-attachments/assets/26d01b04-3438-45a0-8c67-51c201fd23e0" /> For the two transactions, one is kept and one is dropped using the following logic: 1. If only one of the two is bank synced (only one of them has imported_id set), that one is kept 2. If only one of the transactions is imported by file (only one of them has imported_payee set), that one is kept 3. The earlier transaction is kept The following fields can be affected by merge: 1. payee 2. notes 3. category 4. cleared 5. reconciled If any of these fields is empty in the kept transaction (for cleared and reconciled, empty = false), they are copied from the dropped transaction. resolves #669 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 21:14:28 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#5563