From fa47eac9ff766d76f7f738bd5acdb1ee6df99ace Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 2 Mar 2016 11:52:52 +0100 Subject: [PATCH] Removed "amount" attribute. This breaks half of Firefly III. --- app/Models/TransactionJournal.php | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index f85a63d043..5f8c9a6387 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -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 */