Remove commit and correct handling of transaction amount
This commit is contained in:
parent
48ceec334e
commit
2bb7902c3b
1 changed files with 4 additions and 2 deletions
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue