mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Show tag amount better [skip ci]
This commit is contained in:
@@ -59,6 +59,22 @@ class TransactionJournal extends Model
|
||||
return $this->belongsToMany('FireflyIII\Models\Category');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getActualAmountAttribute()
|
||||
{
|
||||
$amount = 0;
|
||||
/** @var Transaction $t */
|
||||
foreach ($this->transactions as $t) {
|
||||
if ($t->amount > 0) {
|
||||
$amount = floatval($t->amount);
|
||||
}
|
||||
}
|
||||
|
||||
return $amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
@@ -88,6 +104,7 @@ class TransactionJournal extends Model
|
||||
foreach ($others as $other) {
|
||||
$amount -= $other->amount;
|
||||
}
|
||||
|
||||
return $amount;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user