From 02cfdf90eb32518ac4897ca30396a10d5073b596 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 22 Sep 2016 10:24:55 +0300 Subject: [PATCH] Improve expense display name --- app/Models/Expense.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Models/Expense.php b/app/Models/Expense.php index f5cb229fea24..3fe5e1b071bc 100644 --- a/app/Models/Expense.php +++ b/app/Models/Expense.php @@ -107,7 +107,13 @@ class Expense extends EntityModel */ public function getName() { - return $this->transaction_id ?: '#' . $this->public_id; + if ($this->transaction_id) { + return $this->transaction_id; + } elseif ($this->public_notes) { + return mb_strimwidth($this->public_notes, 0, 16, "..."); + } else { + return '#' . $this->public_id; + } } /**