Fix importing transfers from YNAB4/5 (#1224)

This commit is contained in:
Jed Fox
2023-07-01 06:28:27 -04:00
committed by GitHub
parent 0d636aa04c
commit 7c0c440df2
3 changed files with 11 additions and 0 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [j-f1]
---
Imports from YNAB4/nYNAB will now link transfer transactions correctly