Use API getAccountBalance

This commit is contained in:
Alfie Day
2024-08-24 20:11:07 +01:00
committed by GitHub
parent 5d44fa3a30
commit aca6e0145b
6 changed files with 10 additions and 23 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
const api = require('@actual-app/api');
const jsdom = require("jsdom");
const { closeBudget, ensurePayee, getAccountBalance, getAccountNote, getLastTransactionDate, getTagValue, openBudget, setAccountNote, sleep } = require('./utils');
const { closeBudget, ensurePayee, getAccountNote, getLastTransactionDate, getTagValue, openBudget, setAccountNote, sleep } = require('./utils');
require("dotenv").config();
async function getKBB(URL) {
@@ -52,7 +52,7 @@ async function getKBB(URL) {
console.log('Fetching KBB for account:', account.name);
const kbb = await getKBB(URL);
const balance = await getAccountBalance(account);
const balance = await api.getAccountBalance(account);
const diff = kbb - balance;
console.log('KBB:', kbb);