Skip to content
Snippets Groups Projects
Unverified Commit 7c0c440d authored by Jed Fox's avatar Jed Fox Committed by GitHub
Browse files

Fix importing transfers from YNAB4/5 (#1224)

parent 0d636aa0
No related branches found
No related tags found
No related merge requests found
......@@ -222,6 +222,7 @@ async function importTransactions(data, entityIdMap) {
transaction.subTransactions &&
transaction.subTransactions.map((t, i) => {
return {
id: entityIdMap.get(t.entityId),
amount: amountToInteger(t.amount),
category: getCategory(t.categoryId),
notes: t.memo || null,
......
......@@ -164,6 +164,9 @@ async function importTransactions(data, entityIdMap) {
for (let transaction of data.transactions) {
entityIdMap.set(transaction.id, uuidv4());
}
for (let transaction of data.subtransactions) {
entityIdMap.set(transaction.id, uuidv4());
}
await Promise.all(
Object.keys(transactionsGrouped).map(async accountId => {
......@@ -180,6 +183,7 @@ async function importTransactions(data, entityIdMap) {
if (subtransactions) {
subtransactions = subtransactions.map(subtrans => {
return {
id: entityIdMap.get(subtrans.id),
amount: amountFromYnab(subtrans.amount),
category: entityIdMap.get(subtrans.category_id) || null,
notes: subtrans.memo,
......
---
category: Bugfix
authors: [j-f1]
---
Imports from YNAB4/nYNAB will now link transfer transactions correctly
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