From 73a134730f682e54e15f4813df6946abdb45db4a Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 13 Dec 2022 13:13:13 -0800 Subject: [PATCH] Bug 798680 - Not able to match a reverse transaction of a... previously matched transaction. Cloned transactions and copied splits shouldn't keep the online-id slot. --- libgnucash/engine/Split.c | 2 ++ libgnucash/engine/Transaction.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/libgnucash/engine/Split.c b/libgnucash/engine/Split.c index d8fc1b784e..af95889825 100644 --- a/libgnucash/engine/Split.c +++ b/libgnucash/engine/Split.c @@ -624,6 +624,8 @@ void xaccSplitCopyKvp (const Split *from, Split *to) { qof_instance_copy_kvp (QOF_INSTANCE (to), QOF_INSTANCE (from)); + /* But not the online-id */ + qof_instance_set (QOF_INSTANCE (to), "online-id", NULL, NULL); } /*################## Added for Reg2 #################*/ diff --git a/libgnucash/engine/Transaction.c b/libgnucash/engine/Transaction.c index ce4761b6b6..d8255f14c0 100644 --- a/libgnucash/engine/Transaction.c +++ b/libgnucash/engine/Transaction.c @@ -693,6 +693,9 @@ xaccTransClone (const Transaction *from) xaccTransBeginEdit (to); qof_instance_copy_kvp (QOF_INSTANCE (to), QOF_INSTANCE (from)); + /* But not the online-id! */ + qof_instance_set (QOF_INSTANCE (to), "online-id", NULL, NULL); + for (GList* lfrom = from->splits, *lto = to->splits; lfrom && lto; lfrom = g_list_next (lfrom), lto = g_list_next (lto)) xaccSplitCopyKvp (lfrom->data, lto->data);