Improve expense display name

This commit is contained in:
Hillel Coren 2016-09-22 10:24:55 +03:00
parent f49baa3e38
commit 02cfdf90eb

View File

@ -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;
}
}
/**