Removed "amount" attribute. This breaks half of Firefly III.

This commit is contained in:
James Cole 2016-03-02 11:52:52 +01:00
parent bf4a7846dd
commit fa47eac9ff

View File

@ -97,30 +97,6 @@ class TransactionJournal extends Model
return $this->belongsToMany('FireflyIII\Models\Category');
}
/**
* @return float
*/
public function getAmountAttribute()
{
$cache = new CacheProperties();
$cache->addProperty($this->id);
$cache->addProperty('amount');
if ($cache->has()) {
return $cache->get(); // @codeCoverageIgnore
}
bcscale(2);
$transaction = $this->transactions->sortByDesc('amount')->first();
$amount = $transaction->amount;
if ($this->isWithdrawal()) {
$amount = bcmul($amount, '-1');
}
$cache->store($amount);
return $amount;
}
/**
* @return string
*/