diff --git a/app/controllers/PiggybankController.php b/app/controllers/PiggybankController.php index 8b94de89a7..ce8ba6b2d5 100644 --- a/app/controllers/PiggybankController.php +++ b/app/controllers/PiggybankController.php @@ -56,8 +56,8 @@ class PiggybankController extends BaseController $accounts = $toolkit->makeSelectList($acct->getAssetAccounts()); return View::make('piggybanks.create', compact('accounts', 'periods'))->with('title', 'Piggy banks')->with('mainTitleIcon', 'fa-sort-amount-asc')->with( - 'subTitle', 'Create new piggy bank' - )->with('subTitleIcon', 'fa-plus'); + 'subTitle', 'Create new piggy bank' + )->with('subTitleIcon', 'fa-plus'); } /** @@ -68,8 +68,8 @@ class PiggybankController extends BaseController public function delete(Piggybank $piggybank) { return View::make('piggybanks.delete')->with('piggybank', $piggybank)->with('subTitle', 'Delete "' . $piggybank->name . '"')->with( - 'title', 'Piggy banks' - )->with('mainTitleIcon', 'fa-sort-amount-asc'); + 'title', 'Piggy banks' + )->with('mainTitleIcon', 'fa-sort-amount-asc'); } /** @@ -212,9 +212,12 @@ class PiggybankController extends BaseController return View::make('piggybanks.remove', compact('piggybank')); } - public function show(Piggybank $piggyBank) + public function show(Piggybank $piggybank) { - throw new NotImplementedException; + + return View::make('piggybanks.show', compact('piggybank'))->with('title', 'Piggy banks')->with('mainTitleIcon', 'fa-sort-amount-asc')->with( + 'subTitle', $piggybank->name + ); } diff --git a/app/views/piggybanks/create-piggybank.blade.old.php b/app/views/piggybanks/create-piggybank.blade.old.php deleted file mode 100644 index 5fb1eb65d4..0000000000 --- a/app/views/piggybanks/create-piggybank.blade.old.php +++ /dev/null @@ -1,123 +0,0 @@ -@extends('layouts.default') -@section('content') -
Use piggy banks to save for a one-time goal.
-{{$errors->first('name')}}
- @else - For example: new bike, new camera - @endif -{{$errors->first('account_id')}}
- @else - Indicate on which account you've got your savings. - @endif -{{$errors->first('targetamount')}}
- @else - How much money do you need to save? - @endif -{{$errors->first('startdate')}}
- @else - This date indicates when you start(ed) saving money for this piggy bank. This field defaults to today and you should keep it on today. - @endif -{{$errors->first('targetdate')}}
- @else - If this piggy bank has a dead line, enter it here. - @endif -{{$errors->first('reminder')}}
- @else - Enter a number and a period and Firefly will remind you to add money - to this piggy bank every now and then. - @endif -Create repeated expenses to keep track of long-term planned expenses
-{{$errors->first('name')}}
- @else - For example: new bike, new camera - @endif -{{$errors->first('account_id')}}
- @else - Indicate on which account you've got your savings. - @endif -{{$errors->first('targetamount')}}
- @else - How much money do you need to save? - @endif -{{$errors->first('targetdate')}}
- @else - A deadline is needed to properly repeat this repeated expesnse. - @endif -{{$errors->first('rep_length')}}
- @else - Something about every X years bla bla bla. - @endif -{{$errors->first('startdate')}}
- @else - This date indicates when you start(ed) saving money for this piggy bank. This field defaults to today and you should keep it on today. - @endif -{{$errors->first('reminder')}}
- @else - Enter a number and a period and Firefly will remind you to save money - for this repeated expense every now and then. - @endif -Remember that deleting something is permanent.
- -Use piggy banks to save for a one-time goal.
-{{$errors->first('name')}}
- @else - For example: new bike, new camera - @endif -{{$errors->first('account_id')}}
- @else - Indicate on which account you've got your savings. - @endif -{{$errors->first('targetamount')}}
- @else - How much money do you need to save? - @endif -{{$errors->first('startdate')}}
- @else - This date indicates when you start(ed) saving money for this piggy bank. This field defaults to today and you should keep it on today. - @endif -{{$errors->first('targetdate')}}
- @else - If this piggy bank has a dead line, enter it here. - @endif -{{$errors->first('reminder')}}
- @else - Enter a number and a period and Firefly will remind you to add money - to this piggy bank every now and then. - @endif -Create repeated expenses to keep track of long-term planned expenses
-{{$errors->first('name')}}
- @else - For example: new bike, new camera - @endif -{{$errors->first('account_id')}}
- @else - Indicate on which account you've got your savings. - @endif -{{$errors->first('targetamount')}}
- @else - How much money do you need to save? - @endif -{{$errors->first('targetdate')}}
- @else - A deadline is needed to properly repeat this repeated expesnse. - @endif -{{$errors->first('rep_length')}}
- @else - Something about every X years bla bla bla. - @endif -{{$errors->first('startdate')}}
- @else - This date indicates when you start(ed) saving money for this piggy bank. This field defaults to today and you should keep it on today. - @endif -{{$errors->first('reminder')}}
- @else - Enter a number and a period and Firefly will remind you to save money - for this repeated expense every now and then. - @endif -
- {{mf($piggyBank->currentRelevantRep()->currentamount)}} of {{mf($piggyBank->targetamount)}}
- @if($piggyBank->targetamount-$piggyBank->currentRelevantRep()->currentamount > 0)
- {{mf($piggyBank->targetamount-$piggyBank->currentRelevantRep()->currentamount)}} to go.
- @endif
-
No piggy banks found.
- @else - @foreach($piggybanks as $piggyBank) - @if($piggyBank->repeats == 0) - -| {{mf($piggyBank->currentRelevantRep()->currentamount)}} | -
-
-
-
- |
- {{mf($piggyBank->targetamount)}} | -|
| - | -
-
- @if($accounts[$piggyBank->account_id]['account']->leftOnAccount > 0)
- Add money
- @endif
- @if($piggyBank->currentRelevantRep()->currentamount > 0)
- Remove money
- @endif
-
- |
-
-
- @if(!is_null($piggyBank->targetdate))
- Target date: {{$piggyBank->targetdate->format('M jS, Y')}} |
- - - | -
No repeated expenses found.
- @else - @foreach($piggybanks as $repeated) - @if($repeated->repeats == 1) -| {{mf($repeated->currentRelevantRep()->currentamount)}} | -
-
-
-
- |
- {{mf($repeated->targetamount)}} | -|
| - | -
-
- @if($accounts[$repeated->account_id]['account']->leftOnAccount > 0)
- Add money
- @endif
- @if($repeated->currentRelevantRep()->currentamount > 0)
- Remove money
- @endif
-
-
- |
- - - @if(!is_null($repeated->reminder)) - - Next reminder: TODO - - @endif - - | -- - | -
| Account | -Left for piggy banks | -Total planned savings | -Saved so far | -Left to save | -
|---|---|---|---|---|
| {{{$account['account']->name}}} | -{{mf($account['left'])}} | -{{mf($account['tosave'])}} | -{{mf($account['saved'])}} | -{{mf($account['tosave']-$account['saved'])}} | -
| Field | -Value | -
|---|---|
| Account | -{{{$piggyBank->account->name}}} | -
| Target amount | -{{mf($piggyBank->targetamount)}} | -
| Start date | -- @if(is_null($piggyBank->startdate)) - No start date - @else - {{$piggyBank->startdate->format('jS F Y')}} - @endif - | -
| Target date | -- @if(is_null($piggyBank->targetdate)) - No target date - @else - {{$piggyBank->targetdate->format('jS F Y')}} - @endif - | -
| Repeats every | -- @if(!is_null($piggyBank->rep_length)) - Every {{$piggyBank->rep_every}} {{$piggyBank->rep_length}}(s) - @if(!is_null($piggyBank->rep_times)) - ({{$piggyBank->rep_times}} times) - @else - (indefinitely) - @endif - @else - Does not repeat - @endif - | -
| Reminder | -- @if(is_null($piggyBank->reminder)) - (no reminder) - @else - Every {{$piggyBank->reminder_skip}} {{$piggyBank->reminder}}(s) - @endif - | -
| Field | -Value | -
|---|---|
| ID | -#{{$rep->id}} | -
| Current amount | -{{mf($rep->currentamount)}} of {{mf($piggyBank->targetamount)}} | -
| Start date | -- @if(is_null($rep->startdate)) - No start date - @else - {{$rep->startdate->format('jS F Y')}} - @endif - | -
| Target date | -- @if(is_null($rep->targetdate)) - No target date - @else - {{$rep->targetdate->format('jS F Y')}} - @endif - | -
| Account | +{{{$piggybank->account->name}}} | +
| Target amount | +{{mf($piggybank->targetamount)}} | +
| Saved so far | +{{mf(0)}} | +
| Left to save | +{{mf(0)}} | +
| Start date | ++ @if(is_null($piggybank->startdate)) + No start date + @else + {{$piggybank->startdate->format('jS F Y')}} + @endif + | +
| Target date | ++ @if(is_null($piggybank->targetdate)) + No target date + @else + {{$piggybank->targetdate->format('jS F Y')}} + @endif + | +
| Reminder | ++ @if(intval($piggybank->remind_me) == 0) + (no reminder) + @else + Every + @if($piggybank->reminder_skip != 0) + {{$piggybank->reminder_skip}} + @endif + {{$piggybank->reminder}}(s) + @endif + | +
| Reminders left | +12 | +
| Expected amount per reminder | +{{mf(0)}} | +
| Field | +Value | +
|---|---|
| Account | +{{{$piggybank->account->name}}} | +
| Target amount | +{{mf($piggybank->targetamount)}} | +
| Start date | ++ @if(is_null($piggybank->startdate)) + No start date + @else + {{$piggybank->startdate->format('jS F Y')}} + @endif + | +
| Target date | ++ @if(is_null($piggybank->targetdate)) + No target date + @else + {{$piggybank->targetdate->format('jS F Y')}} + @endif + | +
| Repeats every | ++ @if(!is_null($piggybank->rep_length)) + Every {{$piggybank->rep_every}} {{$piggybank->rep_length}}(s) + @if(!is_null($piggybank->rep_times)) + ({{$piggybank->rep_times}} times) + @else + (indefinitely) + @endif + @else + Does not repeat + @endif + | +
| Reminder | ++ @if(is_null($piggybank->reminder)) + (no reminder) + @else + Every {{$piggybank->reminder_skip}} {{$piggybank->reminder}}(s) + @endif + | +
| Field | +Value | +
|---|---|
| ID | +#{{$rep->id}} | +
| Current amount | +{{mf($rep->currentamount)}} of {{mf($piggybank->targetamount)}} | +
| Start date | ++ @if(is_null($rep->startdate)) + No start date + @else + {{$rep->startdate->format('jS F Y')}} + @endif + | +
| Target date | ++ @if(is_null($rep->targetdate)) + No target date + @else + {{$rep->targetdate->format('jS F Y')}} + @endif + | +