mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Lots of new tests.
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user