Show balance act tags.

This commit is contained in:
James Cole
2015-05-02 22:12:26 +02:00
parent 75f1e034ae
commit 97d3bd68ed

View File

@@ -3,11 +3,12 @@
namespace FireflyIII\Support\Twig;
use App;
use FireflyIII\Models\TransactionJournal;
use Twig_Extension;
use Twig_SimpleFilter;
use Twig_SimpleFunction;
use App;
/**
* Class Journal
*
@@ -68,6 +69,17 @@ class Journal extends Twig_Extension
if ($journal->tags->count() == 0) {
return App::make('amount')->formatJournal($journal);
}
foreach ($journal->tags as $tag) {
if ($tag->tagMode == 'balanceAct') {
// return tag formatted for a "balance act".
$amount = App::make('amount')->formatJournal($journal, false);
return '<a href="' . route('tags.show', $tag->id) . '" class="label label-success" title="' . $amount
. '"><i class="fa fa-fw fa-refresh"></i> ' . $tag->tag . '</span>';
}
}
return 'TODO: ' . $journal->amount;
}
);