From bb21b7d675296f24c6232fedff616a6084f5c174 Mon Sep 17 00:00:00 2001 From: Matt Fiddaman Date: Thu, 21 Nov 2024 15:49:08 +0000 Subject: [PATCH] fix bug in batch SimpleFIN startDate logic (#504) --- src/app-simplefin/app-simplefin.js | 7 ++++--- upcoming-release-notes/504.md | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 upcoming-release-notes/504.md diff --git a/src/app-simplefin/app-simplefin.js b/src/app-simplefin/app-simplefin.js index 436ebd552..44bc5d53b 100644 --- a/src/app-simplefin/app-simplefin.js +++ b/src/app-simplefin/app-simplefin.js @@ -210,12 +210,13 @@ function getAccountResponse(results, accountId, startDate) { dateToUse = trans.posted; } - newTrans.bookingDate = getDate(new Date(dateToUse * 1000)); - if (newTrans.bookingDate < startDate) { + const transactionDate = new Date(dateToUse * 1000); + + if (transactionDate < startDate) { continue; } - newTrans.date = newTrans.bookingDate; + newTrans.date = getDate(transactionDate); newTrans.payeeName = trans.payee; newTrans.remittanceInformationUnstructured = trans.description; newTrans.transactionAmount = { amount: trans.amount, currency: 'USD' }; diff --git a/upcoming-release-notes/504.md b/upcoming-release-notes/504.md new file mode 100644 index 000000000..5f3364eba --- /dev/null +++ b/upcoming-release-notes/504.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [matt-fidd] +--- + +Fix bug in batch SimpleFIN startDate logic