Lots of new tests.

This commit is contained in:
James Cole
2015-04-07 10:14:10 +02:00
parent b2674971f1
commit 701efb943d
9 changed files with 355 additions and 86 deletions

View File

@@ -55,6 +55,19 @@ class TransactionJournal extends Model
return $this->belongsToMany('FireflyIII\Models\Category');
}
/**
* @return float
*/
public function getAmountAttribute()
{
/** @var Transaction $t */
foreach ($this->transactions as $t) {
if ($t->amount > 0) {
return floatval($t->amount);
}
}
}
/**
* @return array
*/