This commit is contained in:
James Cole
2018-04-08 16:27:52 +02:00
parent 7583698ee5
commit 8f0e36a8e4
18 changed files with 377 additions and 165 deletions

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Models;
use Crypt;
use FireflyIII\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
@@ -57,7 +58,7 @@ class Bill extends Model
*/
protected $fillable
= ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip',
'automatch', 'active','currency_id'];
'automatch', 'active', 'transaction_currency_id'];
/**
* @var array
*/
@@ -179,13 +180,22 @@ class Bill extends Model
$this->attributes['name_encrypted'] = $encrypt;
}
/**
* @codeCoverageIgnore
* @return BelongsTo
*/
public function transactionCurrency(): BelongsTo
{
return $this->belongsTo(TransactionCurrency::class);
}
/**
* @codeCoverageIgnore
* @return HasMany
*/
public function transactionJournals(): HasMany
{
return $this->hasMany('FireflyIII\Models\TransactionJournal');
return $this->hasMany(TransactionJournal::class);
}
/**
@@ -194,6 +204,6 @@ class Bill extends Model
*/
public function user(): BelongsTo
{
return $this->belongsTo('FireflyIII\User');
return $this->belongsTo(User::class);
}
}