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.

-
- - -{{Form::open(['class' => 'form-horizontal','url' => route('piggybanks.store.piggybank')])}} - -
-
-

Mandatory fields

- -
- -
- - @if($errors->has('name')) -

{{$errors->first('name')}}

- @else - For example: new bike, new camera - @endif -
-
- -
- -
- {{Form::select('account_id',$accounts,Input::old('account_id') ?: Input::get('account_id'),['class' => 'form-control'])}} - @if($errors->has('account_id')) -

{{$errors->first('account_id')}}

- @else - Indicate on which account you've got your savings. - @endif -
-
- -
- {{ Form::label('targetamount', 'Target amount', ['class' => 'col-sm-4 control-label'])}} -
-
- - {{Form::input('number','targetamount', Input::old('targetamount'), ['step' => 'any', 'min' => '1', 'class' => 'form-control'])}} -
- - @if($errors->has('targetamount')) -

{{$errors->first('targetamount')}}

- @else - How much money do you need to save? - @endif -
-
-
-
-

Optional fields

- - -
- {{ Form::label('startdate', 'Start date', ['class' => 'col-sm-4 control-label'])}} -
- - @if($errors->has('startdate')) -

{{$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 -
-
- -
- {{ Form::label('targetdate', 'Target date', ['class' => 'col-sm-4 control-label'])}} -
- - @if($errors->has('targetdate')) -

{{$errors->first('targetdate')}}

- @else - If this piggy bank has a dead line, enter it here. - @endif -
-
- -
- {{ Form::label('reminder', 'Remind you every', ['class' => 'col-sm-4 control-label'])}} -
- - - - @if($errors->has('reminder')) -

{{$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 -
-
- - -
-
- -
-
- -
-
- -
-
-
-
- -{{Form::close()}} -@stop diff --git a/app/views/piggybanks/create-repeated.blade.old.php b/app/views/piggybanks/create-repeated.blade.old.php deleted file mode 100644 index cd55d693a0..0000000000 --- a/app/views/piggybanks/create-repeated.blade.old.php +++ /dev/null @@ -1,166 +0,0 @@ -@extends('layouts.default') -@section('content') -
-
-

Create repeated expenses to keep track of long-term planned expenses

-
-
- -{{Form::open(['class' => 'form-horizontal','url' => route('piggybanks.store.repeated')])}} - -
-
-

Mandatory fields

- - -
- -
- - @if($errors->has('name')) -

{{$errors->first('name')}}

- @else - For example: new bike, new camera - @endif -
-
- -
- -
- {{Form::select('account_id',$accounts,Input::old('account_id') ?: Input::get('account_id'),['class' => 'form-control'])}} - @if($errors->has('account_id')) -

{{$errors->first('account_id')}}

- @else - Indicate on which account you've got your savings. - @endif -
-
- -
- {{ Form::label('targetamount', 'Target amount', ['class' => 'col-sm-4 control-label'])}} -
-
- - {{Form::input('number','targetamount', Input::old('targetamount'), ['step' => 'any', 'min' => '1', 'class' => 'form-control'])}} -
- - @if($errors->has('targetamount')) -

{{$errors->first('targetamount')}}

- @else - How much money do you need to save? - @endif -
-
- -
- {{ Form::label('targetdate', 'Target date', ['class' => 'col-sm-4 control-label'])}} -
- - @if($errors->has('targetdate')) -

{{$errors->first('targetdate')}}

- @else - A deadline is needed to properly repeat this repeated expesnse. - @endif -
-
- -
- {{ Form::label('rep_every', 'Repeat every', ['class' => 'col-sm-4 control-label'])}} -
- - - - @if($errors->has('rep_length')) -

{{$errors->first('rep_length')}}

- @else - Something about every X years bla bla bla. - @endif -
-
-
-
- -

Optional fields

- -
- {{ Form::label('startdate', 'Start date', ['class' => 'col-sm-4 control-label'])}} -
- - @if($errors->has('startdate')) -

{{$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 -
-
- -
- {{ Form::label('reminder', 'Remind you every', ['class' => 'col-sm-4 control-label'])}} -
- - - - @if($errors->has('reminder')) -

{{$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 -
-
- - - - - - -
-
- -
-
- -
-
- -
-
-
-
- -{{Form::close()}} -@stop diff --git a/app/views/piggybanks/delete.blade.old.php b/app/views/piggybanks/delete.blade.old.php deleted file mode 100644 index 4541ea09d7..0000000000 --- a/app/views/piggybanks/delete.blade.old.php +++ /dev/null @@ -1,42 +0,0 @@ -@extends('layouts.default') -@section('content') -
-
-

Remember that deleting something is permanent.

- -
- -
- -{{Form::open(['class' => 'form-horizontal','url' => route('piggybanks.destroy',$piggybank->id)])}} - -
-
-

 

-

- This form allows you to delete the piggy bank "{{{$piggybank->name}}}". -

-

- Destroying an envelope does not remove any transactions or accounts. -

-

- Are you sure? -

- -
-
- - @if($piggybank->repeats == 1) - Cancel - @else - Cancel - @endif -
-
-
-
- - -{{Form::close()}} - -@stop diff --git a/app/views/piggybanks/edit-piggybank.blade.old.php b/app/views/piggybanks/edit-piggybank.blade.old.php deleted file mode 100644 index ec572047a3..0000000000 --- a/app/views/piggybanks/edit-piggybank.blade.old.php +++ /dev/null @@ -1,137 +0,0 @@ -@extends('layouts.default') -@section('content') -
-
-

Use piggy banks to save for a one-time goal.

-
-
- -{{Form::open(['class' => 'form-horizontal','url' => route('piggybanks.update',$piggybank->id)])}} - -
-
-

Mandatory fields

- -
- -
- - @if($errors->has('name')) -

{{$errors->first('name')}}

- @else - For example: new bike, new camera - @endif -
-
- -
- -
- {{Form::select('account_id',$accounts,Input::old('account_id') ?: $piggybank->account_id,['class' => 'form-control'])}} - @if($errors->has('account_id')) -

{{$errors->first('account_id')}}

- @else - Indicate on which account you've got your savings. - @endif -
-
- -
- {{ Form::label('targetamount', 'Target amount', ['class' => 'col-sm-4 control-label'])}} -
-
- - {{Form::input('number','targetamount', Input::old('targetamount') ?: $piggybank->targetamount, ['step' => 'any', 'min' => '1', 'class' => 'form-control'])}} -
- - @if($errors->has('targetamount')) -

{{$errors->first('targetamount')}}

- @else - How much money do you need to save? - @endif -
-
-
-
-

Optional fields

- - -
- {{ Form::label('startdate', 'Start date', ['class' => 'col-sm-4 control-label'])}} -
- @if(is_null($piggybank->startdate)) - - @else - - @endif - @if($errors->has('startdate')) -

{{$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 -
-
- -
- {{ Form::label('targetdate', 'Target date', ['class' => 'col-sm-4 control-label'])}} -
- @if(is_null($piggybank->targetdate)) - - @else - - @endif - @if($errors->has('targetdate')) -

{{$errors->first('targetdate')}}

- @else - If this piggy bank has a dead line, enter it here. - @endif -
-
- -
- {{ Form::label('reminder', 'Remind you every', ['class' => 'col-sm-4 control-label'])}} -
- - - - @if($errors->has('reminder')) -

{{$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 -
-
- - -
-
- -
-
- -
-
- -
-
-
-
- -{{Form::close()}} -@stop diff --git a/app/views/piggybanks/edit-repeated.blade.old.php b/app/views/piggybanks/edit-repeated.blade.old.php deleted file mode 100644 index a16fe00add..0000000000 --- a/app/views/piggybanks/edit-repeated.blade.old.php +++ /dev/null @@ -1,160 +0,0 @@ -@extends('layouts.default') -@section('content') -
-
-

Create repeated expenses to keep track of long-term planned expenses

-
-
- -{{Form::open(['class' => 'form-horizontal','url' => route('piggybanks.update',$piggybank->id)])}} - -
-
-

Mandatory fields

- - -
- -
- - @if($errors->has('name')) -

{{$errors->first('name')}}

- @else - For example: new bike, new camera - @endif -
-
- -
- -
- {{Form::select('account_id',$accounts,Input::old('account_id') ?: $piggybank->account_id,['class' => 'form-control'])}} - @if($errors->has('account_id')) -

{{$errors->first('account_id')}}

- @else - Indicate on which account you've got your savings. - @endif -
-
- -
- {{ Form::label('targetamount', 'Target amount', ['class' => 'col-sm-4 control-label'])}} -
-
- - {{Form::input('number','targetamount', Input::old('targetamount') ?: $piggybank->targetamount, ['step' => 'any', 'min' => '1', 'class' => 'form-control'])}} -
- - @if($errors->has('targetamount')) -

{{$errors->first('targetamount')}}

- @else - How much money do you need to save? - @endif -
-
- -
- {{ Form::label('targetdate', 'Target date', ['class' => 'col-sm-4 control-label'])}} -
- @if(is_null($piggybank->targetdate)) - - @else - - @endif - @if($errors->has('targetdate')) -

{{$errors->first('targetdate')}}

- @else - A deadline is needed to properly repeat this repeated expesnse. - @endif -
-
- -
- {{ Form::label('rep_every', 'Repeat every', ['class' => 'col-sm-4 control-label'])}} -
- - - - @if($errors->has('rep_length')) -

{{$errors->first('rep_length')}}

- @else - Something about every X years bla bla bla. - @endif -
-
-
-
- -

Optional fields

-
- {{ Form::label('startdate', 'Start date', ['class' => 'col-sm-4 control-label'])}} -
- @if(is_null($piggybank->startdate)) - - @else - - @endif - @if($errors->has('startdate')) -

{{$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 -
-
-
- {{ Form::label('reminder', 'Remind you every', ['class' => 'col-sm-4 control-label'])}} -
- - - - @if($errors->has('reminder')) -

{{$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 -
-
- - - - -
-
- -
-
- -
-
- -
-
-
-
- -{{Form::close()}} -@stop diff --git a/app/views/piggybanks/index.blade.old.php b/app/views/piggybanks/index.blade.old.php deleted file mode 100644 index 981d7bc1a2..0000000000 --- a/app/views/piggybanks/index.blade.old.php +++ /dev/null @@ -1,223 +0,0 @@ -@extends('layouts.default') -@section('content') - -@if($countNonRepeating > 0) -
-@foreach($piggybanks as $piggyBank) - @if($piggyBank->repeats == 0) -
-
- -
-
-
-
-
-

- {{mf($piggyBank->currentRelevantRep()->currentamount)}} of {{mf($piggyBank->targetamount)}}
- @if($piggyBank->targetamount-$piggyBank->currentRelevantRep()->currentamount > 0) - {{mf($piggyBank->targetamount-$piggyBank->currentRelevantRep()->currentamount)}} to go. - @endif -

- -
- - - @if($accounts[$piggyBank->account_id]['account']->leftOnAccount > 0) - - @endif - @if($piggyBank->currentRelevantRep()->currentamount > 0) - - @endif -
- - -
-
-
- @endif -@endforeach -
-
-
-   -
- -
-
-
-@endif -{{-- - - -

Current piggy banks

- @if($countNonRepeating == 0) -

No piggy banks found.

- @else - @foreach($piggybanks as $piggyBank) - @if($piggyBank->repeats == 0) -

- - - - - - - - - - - - -
{{mf($piggyBank->currentRelevantRep()->currentamount)}} -
-
- {{$piggyBank->currentRelevantRep()->pct()}}% -
-
-
{{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')}}
- @endif - @if(!is_null($piggyBank->reminder)) - Next reminder: TODO - @endif -

- -
-
- - -
-
- @endif - @endforeach - @endif -
- -
-
-

Current repeated expenses

- @if($countRepeating == 0) -

No repeated expenses found.

- @else - @foreach($piggybanks as $repeated) - @if($repeated->repeats == 1) -

{{{$repeated->name}}}

- - - - - - - - - - - - - -
{{mf($repeated->currentRelevantRep()->currentamount)}} -
-
- {{$repeated->currentRelevantRep()->pct()}}% -
-
-
{{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 - - -
- - -
-
- @endif - @endforeach -@endif - -
-
- - - - - - - ---}} -
-
-

Account information

- - - - - - - - - @foreach($accounts as $account) - - - - - - - - @endforeach -
AccountLeft for piggy banksTotal planned savingsSaved so farLeft to save
{{{$account['account']->name}}}{{mf($account['left'])}}{{mf($account['tosave'])}}{{mf($account['saved'])}}{{mf($account['tosave']-$account['saved'])}}
-
-
- - - - - - -@stop diff --git a/app/views/piggybanks/index.blade.php b/app/views/piggybanks/index.blade.php index 4adaf1f253..9249569b32 100644 --- a/app/views/piggybanks/index.blade.php +++ b/app/views/piggybanks/index.blade.php @@ -5,7 +5,7 @@
diff --git a/app/views/piggybanks/modifyAmount.blade.old.php b/app/views/piggybanks/modifyAmount.blade.old.php deleted file mode 100644 index 6a4b5e4ca9..0000000000 --- a/app/views/piggybanks/modifyAmount.blade.old.php +++ /dev/null @@ -1,61 +0,0 @@ - -
- - {{Form::token()}} - - -
- diff --git a/app/views/piggybanks/show.blade.old.php b/app/views/piggybanks/show.blade.old.php deleted file mode 100644 index 1f5faf4aa9..0000000000 --- a/app/views/piggybanks/show.blade.old.php +++ /dev/null @@ -1,127 +0,0 @@ -@extends('layouts.default') -@section('content') -
-
-
- Edit - Delete - - @if(min(max($balance,$leftOnAccount),$piggyBank->targetamount) > 0) - Add money - @endif - - @if($piggyBank->currentRelevantRep()->currentamount > 0) - Remove money - @endif -
-
-
-
-
-

General information

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldValue
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 -
-
-
-

Piggy bank instances info

- @foreach($piggyBank->piggybankrepetitions()->orderBy('startdate')->get() as $rep) - - - - - - - - - - - - - - - - - - - - - -
FieldValue
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 -
- @endforeach -
-
- -@stop - -@section('scripts') -@stop \ No newline at end of file diff --git a/app/views/piggybanks/show.blade.php b/app/views/piggybanks/show.blade.php new file mode 100644 index 0000000000..4a6df0a352 --- /dev/null +++ b/app/views/piggybanks/show.blade.php @@ -0,0 +1,213 @@ +@extends('layouts.default') +@section('content') + +
+
+
+
+ Events +
+
+
+
+
+ +
+
+
+
+ Details +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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 left12
Expected amount per reminder{{mf(0)}}
+
+
+
+ +
+ +{{-- +
+
+
+ Edit + Delete + + @if(min(max($balance,$leftOnAccount),$piggybank->targetamount) > 0) + Add money + @endif + + @if($piggybank->currentRelevantRep()->currentamount > 0) + Remove money + @endif +
+
+
+
+
+

General information

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldValue
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 +
+
+
+

Piggy bank instances info

+ @foreach($piggybank->piggybankrepetitions()->orderBy('startdate')->get() as $rep) + + + + + + + + + + + + + + + + + + + + + +
FieldValue
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 +
+ @endforeach +
+
+--}} +@stop + +@section('scripts') +@stop