Skip to content

A local-first personal finance app

[AI] No longer adjust date to match on transfers (#7722)

Stephen Brown II8fbad7d64f02
diff --git a/packages/loot-core/src/server/__snapshots__/main.test.ts.snap b/packages/loot-core/src/server/__snapshots__/main.test.ts.snap
index 950ca76643..e3df0e0a2c 100644
--- a/packages/loot-core/src/server/__snapshots__/main.test.ts.snap
+++ b/packages/loot-core/src/server/__snapshots__/main.test.ts.snap
@@ -76,7 +76,7 @@ exports[`Accounts > Transfers are properly updated 2`] = `
"id": "test-transfer",
"imported_description": null,
"isChild": 0,
-@@ -24,15 +24,15 @@
+@@ -24,11 +24,11 @@
"tombstone": 0,
"transferred_id": "id2",
"type": null,
@@ -87,13 +87,8 @@ exports[`Accounts > Transfers are properly updated 2`] = `
"amount": -5000,
"category": null,
"cleared": 0,
-- "date": 20170101,
-+ "date": 20170103,
- "description": "transfer-one",
- "error": null,
- "financial_id": null,
- "id": "id2",
- "imported_description": null,"
+ "date": 20170101,
+ "description": "transfer-one","
`;
exports[`Accounts > Transfers are properly updated 3`] = `
diff --git a/packages/loot-core/src/server/transactions/__snapshots__/transfer.test.ts.snap b/packages/loot-core/src/server/transactions/__snapshots__/transfer.test.ts.snap
index ab086db05d..b45d45698e 100644
--- a/packages/loot-core/src/server/transactions/__snapshots__/transfer.test.ts.snap
+++ b/packages/loot-core/src/server/transactions/__snapshots__/transfer.test.ts.snap
@@ -355,7 +355,7 @@ exports[`Transfer > transfers are properly inserted/updated/deleted 3`] = `
"- First value
+ Second value
-@@ -2,73 +2,73 @@
+@@ -2,52 +2,52 @@
Object {
"account": "one",
"amount": 5000,
@@ -387,28 +387,24 @@ exports[`Transfer > transfers are properly inserted/updated/deleted 3`] = `
+ "transfer_id": "id8",
},
Object {
-- "account": "one",
-- "amount": 5000,
-+ "account": "two",
-+ "amount": -5000,
+ "account": "one",
+ "amount": 5000,
"category": null,
-- "cleared": 1,
-- "date": 20170101,
-+ "cleared": 0,
-+ "date": 20170105,
+ "cleared": 1,
+ "date": 20170101,
"error": null,
- "id": "id7",
-+ "id": "id8",
++ "id": "id6",
"imported_id": null,
"imported_payee": null,
"is_child": 0,
"is_parent": 0,
-- "notes": null,
-+ "notes": "This is a note",
+ "notes": null,
"parent_id": null,
- "payee": "id3",
-+ "payee": "id2",
- "payee_name": "",
+- "payee_name": "",
++ "payee": "id5",
++ "payee_name": "Non-transfer",
"raw_synced_data": null,
"reconciled": 0,
"schedule": null,
@@ -416,47 +412,32 @@ exports[`Transfer > transfers are properly inserted/updated/deleted 3`] = `
"starting_balance_flag": 0,
"tombstone": 0,
- "transfer_id": "id8",
-+ "transfer_id": "id7",
++ "transfer_id": null,
},
Object {
-- "account": "two",
-- "amount": -5000,
-+ "account": "one",
-+ "amount": 5000,
+ "account": "two",
+ "amount": -5000,
"category": null,
-- "cleared": 0,
-+ "cleared": 1,
- "date": 20170101,
- "error": null,
-- "id": "id8",
-+ "id": "id6",
+@@ -57,11 +57,11 @@
+ "id": "id8",
"imported_id": null,
"imported_payee": null,
"is_child": 0,
"is_parent": 0,
- "notes": null,
+- "notes": null,
++ "notes": "This is a note",
"parent_id": null,
-- "payee": "id2",
-- "payee_name": "",
-+ "payee": "id5",
-+ "payee_name": "Non-transfer",
+ "payee": "id2",
+ "payee_name": "",
"raw_synced_data": null,
- "reconciled": 0,
- "schedule": null,
- "sort_order": 123456789,
- "starting_balance_flag": 0,
- "tombstone": 0,
-- "transfer_id": "id7",
-+ "transfer_id": null,
- },
- ]"
+ "reconciled": 0,"
`;
exports[`Transfer > transfers are properly inserted/updated/deleted 4`] = `
"- First value
+ Second value
-@@ -11,22 +11,22 @@
+@@ -11,11 +11,11 @@
"imported_payee": null,
"is_child": 0,
"is_parent": 0,
@@ -469,9 +450,10 @@ exports[`Transfer > transfers are properly inserted/updated/deleted 4`] = `
"reconciled": 0,
"schedule": null,
"sort_order": 123456789,
+@@ -46,11 +46,11 @@
"starting_balance_flag": 0,
"tombstone": 0,
- "transfer_id": "id8",
+ "transfer_id": null,
},
Object {
- "account": "two",
@@ -479,7 +461,7 @@ exports[`Transfer > transfers are properly inserted/updated/deleted 4`] = `
"amount": -5000,
"category": null,
"cleared": 0,
- "date": 20170105,
+ "date": 20170101,
"error": null,"
`;
@@ -487,7 +469,7 @@ exports[`Transfer > transfers are properly inserted/updated/deleted 5`] = `
"- First value
+ Second value
-@@ -11,43 +11,19 @@
+@@ -11,19 +11,19 @@
"imported_payee": null,
"is_child": 0,
"is_parent": 0,
@@ -504,13 +486,25 @@ exports[`Transfer > transfers are properly inserted/updated/deleted 5`] = `
"starting_balance_flag": 0,
"tombstone": 0,
- "transfer_id": "id8",
++ "transfer_id": null,
+ },
+ Object {
+ "account": "one",
+ "amount": 5000,
+ "category": null,
+@@ -44,31 +44,7 @@
+ "schedule": null,
+ "sort_order": 123456789,
+ "starting_balance_flag": 0,
+ "tombstone": 0,
+ "transfer_id": null,
- },
- Object {
- "account": "three",
- "amount": -5000,
- "category": null,
- "cleared": 0,
-- "date": 20170105,
+- "date": 20170101,
- "error": null,
- "id": "id8",
- "imported_id": null,
@@ -528,12 +522,8 @@ exports[`Transfer > transfers are properly inserted/updated/deleted 5`] = `
- "starting_balance_flag": 0,
- "tombstone": 0,
- "transfer_id": "id7",
-+ "transfer_id": null,
},
- Object {
- "account": "one",
- "amount": 5000,
- "category": null,"
+ ]"
`;
exports[`Transfer > transfers are properly inserted/updated/deleted 6`] = `
diff --git a/packages/loot-core/src/server/transactions/transfer.ts b/packages/loot-core/src/server/transactions/transfer.ts
index 4dc5144758..70cb9110dc 100644
--- a/packages/loot-core/src/server/transactions/transfer.ts
+++ b/packages/loot-core/src/server/transactions/transfer.ts
@@ -126,7 +126,6 @@ export async function updateTransfer(transaction, transferredAccount) {
// Make sure to update the payee on the other side in case the
// user moved this transaction into another account
payee: payee.id,
- date: transaction.date,
notes: transaction.notes,
amount: -transaction.amount,
schedule: transaction.schedule,
diff --git a/upcoming-release-notes/7722.md b/upcoming-release-notes/7722.md
new file mode 100644
index 0000000000..9554b73784
--- /dev/null
+++ b/upcoming-release-notes/7722.md
@@ -0,0 +1,6 @@
+---
+category: Enhancements
+authors: [StephenBrown2]
+---
+
+No longer require transfers to have the same date