Fix some bugs related to cash accounts.

This commit is contained in:
James Cole
2016-11-19 12:57:35 +01:00
parent 781621960d
commit ee6b72afa5
6 changed files with 62 additions and 47 deletions

View File

@@ -119,6 +119,20 @@ class Account extends Model
return $this->belongsTo('FireflyIII\Models\AccountType');
}
/**
* @return string
*/
public function getEditNameAttribute(): string
{
$name = $this->name;
if ($this->accountType->type === AccountType::CASH) {
return '';
}
return $name;
}
/**
* FIxxME can return null
*
@@ -229,20 +243,6 @@ class Account extends Model
return $journal->date;
}
/**
* @return string
*/
public function nameForEdit(): string
{
$name = $this->name;
if ($this->accountType->type === AccountType::CASH) {
return '';
}
return $name;
}
/**
* @return HasMany
*/