fix creating categories for track_investments

This commit is contained in:
Robert Dyer
2024-08-10 18:46:21 -05:00
parent b7c5000883
commit 78b61ec76e
3 changed files with 65 additions and 25 deletions
+3 -2
View File
@@ -1,7 +1,7 @@
const api = require('@actual-app/api');
const fs = require('fs');
const readline = require('readline-sync');
const { closeBudget, ensureCategory, ensurePayee, getAccountBalance, getAccountNote, getSimpleFinID, getTransactions, openBudget } = require('./utils');
const { closeBudget, ensureCategory, ensureCategoryGroup, ensurePayee, getAccountBalance, getAccountNote, getSimpleFinID, getTransactions, openBudget } = require('./utils');
require("dotenv").config();
@@ -72,7 +72,8 @@ const zeroTransaction = async (payment) => {
await openBudget();
const payeeId = await ensurePayee(process.env.INVESTMENT_PAYEE_NAME || 'Investment');
const categoryId = await ensureCategory(process.env.INVESTMENT_CATEGORY_NAME || 'Investment');
const categoryGroupId = await ensureCategoryGroup(process.env.INVESTMENT_CATEGORY_GROUP_NAME || 'Income');
const categoryId = await ensureCategory(process.env.INVESTMENT_CATEGORY_NAME || 'Investment', categoryGroupId, true);
const simplefinBalances = await getSimplefinBalances();
if (simplefinBalances) {