🐛 (nordigen) fallback to array version of remittanceInformationUnstructured if necessary (#745)

Try falling back to `remittanceInformationUnstructuredArray.join(', ')`
when neither `debtor/creditorName` nor
`remittanceInformationUnstructured` fields are present.

Addresses a suggestion from
https://github.com/actualbudget/actual/issues/724#issuecomment-1464907064
This commit is contained in:
Jakub Kuczys
2023-03-12 22:07:26 +01:00
committed by GitHub
parent 0baccfd728
commit a5a1c81eaf

View File

@@ -319,7 +319,9 @@ async function normalizeNordigenTransactions(transactions, acctId) {
const nameParts = [];
nameParts.push(
title(
trans.debtorName || trans.remittanceInformationUnstructured || '',
trans.debtorName ||
trans.remittanceInformationUnstructured ||
(trans.remittanceInformationUnstructuredArray || []).join(', '),
),
);
if (trans.debtorAccount && trans.debtorAccount.iban) {
@@ -336,7 +338,9 @@ async function normalizeNordigenTransactions(transactions, acctId) {
const nameParts = [];
nameParts.push(
title(
trans.creditorName || trans.remittanceInformationUnstructured || '',
trans.creditorName ||
trans.remittanceInformationUnstructured ||
(trans.remittanceInformationUnstructuredArray || []).join(', '),
),
);
if (trans.creditorAccount && trans.creditorAccount.iban) {
@@ -369,7 +373,9 @@ async function normalizeNordigenTransactions(transactions, acctId) {
payee: trans.payee,
account: trans.account,
date: trans.date,
notes: trans.remittanceInformationUnstructured,
notes:
trans.remittanceInformationUnstructured ||
(trans.remittanceInformationUnstructuredArray || []).join(', '),
imported_id: trans.transactionId,
imported_payee: trans.imported_payee,
},