mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix amount in tag list [skip ci]
This commit is contained in:
parent
72dd064932
commit
b935e32340
@ -219,6 +219,22 @@ class TransactionJournal extends Model
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCorrectAmountAttribute()
|
||||
{
|
||||
|
||||
switch ($this->transactionType->type) {
|
||||
case 'Deposit':
|
||||
return $this->transactions()->where('amount', '>', 0)->first()->amount;
|
||||
case 'Withdrawal':
|
||||
return $this->transactions()->where('amount', '<', 0)->first()->amount;
|
||||
}
|
||||
|
||||
return '0';
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
|
@ -57,7 +57,7 @@
|
||||
{% if not hideTags %}
|
||||
{{ relevantTags(journal)|raw }}
|
||||
{% else %}
|
||||
{{ journal.correctedActualAmount|formatAmount }}
|
||||
{{ journal.correctAmount|formatAmount }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
|
Loading…
Reference in New Issue
Block a user