Skip to content

Commit ceb765c

Browse files
andreparamesmatt-fidd
authored andcommitted
enhancement: fix Cetelem bank transations (actualbudget#5914)
* enhancement: fix Cetelem bank transations The amount coming from GoCardless has the opposite sign of what we expect. * Cetelem bank: make code more future-proof Change based on code review suggestion Co-authored-by: Matt Fiddaman <[email protected]> --------- Co-authored-by: Matt Fiddaman <[email protected]>
1 parent 976588e commit ceb765c

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import Fallback from './integration-bank.js';
2+
3+
/** @type {import('./bank.interface.js').IBank} */
4+
export default {
5+
...Fallback,
6+
7+
institutionIds: ['CETELEM_CETMPTP1XXX'],
8+
9+
/**
10+
* Sign of transaction amount needs to be flipped for Cetelem Black credit cards
11+
*/
12+
normalizeTransaction(transaction, booked) {
13+
const editedTrans = { ...transaction };
14+
15+
transaction.transactionAmount = {
16+
// Flip transaction amount sign
17+
...transaction.transactionAmount,
18+
amount: (-parseFloat(transaction.transactionAmount.amount)).toString(),
19+
};
20+
21+
return Fallback.normalizeTransaction(transaction, booked, editedTrans);
22+
},
23+
};

upcoming-release-notes/5914.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: Enhancements
3+
authors: [andreparames]
4+
---
5+
6+
fix Cetelem bank transactions: Sign of transaction amount needs to be flipped for Cetelem Black credit cards

0 commit comments

Comments
 (0)