mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 18:40:34 -05:00
🐛 (import) fix reconciled transactions getting overriden on import (#2140)
This commit is contained in:
committed by
GitHub
parent
d8996405c4
commit
d2b86d100c
@@ -436,7 +436,7 @@ export async function reconcileGoCardlessTransactions(acctId, transactions) {
|
||||
// matched transaction. See the final pass below for the needed
|
||||
// fields.
|
||||
fuzzyDataset = await db.all(
|
||||
`SELECT id, is_parent, date, imported_id, payee, category, notes FROM v_transactions
|
||||
`SELECT id, is_parent, date, imported_id, payee, category, notes, reconciled FROM v_transactions
|
||||
WHERE date >= ? AND date <= ? AND amount = ? AND account = ? AND is_child = 0`,
|
||||
[
|
||||
db.toDateRepr(monthUtils.subDays(trans.date, 4)),
|
||||
@@ -494,6 +494,11 @@ export async function reconcileGoCardlessTransactions(acctId, transactions) {
|
||||
// Finally, generate & commit the changes
|
||||
for (const { trans, subtransactions, match } of transactionsStep3) {
|
||||
if (match) {
|
||||
// Skip updating already reconciled (locked) transactions
|
||||
if (match.reconciled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO: change the above sql query to use aql
|
||||
const existing = {
|
||||
...match,
|
||||
@@ -594,7 +599,7 @@ export async function reconcileTransactions(acctId, transactions) {
|
||||
// matched transaction. See the final pass below for the needed
|
||||
// fields.
|
||||
fuzzyDataset = await db.all(
|
||||
`SELECT id, is_parent, date, imported_id, payee, category, notes FROM v_transactions
|
||||
`SELECT id, is_parent, date, imported_id, payee, category, notes, reconciled FROM v_transactions
|
||||
WHERE date >= ? AND date <= ? AND amount = ? AND account = ? AND is_child = 0`,
|
||||
[
|
||||
db.toDateRepr(monthUtils.subDays(trans.date, 4)),
|
||||
@@ -652,6 +657,11 @@ export async function reconcileTransactions(acctId, transactions) {
|
||||
// Finally, generate & commit the changes
|
||||
for (const { trans, subtransactions, match } of transactionsStep3) {
|
||||
if (match) {
|
||||
// Skip updating already reconciled (locked) transactions
|
||||
if (match.reconciled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO: change the above sql query to use aql
|
||||
const existing = {
|
||||
...match,
|
||||
|
||||
6
upcoming-release-notes/2140.md
Normal file
6
upcoming-release-notes/2140.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [MatissJanis]
|
||||
---
|
||||
|
||||
Fix imported transactions overriding reconciled (locked) transaction data
|
||||
Reference in New Issue
Block a user