Skip to content

Commit

Permalink
Add fallback value for payeename: 'undefined' - CBC Bank (actualbudge…
Browse files Browse the repository at this point in the history
…t#4384)

* Add fallback value for payename: 'undefined'

* docs: add release note

* Add fallback value for payename: 'undefined' (for negative amounts)
  • Loading branch information
MMichotte authored and lelemm committed Feb 18, 2025
1 parent 9ae39bf commit 5b04cc3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/sync-server/src/app-gocardless/banks/cbc_cregbebb.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ export default {

if (Number(transaction.transactionAmount.amount) > 0) {
editedTrans.payeeName =
transaction.debtorName || transaction.remittanceInformationUnstructured;
transaction.debtorName ||
transaction.remittanceInformationUnstructured ||
'undefined';
} else {
editedTrans.payeeName =
transaction.creditorName ||
extractPayeeNameFromRemittanceInfo(
transaction.remittanceInformationUnstructured,
['Paiement', 'Domiciliation', 'Transfert', 'Ordre permanent'],
);
) ||
'undefined';
}

return Fallback.normalizeTransaction(transaction, booked, editedTrans);
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/4384.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [MMichotte]
---

Provides a default fallback payeename value ('undefined') for the CBC bank in case the payeename is missing.

0 comments on commit 5b04cc3

Please sign in to comment.