fix: only parse kbb daily mileage transaction if has previous data

This commit is contained in:
Ivan Schurawel
2024-12-14 01:49:31 -05:00
committed by GitHub
parent 33d37458e9
commit 46da751a2d
+2
View File
@@ -63,6 +63,7 @@ async function getKBB(URL) {
const daily = parseInt(getTagValue(note, 'kbbDailyMileage'));
if (mileage && daily) {
let lastDate = await getLastTransactionDate(account, undefined, true);
if (lastDate) {
const parts = lastDate.split('-');
lastDate = new Date(parts[0], parts[1] - 1, parts[2]);
if (lastDate < new Date()) {
@@ -81,6 +82,7 @@ async function getKBB(URL) {
}
}
}
}
await api.importTransactions(account.id, [{
date: new Date(),