mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 12:43:09 -05:00
Fixed transaction dates in bank sync with MBANK_RETAIL_BREXPLPW (#4493)
* fixed transaction date for MBANK_RETAIL_BREXPLPW
* cleared up imports after previous commit (9251d3e1)
* added release notes
* linted code
* Update packages/sync-server/src/app-gocardless/banks/mbank_retail_brexplpw.js
Co-authored-by: Matt Fiddaman <github@m.fiddaman.uk>
---------
Co-authored-by: Matt Fiddaman <github@m.fiddaman.uk>
This commit is contained in:
@@ -8,6 +8,28 @@ export default {
|
||||
|
||||
institutionIds: ['MBANK_RETAIL_BREXPLPW'],
|
||||
|
||||
/**
|
||||
* When requesting transaction details for MBANK_RETAIL_BREXPLPW
|
||||
* using gocardless API, it seems that bookingDate and valueDate are swapped.
|
||||
* valueDate will always come before bookingDate, so as a simple fix,
|
||||
* I have overwritten integration-bank.normalizeTransaction() here,
|
||||
* swapped dates back (by giving valueDate higher priority) and
|
||||
* called parent method with edited transaction as argument
|
||||
*/
|
||||
normalizeTransaction(transaction, booked) {
|
||||
const editedTrans = { ...transaction };
|
||||
|
||||
const date =
|
||||
transaction.valueDate ||
|
||||
transaction.valueDateTime ||
|
||||
transaction.bookingDate ||
|
||||
transaction.bookingDateTime;
|
||||
|
||||
editedTrans.date = date;
|
||||
|
||||
return Fallback.normalizeTransaction(transaction, booked, editedTrans);
|
||||
},
|
||||
|
||||
sortTransactions(transactions = []) {
|
||||
return transactions.sort(
|
||||
(a, b) => Number(b.transactionId) - Number(a.transactionId),
|
||||
|
||||
6
upcoming-release-notes/4493.md
Normal file
6
upcoming-release-notes/4493.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [szymon-romanko]
|
||||
---
|
||||
|
||||
Fixed transaction dates for bank sync with mbank_retail_brexplpw
|
||||
Reference in New Issue
Block a user