Simplified (or tried to) some code. [skip ci]

This commit is contained in:
James Cole
2015-06-07 09:09:27 +02:00
parent 583d4f3249
commit e95273b72b
8 changed files with 108 additions and 65 deletions

View File

@@ -187,23 +187,26 @@ class Journal extends Twig_Extension
return $string;
}
if ($tag->tagMode == 'advancePayment' && $journal->transactionType->type == 'Deposit') {
$amount = App::make('amount')->formatJournal($journal, false);
$string = '<a href="' . route('tags.show', [$tag->id]) . '" class="label label-success" title="' . $amount
. '"><i class="fa fa-fw fa-sort-numeric-desc"></i> ' . $tag->tag . '</a>';
if ($tag->tagMode == 'advancePayment') {
if ($journal->transactionType->type == 'Deposit') {
$amount = App::make('amount')->formatJournal($journal, false);
$string = '<a href="' . route('tags.show', [$tag->id]) . '" class="label label-success" title="' . $amount
. '"><i class="fa fa-fw fa-sort-numeric-desc"></i> ' . $tag->tag . '</a>';
return $string;
}
/*
* AdvancePayment with a withdrawal will show the amount with a link to
* the tag. The TransactionJournal should properly calculate the amount.
*/
if ($tag->tagMode == 'advancePayment' && $journal->transactionType->type == 'Withdrawal') {
$amount = App::make('amount')->formatJournal($journal);
return $string;
}
$string = '<a href="' . route('tags.show', [$tag->id]) . '">' . $amount . '</a>';
/*
* AdvancePayment with a withdrawal will show the amount with a link to
* the tag. The TransactionJournal should properly calculate the amount.
*/
if ($journal->transactionType->type == 'Withdrawal') {
$amount = App::make('amount')->formatJournal($journal);
return $string;
$string = '<a href="' . route('tags.show', [$tag->id]) . '">' . $amount . '</a>';
return $string;
}
}