Did some cleanup [skip ci]

This commit is contained in:
James Cole
2015-05-26 19:48:49 +02:00
parent 7dfde51b84
commit 2738ac5a5c
6 changed files with 3 additions and 11 deletions

View File

@@ -114,7 +114,7 @@ Breadcrumbs::register(
$breadcrumbs->push(e($budget->name), route('budgets.show', $budget->id)); $breadcrumbs->push(e($budget->name), route('budgets.show', $budget->id));
if (!is_null($repetition) && !is_null($repetition->id)) { if (!is_null($repetition) && !is_null($repetition->id)) {
$breadcrumbs->push( $breadcrumbs->push(
Navigation::periodShow($repetition->startdate, $repetition->budgetlimit->repeat_freq), route('budgets.show', $budget->id, $repetition->id) Navigation::periodShow($repetition->startdate, $repetition->budgetLimit->repeat_freq), route('budgets.show', $budget->id, $repetition->id)
); );
} }
} }

View File

@@ -204,7 +204,6 @@ class TransactionJournal extends Model
switch ($this->transactionType->type) { switch ($this->transactionType->type) {
case 'Deposit': case 'Deposit':
return $this->transactions()->where('amount', '>', 0)->first()->account; return $this->transactions()->where('amount', '>', 0)->first()->account;
break;
case 'Withdrawal': case 'Withdrawal':
return $this->transactions()->where('amount', '<', 0)->first()->account; return $this->transactions()->where('amount', '<', 0)->first()->account;
@@ -275,7 +274,6 @@ class TransactionJournal extends Model
switch ($this->transactionType->type) { switch ($this->transactionType->type) {
case 'Deposit': case 'Deposit':
return $this->transactions()->where('amount', '<', 0)->first()->account; return $this->transactions()->where('amount', '<', 0)->first()->account;
break;
case 'Withdrawal': case 'Withdrawal':
return $this->transactions()->where('amount', '>', 0)->first()->account; return $this->transactions()->where('amount', '>', 0)->first()->account;

View File

@@ -43,13 +43,10 @@ class TagRepository implements TagRepositoryInterface
$journal->tags()->save($tag); $journal->tags()->save($tag);
return true; return true;
break;
case 'balancingAct': case 'balancingAct':
return $this->connectBalancingAct($journal, $tag); return $this->connectBalancingAct($journal, $tag);
break;
case 'advancePayment': case 'advancePayment':
return $this->connectAdvancePayment($journal, $tag); return $this->connectAdvancePayment($journal, $tag);
break;
} }
return false; return false;

View File

@@ -19,6 +19,7 @@ class Budget extends Twig_Extension
*/ */
public function getFunctions() public function getFunctions()
{ {
$functions = [];
$functions[] = new Twig_SimpleFunction( $functions[] = new Twig_SimpleFunction(
'spentInRepetitionCorrected', function (LimitRepetition $repetition) { 'spentInRepetitionCorrected', function (LimitRepetition $repetition) {
$sum $sum

View File

@@ -32,19 +32,14 @@ class Journal extends Twig_Extension
switch ($type) { switch ($type) {
case 'Withdrawal': case 'Withdrawal':
return '<span class="glyphicon glyphicon-arrow-left" title="' . trans('firefly.withdrawal') . '"></span>'; return '<span class="glyphicon glyphicon-arrow-left" title="' . trans('firefly.withdrawal') . '"></span>';
break;
case 'Deposit': case 'Deposit':
return '<span class="glyphicon glyphicon-arrow-right" title="' . trans('firefly.deposit') . '"></span>'; return '<span class="glyphicon glyphicon-arrow-right" title="' . trans('firefly.deposit') . '"></span>';
break;
case 'Transfer': case 'Transfer':
return '<i class="fa fa-fw fa-exchange" title="' . trans('firefly.transfer') . '"></i>'; return '<i class="fa fa-fw fa-exchange" title="' . trans('firefly.transfer') . '"></i>';
break;
case 'Opening balance': case 'Opening balance':
return '<span class="glyphicon glyphicon-ban-circle" title="' . trans('firefly.openingBalance') . '"></span>'; return '<span class="glyphicon glyphicon-ban-circle" title="' . trans('firefly.openingBalance') . '"></span>';
break;
default: default:
return ''; return '';
break;
} }

View File

@@ -133,6 +133,7 @@ class FireflyValidator extends Validator
try { try {
$value = Crypt::decrypt($value); $value = Crypt::decrypt($value);
} catch (DecryptException $e) { } catch (DecryptException $e) {
// if it fails, probably not encrypted.
} }