Remove commit and correct handling of transaction amount

This commit is contained in:
Campbell Alden 2026-03-20 17:29:54 +09:00
parent 48ceec334e
commit 2bb7902c3b

View file

@ -33,7 +33,10 @@ function makeTransaction(data, account) {
account, account,
date: new Date().toLocaleDateString('sv-SE'), // "YYYY-MM-DD" date: new Date().toLocaleDateString('sv-SE'), // "YYYY-MM-DD"
payee_name: data.title, 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, cleared: true,
}; };
} }
@ -49,7 +52,6 @@ async function addTransaction(config, transaction) {
await api.sync(); await api.sync();
await api.addTransactions(config.accountId, [transaction]); await api.addTransactions(config.accountId, [transaction]);
await api.commit();
} finally { } finally {
await api.shutdown(); await api.shutdown();
} }