From 6832f2ebd0470eb30a8749223b90f6f35a26932e Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 15 Nov 2014 07:46:01 +0100 Subject: [PATCH] Lots of code cleanup. --- app/controllers/CategoryController.php | 44 ++++-- app/controllers/RecurringController.php | 12 +- app/lib/FireflyIII/Database/Category.php | 12 +- app/lib/FireflyIII/Shared/Toolkit/Date.php | 40 ++++++ app/models/Piggybank.php | 66 +++++---- app/models/RecurringTransaction.php | 82 +++++++---- app/models/Transaction.php | 23 --- app/views/categories/create.blade.php | 60 +++----- app/views/charts/info.blade.php | 12 -- app/views/emails/auth/reminder.blade.php | 15 -- app/views/layouts/guest.blade.php | 4 +- app/views/limits/create.blade.php | 98 ------------- app/views/limits/delete.blade.php | 62 -------- app/views/limits/edit.blade.php | 115 --------------- app/views/list/recurring.blade.php | 14 +- .../lists.old/journals-large.old.blade.php | 63 --------- .../journals-small-index.old.blade.php | 27 ---- .../journals-small-noaccount.old.blade.php | 33 ----- .../lists.old/transactions.old.blade.php | 120 ---------------- app/views/paginated/transactions.blade.php | 3 - app/views/piggybanks/show.blade.php | 133 +----------------- app/views/recurring/show.blade.php | 24 +++- app/views/search/index.blade.php | 2 +- 23 files changed, 245 insertions(+), 819 deletions(-) delete mode 100644 app/views/charts/info.blade.php delete mode 100644 app/views/emails/auth/reminder.blade.php delete mode 100644 app/views/limits/create.blade.php delete mode 100644 app/views/limits/delete.blade.php delete mode 100644 app/views/limits/edit.blade.php delete mode 100644 app/views/lists.old/journals-large.old.blade.php delete mode 100644 app/views/lists.old/journals-small-index.old.blade.php delete mode 100644 app/views/lists.old/journals-small-noaccount.old.blade.php delete mode 100644 app/views/lists.old/transactions.old.blade.php delete mode 100644 app/views/paginated/transactions.blade.php diff --git a/app/controllers/CategoryController.php b/app/controllers/CategoryController.php index cb9aa2c649..ec05e23798 100644 --- a/app/controllers/CategoryController.php +++ b/app/controllers/CategoryController.php @@ -93,19 +93,43 @@ class CategoryController extends BaseController */ public function store() { - $category = $this->_repository->store(Input::all()); - if ($category->validate()) { - Session::flash('success', 'Category "' . $category->name . '" created!'); + $data = Input::all(); + /** @var \FireflyIII\Database\Category $repos */ + $repos = App::make('FireflyIII\Database\Category'); - if (Input::get('create') == '1') { - return Redirect::route('categories.create'); - } + switch ($data['post_submit_action']) { + default: + throw new FireflyException('Cannot handle post_submit_action "' . e($data['post_submit_action']) . '"'); + break; + case 'create_another': + case 'store': + $messages = $repos->validate($data); + /** @var MessageBag $messages ['errors'] */ + if ($messages['errors']->count() > 0) { + Session::flash('warnings', $messages['warnings']); + Session::flash('successes', $messages['successes']); + Session::flash('error', 'Could not save category: ' . $messages['errors']->first()); - return Redirect::route('categories.index'); - } else { - Session::flash('error', 'Could not save the new category!'); + return Redirect::route('categories.create')->withInput()->withErrors($messages['errors']); + } + // store! + $repos->store($data); + Session::flash('success', 'New category stored!'); - return Redirect::route('categories.create')->withInput(); + if ($data['post_submit_action'] == 'create_another') { + return Redirect::route('categories.create')->withInput(); + } else { + return Redirect::route('categories.index'); + } + break; + case 'validate_only': + $messageBags = $repos->validate($data); + Session::flash('warnings', $messageBags['warnings']); + Session::flash('successes', $messageBags['successes']); + Session::flash('errors', $messageBags['errors']); + + return Redirect::route('categories.create')->withInput(); + break; } } diff --git a/app/controllers/RecurringController.php b/app/controllers/RecurringController.php index 8a6f66ba75..a4027bcb00 100644 --- a/app/controllers/RecurringController.php +++ b/app/controllers/RecurringController.php @@ -1,4 +1,5 @@ get(); - return View::make('recurring.index',compact('recurring')); + + return View::make('recurring.index', compact('recurring')); } /** @@ -116,9 +118,13 @@ class RecurringController extends BaseController */ public function show(RecurringTransaction $recurringTransaction) { - $journals = $recurringTransaction->transactionjournals()->withRelevantData()->orderBy('date','DESC')->get(); + $journals = $recurringTransaction->transactionjournals()->withRelevantData()->orderBy('date', 'DESC')->get(); $hideRecurring = true; - return View::make('recurring.show',compact('journals','hideRecurring'))->with('recurring', $recurringTransaction)->with('subTitle', $recurringTransaction->name); + + + return View::make('recurring.show', compact('journals', 'hideRecurring','finalDate'))->with('recurring', $recurringTransaction)->with( + 'subTitle', $recurringTransaction->name + ); } public function store() diff --git a/app/lib/FireflyIII/Database/Category.php b/app/lib/FireflyIII/Database/Category.php index 253dd3ab99..7056754dd8 100644 --- a/app/lib/FireflyIII/Database/Category.php +++ b/app/lib/FireflyIII/Database/Category.php @@ -46,8 +46,16 @@ class Category implements CUD, CommonDatabaseCalls, CategoryInterface */ public function store(array $data) { - // TODO: Implement store() method. - throw new NotImplementedException; + $category = new \Category; + $category->name = $data['name']; + $category->class = 'Category'; + $category->user()->associate($this->getUser()); + if(!$category->validate()) { + var_dump($category->errors()); + exit(); + } + $category->save(); + return $category; } /** diff --git a/app/lib/FireflyIII/Shared/Toolkit/Date.php b/app/lib/FireflyIII/Shared/Toolkit/Date.php index 352685dfca..194305a829 100644 --- a/app/lib/FireflyIII/Shared/Toolkit/Date.php +++ b/app/lib/FireflyIII/Shared/Toolkit/Date.php @@ -83,6 +83,7 @@ class Date $currentEnd->addYear()->subDay(); break; } + return $currentEnd; } /** @@ -124,4 +125,43 @@ class Date return $date; } + + /** + * @param Carbon $date + * @param $repeatFreq + * @param int $substract + * + * @return Carbon + * @throws FireflyException + */ + public function substractPeriod(Carbon $date, $repeatFreq, $substract = 1) + { + switch ($repeatFreq) { + default: + throw new FireflyException('Cannot do addPeriod for $repeat_freq ' . $repeatFreq); + break; + case 'daily': + $date->subDays($substract); + break; + case 'weekly': + $date->subWeeks($substract); + break; + case 'monthly': + $date->subMonths($substract); + break; + case 'quarterly': + $months = $substract * 3; + $date->subMonths($months); + break; + case 'half-year': + $months = $substract * 6; + $date->subMonths($months); + break; + case 'yearly': + $date->subYears($substract); + break; + } + + return $date; + } } \ No newline at end of file diff --git a/app/models/Piggybank.php b/app/models/Piggybank.php index 03ec278c47..890e1ea270 100644 --- a/app/models/Piggybank.php +++ b/app/models/Piggybank.php @@ -90,7 +90,15 @@ class Piggybank extends Ardent */ public function currentRelevantRep() { - $query = $this->piggybankrepetitions()->where( + if($this->currentRep) { + return $this->currentRep; + } + if ($this->repeats == 0) { + $rep = $this->piggybankrepetitions()->first(); + $this->currentRep = $rep; + return $rep; + } else { + $query = $this->piggybankrepetitions()->where( function ($q) { $q->where( @@ -100,12 +108,12 @@ class Piggybank extends Ardent $q->orWhere('startdate', '<=', $today->format('Y-m-d')); } )->where( - function ($q) { - $today = new Carbon; - $q->whereNull('targetdate'); - $q->orWhere('targetdate', '>=', $today->format('Y-m-d')); - } - ); + function ($q) { + $today = new Carbon; + $q->whereNull('targetdate'); + $q->orWhere('targetdate', '>=', $today->format('Y-m-d')); + } + ); } )->orWhere( function ($q) { @@ -114,9 +122,11 @@ class Piggybank extends Ardent $q->where('targetdate', '>=', $today->format('Y-m-d')); } )->orderBy('startdate', 'ASC'); - $result = $query->first(); + $result = $query->first(); + $this->currentRep = $result; - return $result; + return $result; + } } @@ -155,26 +165,26 @@ class Piggybank extends Ardent public function repetitionForDate(Carbon $date) { $query = $this->piggybankrepetitions()->where( - function ($q) use ($date) { + function ($q) use ($date) { - $q->where( - function ($q) use ($date) { - $q->whereNull('startdate'); - $q->orWhere('startdate', '<=', $date->format('Y-m-d')); - } - )->where( - function ($q) use ($date) { - $q->whereNull('targetdate'); - $q->orWhere('targetdate', '>=', $date->format('Y-m-d')); - } - ); - } - )->orWhere( - function ($q) use ($date) { - $q->where('startdate', '>=', $date->format('Y-m-d')); - $q->where('targetdate', '>=', $date->format('Y-m-d')); - } - )->orderBy('startdate', 'ASC'); + $q->where( + function ($q) use ($date) { + $q->whereNull('startdate'); + $q->orWhere('startdate', '<=', $date->format('Y-m-d')); + } + )->where( + function ($q) use ($date) { + $q->whereNull('targetdate'); + $q->orWhere('targetdate', '>=', $date->format('Y-m-d')); + } + ); + } + )->orWhere( + function ($q) use ($date) { + $q->where('startdate', '>=', $date->format('Y-m-d')); + $q->where('targetdate', '>=', $date->format('Y-m-d')); + } + )->orderBy('startdate', 'ASC'); $result = $query->first(); return $result; diff --git a/app/models/RecurringTransaction.php b/app/models/RecurringTransaction.php index 556535baec..56cd8d81c8 100644 --- a/app/models/RecurringTransaction.php +++ b/app/models/RecurringTransaction.php @@ -51,44 +51,66 @@ class RecurringTransaction extends Ardent return ['created_at', 'updated_at', 'date']; } + public function lastFoundMatch() { + $last = $this->transactionjournals()->orderBy('date','DESC')->first(); + if($last) { + return $last->date; + } + return null; + } /** - * @return Carbon + * Find the next expected match based on the set journals and the date stuff from the recurring + * transaction. */ - public function next() + public function nextExpectedMatch() { - $today = new Carbon; - $start = clone $this->date; - $skip = $this->skip == 0 ? 1 : $this->skip; - if ($today < $start) { - return $start; - } - while ($start <= $this->date) { - switch ($this->repeat_freq) { - case 'daily': - $start->addDays($skip); - break; - case 'weekly': - $start->addWeeks($skip); - break; - case 'monthly': - $start->addMonths($skip); - break; - case 'quarterly': - $start->addMonths($skip * 3); - break; - case 'half-year': - $start->addMonths($skip * 6); - break; - case 'yearly': - $start->addYears($skip); - break; + /** @var \FireflyIII\Shared\Toolkit\Date $dateKit */ + $dateKit = App::make('FireflyIII\Shared\Toolkit\Date'); + /* + * The date Firefly tries to find. If this stays null, it's "unknown". + */ + $finalDate = null; + + /* + * $today is the start of the next period, to make sure FF3 won't miss anything + * when the current period has a transaction journal. + */ + $today = $dateKit->addPeriod(new Carbon, $this->repeat_freq, 0); + + /* + * FF3 loops from the $start of the recurring transaction, and to make sure + * $skip works, it adds one (for modulo). + */ + $skip = $this->skip + 1; + $start = $dateKit->startOfPeriod(new Carbon, $this->repeat_freq); + /* + * go back exactly one month/week/etc because FF3 does not care about 'next' + * recurring transactions if they're too far into the past. + */ + // echo 'Repeat freq is: ' . $recurringTransaction->repeat_freq . '
'; + + // echo 'Start: ' . $start . '
'; + + $counter = 0; + while ($start <= $today) { + if (($counter % $skip) == 0) { + // do something. + $end = $dateKit->endOfPeriod(clone $start, $this->repeat_freq); + $journalCount = $this->transactionjournals()->before($end)->after($start)->count(); + if ($journalCount == 0) { + $finalDate = clone $start; + break; + } } - } - return $start; + // add period for next round! + $start = $dateKit->addPeriod($start, $this->repeat_freq, 0); + $counter++; + } + return $finalDate; } /** diff --git a/app/models/Transaction.php b/app/models/Transaction.php index a60d5535eb..6a85e97864 100644 --- a/app/models/Transaction.php +++ b/app/models/Transaction.php @@ -78,29 +78,6 @@ class Transaction extends Ardent return $this->belongsToMany('Component'); } - /** - * @param Piggybank $piggybank - * - * @return bool - */ - public function connectPiggybank(\Piggybank $piggybank = null) - { - // TODO connect a piggy bank to a transaction. - throw new NotImplementedException; - // if (is_null($piggybank)) { - // return true; - // } - // /** @var \Firefly\Storage\Piggybank\PiggybankRepositoryInterface $piggyRepository */ - // $piggyRepository = \App::make('Firefly\Storage\Piggybank\PiggybankRepositoryInterface'); - // if ($this->account_id == $piggybank->account_id) { - // $this->piggybank()->associate($piggybank); - // $this->save(); - // \Event::fire('piggybanks.createRelatedTransfer', [$piggybank, $this->transactionJournal, $this]); - // return true; - // } - // return false; - } - /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ diff --git a/app/views/categories/create.blade.php b/app/views/categories/create.blade.php index bf8c855596..77868e12f4 100644 --- a/app/views/categories/create.blade.php +++ b/app/views/categories/create.blade.php @@ -1,57 +1,37 @@ @extends('layouts.default') @section('content') -
-
-

Use categories to group your expenses

-

- Use categories to group expenses by hobby, for certain types of groceries or what bills are for. - Expenses grouped in categories do not have to reoccur every month or every week, like budgets. -

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

Mandatory fields

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

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

- @else - For example: bike, utilities, daily groceries - @endif +
+
+
+ Mandatory fields +
+
+ {{Form::ffText('name')}}
- +

+ +

-
-
-
+
- -
- -
-
- -
+ +
+
+ Options +
+
+ {{Form::ffOptionsList('create','category')}}
-
-
- -
-
diff --git a/app/views/charts/info.blade.php b/app/views/charts/info.blade.php deleted file mode 100644 index 00e590e129..0000000000 --- a/app/views/charts/info.blade.php +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - @foreach($rows as $name => $entry) - - - - - @endforeach -
Total{{mf($sum*-1)}}
{{{$name}}}{{mf($entry['amount']*-1)}}
\ No newline at end of file diff --git a/app/views/emails/auth/reminder.blade.php b/app/views/emails/auth/reminder.blade.php deleted file mode 100644 index 276f8c59f2..0000000000 --- a/app/views/emails/auth/reminder.blade.php +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -

Password Reset

- -
- To reset your password, complete this form: {{ URL::to('password/reset', array($token)) }}.
- This link will expire in {{ Config::get('auth.reminder.expire', 60) }} minutes. -
- - - \ No newline at end of file diff --git a/app/views/layouts/guest.blade.php b/app/views/layouts/guest.blade.php index df2a721548..8485ddaccb 100644 --- a/app/views/layouts/guest.blade.php +++ b/app/views/layouts/guest.blade.php @@ -5,7 +5,7 @@ - Firefly + Firefly III {{HTML::style('assets/stylesheets/bootstrap/bootstrap.min.css')}} {{HTML::style('assets/stylesheets/metisMenu/metisMenu.min.css')}} @@ -25,4 +25,4 @@ @yield('content')
- \ No newline at end of file + \ No newline at end of file diff --git a/app/views/limits/create.blade.php b/app/views/limits/create.blade.php deleted file mode 100644 index a3a13c4dcf..0000000000 --- a/app/views/limits/create.blade.php +++ /dev/null @@ -1,98 +0,0 @@ -@extends('layouts.default') -@section('content') -
-
-

- Firefly uses an "envelope - system" for your budgets, which means that for each period of time (for example a month) a virtual - "envelope" can be created containing a certain amount of money. Money spent within a budget is removed from - the envelope. -

- -

- Firefly gives you the opportunity to create such an envelope when you create a budget. However, you can - always add more of them. -

-
-
- -{{Form::open(['class' => 'form-horizontal','url' => route('budgets.limits.store',$prefilled['budget_id'])])}} -{{Form::hidden('from',e(Input::get('from')))}} - - -
-
-

Mandatory fields

- -
- {{ Form::label('budget_id', 'Budget', ['class' => 'col-sm-4 control-label'])}} -
- {{Form::select('budget_id',$budgets,Input::old('budget_id') ?: $prefilled['budget_id'], ['class' => - 'form-control'])}} - @if($errors->has('budget_id')) -

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

- @else - Select one of your existing budgets. - @endif -
-
- -
- {{ Form::label('startdate', 'Start date', ['class' => 'col-sm-4 control-label'])}} -
- - This date indicates when the envelope "starts". The date you select - here will correct itself to the nearest [period] you select below. -
-
- -
- - -
- {{Form::select('period',$periods,Input::old('period') ?: $prefilled['repeat_freq'],['class' => 'form-control'])}} - How long will the envelope last? A week, a month, or even longer? -
-
-
- - -
-
- -
- If you want, Firefly can automatically recreate the "envelope" and fill it again - when the timespan above has expired. Be careful with this option though. It makes it easier - to fall back to old habits. - Instead, you should recreate the envelope yourself each [period]. -
-
- - -
- {{ Form::label('amount', 'Amount', ['class' => 'col-sm-4 control-label'])}} -
- - Of course, there needs to be money in the envelope. -
-
- -
- {{ Form::label('submit', ' ', ['class' => 'col-sm-4 control-label'])}} -
- - -
-
- -
-
- -{{Form::close()}} - - -@stop \ No newline at end of file diff --git a/app/views/limits/delete.blade.php b/app/views/limits/delete.blade.php deleted file mode 100644 index 4c3bd9b8b7..0000000000 --- a/app/views/limits/delete.blade.php +++ /dev/null @@ -1,62 +0,0 @@ -@extends('layouts.default') -@section('content') -
-
-

Remember that deleting something is permanent.

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

 

-

- This form allows you to delete the envelope for budget {{{$limit->budget->name}}}, with a content of - {{mf($limit->amount,false)}} - @if($limit->repeats == 0) - in {{$limit->limitrepetitions[0]->startdate->format('M Y')}} ({{$limit->repeat_freq}}). - @endif -

-

- Destroying an envelope does not remove any transactions from the budget. -

-

- Are you sure? -

- -
-
- - @if(Input::get('from') == 'date') - Cancel - @else - Cancel - @endif -
-
-
- @if($limit->repeats == 1) -
-

Auto repeating

-

- This envelope is set to repeat itself; creating a new period whenever the previous period - has passed. If you change this envelope, you'll also change the following (automatically created) - envelopes. - {{$limit->limitrepetitions()->count() }} -

-
    - @foreach($limit->limitrepetitions()->orderBy('startdate','DESC')->get() as $rep) -
  • Evenlope for {{$rep->periodShow()}}, {{mf($rep->amount,false)}}
  • - @endforeach -
-
- @endif -
- - -{{Form::close()}} - -@stop diff --git a/app/views/limits/edit.blade.php b/app/views/limits/edit.blade.php deleted file mode 100644 index 7ba95b132b..0000000000 --- a/app/views/limits/edit.blade.php +++ /dev/null @@ -1,115 +0,0 @@ -@extends('layouts.default') -@section('content') -
-
-

- Firefly uses an "envelope - system" for your budgets, which means that for each period of time (for example a month) a virtual - "envelope" can be created containing a certain amount of money. Money spent within a budget is removed from - the envelope. -

- -

- This form allows you to edit the envelope for budget {{{$limit->budget->name}}}, with a content of - {{mf($limit->amount,false)}} - @if($limit->repeats == 0) - in {{$limit->limitrepetitions[0]->startdate->format('M Y')}} ({{$limit->repeat_freq}}). - @endif -

-
-
- -{{Form::open(['class' => 'form-horizontal','url' => route('budgets.limits.update',$limit->id)])}} -{{Form::hidden('from',e(Input::get('from')))}} -
-
-

Mandatory fields

- -
- {{ Form::label('budget_id', 'Budget', ['class' => 'col-sm-4 control-label'])}} -
- {{Form::select('budget_id',$budgets,Input::old('budget_id') ?: $limit->component_id, ['class' => - 'form-control'])}} - @if($errors->has('budget_id')) -

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

- @else - Select one of your existing budgets. - @endif -
-
- -
- {{ Form::label('startdate', 'Start date', ['class' => 'col-sm-4 control-label'])}} -
- - This date indicates when the envelope "starts". The date you select - here will correct itself to the nearest [period] you select below. -
-
- -
- - -
- {{Form::select('period',$periods,Input::old('period') ?: $limit->repeat_freq,['class' => 'form-control'])}} - How long will the envelope last? A week, a month, or even longer? -
-
-
- - -
-
- -
- If you want, Firefly can automatically recreate the "envelope" and fill it again - when the timespan above has expired. Be careful with this option though. It makes it easier - to fall back to old habits. - Instead, you should recreate the envelope yourself each [period]. -
-
- - -
- {{ Form::label('amount', 'Amount', ['class' => 'col-sm-4 control-label'])}} -
- - Of course, there needs to be money in the envelope. -
-
- -
- {{ Form::label('submit', ' ', ['class' => 'col-sm-4 control-label'])}} -
- - -
-
- -
- @if($limit->repeats == 1) -
-

Auto repeating

-

- This envelope is set to repeat itself; creating a new period whenever the previous period - has passed. If you change this envelope, you'll also change the following (automatically created) - envelopes. - {{$limit->limitrepetitions()->count() }} -

-
    - @foreach($limit->limitrepetitions()->orderBy('startdate','DESC')->get() as $rep) -
  • Evenlope for {{$rep->periodShow()}}, {{mf($rep->amount,false)}}
  • - @endforeach -
-
- @endif -
- -{{Form::close()}} - - -@stop diff --git a/app/views/list/recurring.blade.php b/app/views/list/recurring.blade.php index 7edf6d4e46..624914c97f 100644 --- a/app/views/list/recurring.blade.php +++ b/app/views/list/recurring.blade.php @@ -32,10 +32,20 @@ {{mf($entry->amount_max)}} - + lastFoundMatch();?> + @if($lastMatch) + {{$lastMatch->format('j F Y')}} + @else + Unknown + @endif - + nextExpectedMatch();?> + @if($nextExpectedMatch) + {{$nextExpectedMatch->format('j F Y')}} + @else + Unknown + @endif @if($entry->active) diff --git a/app/views/lists.old/journals-large.old.blade.php b/app/views/lists.old/journals-large.old.blade.php deleted file mode 100644 index 8ff26bcad0..0000000000 --- a/app/views/lists.old/journals-large.old.blade.php +++ /dev/null @@ -1,63 +0,0 @@ - - - - - @foreach($journals as $journal) - - - - - - - - - - @endforeach -
- @if($journal->transactiontype->type == 'Withdrawal') - - @endif - @if($journal->transactiontype->type == 'Deposit') - - @endif - @if($journal->transactiontype->type == 'Transfer') - - @endif - @if($journal->transactiontype->type == 'Opening balance') - - @endif - - bud / cat - {{{$journal->description}}} - @if($journal->transactiontype->type == 'Withdrawal') - {{mf($journal->transactions[1]->amount,false)}} - @endif - @if($journal->transactiontype->type == 'Deposit') - {{mf($journal->transactions[1]->amount,false)}} - @endif - @if($journal->transactiontype->type == 'Transfer') - {{mf($journal->transactions[1]->amount,false)}} - @endif - - @if($journal->transactions[0]->account->accounttype->description == 'Cash account') - (cash) - @else - {{{$journal->transactions[0]->account->name}}} - @endif - - @if($journal->transactions[1]->account->accounttype->description == 'Cash account') - (cash) - @else - {{{$journal->transactions[1]->account->name}}} - @endif - - -
- -{{$journals->links()}} \ No newline at end of file diff --git a/app/views/lists.old/journals-small-index.old.blade.php b/app/views/lists.old/journals-small-index.old.blade.php deleted file mode 100644 index e8e5be5a4f..0000000000 --- a/app/views/lists.old/journals-small-index.old.blade.php +++ /dev/null @@ -1,27 +0,0 @@ - \ No newline at end of file diff --git a/app/views/lists.old/journals-small-noaccount.old.blade.php b/app/views/lists.old/journals-small-noaccount.old.blade.php deleted file mode 100644 index 0cb8c04855..0000000000 --- a/app/views/lists.old/journals-small-noaccount.old.blade.php +++ /dev/null @@ -1,33 +0,0 @@ - \ No newline at end of file diff --git a/app/views/lists.old/transactions.old.blade.php b/app/views/lists.old/transactions.old.blade.php deleted file mode 100644 index ceb0f54757..0000000000 --- a/app/views/lists.old/transactions.old.blade.php +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - @foreach($journals as $journal) - @if(isset($journal->transactions[0]) && isset($journal->transactions[1])) - id) - class="success" - @endif - > - - - - - - - - - - @else - - @endif - @endforeach - @if(isset($sum) && $sum == true) - @if($expenses != 0) - - - - - @endif - @if($incomes != 0) - - - - - @endif - @if($transfers != 0) - - - - - @endif - @endif - - -
ADateDescriptionAmount (€)FromToB
- @if($journal->transactiontype->type == 'Withdrawal') - - @endif - @if($journal->transactiontype->type == 'Deposit') - - @endif - @if($journal->transactiontype->type == 'Transfer') - - @endif - @if($journal->transactiontype->type == 'Opening balance') - - @endif - - @foreach($journal->components as $component) - @if($component->class == 'Budget') - - @endif - @if($component->class == 'Category') - - @endif - @endforeach - - @if(!is_null($journal->recurringTransaction)) - - @endif - - {{$journal->date->format('d F Y')}} - {{{$journal->description}}} - @if($journal->transactiontype->type == 'Withdrawal') - {{mf($journal->transactions[1]->amount,false)}} - transactions[1]->amount;?> - @endif - @if($journal->transactiontype->type == 'Deposit') - {{mf($journal->transactions[1]->amount,false)}} - transactions[1]->amount;?> - @endif - @if($journal->transactiontype->type == 'Transfer') - {{mf($journal->transactions[1]->amount,false)}} - transactions[1]->amount;?> - @endif - - {{{$journal->transactions[0]->account->name}}} - - {{{$journal->transactions[1]->account->name}}} - - @if($journal->transactiontype->type != 'Opening balance') - - @endif -
Expenses:{{mf($expenses)}}
Incomes:{{mf($incomes)}}
Transfers:{{mf($transfers,false)}}
\ No newline at end of file diff --git a/app/views/paginated/transactions.blade.php b/app/views/paginated/transactions.blade.php deleted file mode 100644 index 223541781e..0000000000 --- a/app/views/paginated/transactions.blade.php +++ /dev/null @@ -1,3 +0,0 @@ -{{$journals->links()}} -@include('lists.transactions') -{{$journals->links()}} \ No newline at end of file diff --git a/app/views/piggybanks/show.blade.php b/app/views/piggybanks/show.blade.php index 4a6df0a352..813f8ed5db 100644 --- a/app/views/piggybanks/show.blade.php +++ b/app/views/piggybanks/show.blade.php @@ -8,7 +8,7 @@ Events
-
+
@@ -30,11 +30,11 @@ Saved so far - {{mf(0)}} + {{mf($piggybank->currentRelevantRep()->currentamount)}} Left to save - {{mf(0)}} + {{mf($piggybank->targetamount-$piggybank->currentRelevantRep()->currentamount)}} Start date @@ -72,11 +72,11 @@ Reminders left - 12 + 12 Expected amount per reminder - {{mf(0)}} + {{mf(0)}}
@@ -84,129 +84,6 @@
- -{{-- -
-
-
- 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') diff --git a/app/views/recurring/show.blade.php b/app/views/recurring/show.blade.php index 910aa69dea..a1f229b27d 100644 --- a/app/views/recurring/show.blade.php +++ b/app/views/recurring/show.blade.php @@ -46,8 +46,15 @@ - Next reminder - some date + Next expected match + + nextExpectedMatch();?> + @if($nextExpectedMatch) + {{$nextExpectedMatch->format('j F Y')}} + @else + Unknown + @endif + @@ -67,6 +74,19 @@ +
+
+
+
+ Chart +
+
+ +
+
+
+
+
diff --git a/app/views/search/index.blade.php b/app/views/search/index.blade.php index c20ec700b7..c02339ef15 100644 --- a/app/views/search/index.blade.php +++ b/app/views/search/index.blade.php @@ -1,7 +1,7 @@ @extends('layouts.default') @section('content') @if(!is_null($query)) -
+
@if(isset($result['transactions']) && $result['transactions']->count() > 0)