Fix scheduled transfers not linking when payee account is imported first (#6025)

This commit is contained in:
Matiss Janis Aboltins
2025-11-05 22:15:11 +00:00
committed by GitHub
parent e786bdc398
commit 1a845583ef
2 changed files with 16 additions and 2 deletions

View File

@@ -68,14 +68,21 @@ export async function addTransfer(transaction, transferredAccount) {
schedule: transaction.schedule,
cleared: false,
};
const { notes, cleared } = await runRules(transferTransaction);
const { notes, cleared, schedule } = await runRules(transferTransaction);
const matchedSchedule = schedule ?? transaction.schedule;
const id = await db.insertTransaction({
...transferTransaction,
notes,
cleared,
schedule: matchedSchedule,
});
await db.updateTransaction({ id: transaction.id, transfer_id: id });
await db.updateTransaction({
id: transaction.id,
transfer_id: id,
...(matchedSchedule ? { schedule: matchedSchedule } : {}),
});
const categoryCleared = await clearCategory(transaction, transferredAccount);
return {

View File

@@ -0,0 +1,7 @@
---
category: Bugfix
authors: [MatissJanis]
---
Fix scheduled transfers not linking when payee account is imported first