From 2bb7902c3bd79143e6426d3259825f02cc2579ea Mon Sep 17 00:00:00 2001 From: Campbell Alden Date: Fri, 20 Mar 2026 17:29:54 +0900 Subject: [PATCH] Remove commit and correct handling of transaction amount --- reporter.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reporter.js b/reporter.js index aa0ac33..6b4642d 100644 --- a/reporter.js +++ b/reporter.js @@ -33,7 +33,10 @@ function makeTransaction(data, account) { account, date: new Date().toLocaleDateString('sv-SE'), // "YYYY-MM-DD" payee_name: data.title, - amount: data.amount, + // Actual considers this an integer representing a decimal value so the last two digits of the integer + // are placed after the decimal point (unclear why but okay...) + // It has to be negative or actual will think it's a deposit + amount: data.amount * -100, cleared: true, }; } @@ -49,7 +52,6 @@ async function addTransaction(config, transaction) { await api.sync(); await api.addTransactions(config.accountId, [transaction]); - await api.commit(); } finally { await api.shutdown(); }