Skip to content

A local-first personal finance app

fix payee name selection based on the amount (#427)

Matt Fiddaman8201085ccb19
diff --git a/src/util/payee-name.js b/src/util/payee-name.js
index 332fa46692..2a50e37b0b 100644
--- a/src/util/payee-name.js
+++ b/src/util/payee-name.js
@@ -5,12 +5,13 @@ function formatPayeeIban(iban) {
}
export const formatPayeeName = (trans) => {
+ const amount = trans.transactionAmount.amount;
const nameParts = [];
// get the correct name and account fields for the transaction amount
let name;
let account;
- if (trans.amount > 0 || Object.is(Number(trans.amount), 0)) {
+ if (amount > 0 || Object.is(Number(amount), 0)) {
name = trans.debtorName;
account = trans.debtorAccount;
} else {
diff --git a/upcoming-release-notes/427.md b/upcoming-release-notes/427.md
new file mode 100644
index 0000000000..399f2a19be
--- /dev/null
+++ b/upcoming-release-notes/427.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [matt-fidd]
+---
+
+Fix payee name selection based on the transaction amount