From d643e05c5a63ffa7c398f143af1df0fb221bb1ec Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 2 May 2015 22:05:18 +0200 Subject: [PATCH] Basic amount format fix. --- app/Support/Twig/Journal.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/Support/Twig/Journal.php b/app/Support/Twig/Journal.php index 2b1be12e9f..80cc28d0d3 100644 --- a/app/Support/Twig/Journal.php +++ b/app/Support/Twig/Journal.php @@ -7,7 +7,7 @@ use FireflyIII\Models\TransactionJournal; use Twig_Extension; use Twig_SimpleFilter; use Twig_SimpleFunction; - +use App; /** * Class Journal * @@ -16,6 +16,9 @@ use Twig_SimpleFunction; class Journal extends Twig_Extension { + /** + * @return array + */ public function getFilters() { $filters = []; @@ -43,6 +46,9 @@ class Journal extends Twig_Extension return $filters; } + /** + * @return array + */ public function getFunctions() { $functions = []; @@ -59,7 +65,10 @@ class Journal extends Twig_Extension $functions[] = new Twig_SimpleFunction( 'relevantTags', function (TransactionJournal $journal) { - return 'TODO'.$journal->amount; + if($journal->tags->count() == 0) { + return App::make('amount')->formatJournal($journal); + } + return 'TODO: '.$journal->amount; } );