mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 10:33:30 +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 $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
|
* @return float
|
||||||
*/
|
*/
|
||||||
@@ -88,6 +104,7 @@ class TransactionJournal extends Model
|
|||||||
foreach ($others as $other) {
|
foreach ($others as $other) {
|
||||||
$amount -= $other->amount;
|
$amount -= $other->amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $amount;
|
return $amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@
|
|||||||
{% if not hideTags %}
|
{% if not hideTags %}
|
||||||
{{ relevantTags(journal)|raw }}
|
{{ relevantTags(journal)|raw }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ journal|formatJournal }}
|
{{ journal.actualAmount|formatAmount }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
Reference in New Issue
Block a user