Currencies can now be enabled and disabled.

This commit is contained in:
James Cole
2018-11-10 10:04:46 +01:00
parent daa8aa5c9d
commit e491dda229
25 changed files with 457 additions and 51 deletions

View File

@@ -35,6 +35,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @property int $decimal_places
* @property int $id
* @property string name
* @property bool $enabled
*
*/
class TransactionCurrency extends Model
@@ -52,9 +53,10 @@ class TransactionCurrency extends Model
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'decimal_places' => 'int',
'enabled' => 'bool',
];
/** @var array Fields that can be filled */
protected $fillable = ['name', 'code', 'symbol', 'decimal_places'];
protected $fillable = ['name', 'code', 'symbol', 'decimal_places', 'enabled'];
/**
* Route binder. Converts the key in the URL to the specified object (or throw 404).
@@ -84,4 +86,13 @@ class TransactionCurrency extends Model
{
return $this->hasMany(TransactionJournal::class);
}
/**
* @codeCoverageIgnore
* @return HasMany
*/
public function transactions(): HasMany
{
return $this->hasMany(Transaction::class);
}
}