Skip to content
Snippets Groups Projects
Unverified Commit 2b06a42a authored by Joel Jeremy Marquez's avatar Joel Jeremy Marquez Committed by GitHub
Browse files

Create transfer using child transaction instead of parent (#1581)

parent d8c99221
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,14 @@ async function clearCategory(transaction, transferAcct) {
}
export async function addTransfer(transaction, transferredAccount) {
if (transaction.is_parent) {
// For split transactions, we should create transfers using child transactions.
// This is to ensure that the amounts received by the transferred account
// reflects the amounts in the child transactions and not the parent transaction
// amount which is the total amount.
return null;
}
let { id: fromPayee } = await db.first(
'SELECT id FROM payees WHERE transfer_acct = ?',
[transaction.account],
......@@ -61,10 +69,6 @@ export async function addTransfer(transaction, transferredAccount) {
await db.updateTransaction({ id: transaction.id, payee: null });
return { id: transaction.id, payee: null };
}
// The parent has the same transfer payee, so it "owns" the
// transfer logic
return null;
}
}
......
---
category: Bugfix
authors: [joel-jeremy]
---
Fix split transaction deposits parent transaction amount to off-budget account instead of the child transaction amount
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment