From 54685c1f5ff851bcc07e50b83488dde7416db02f Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 14 Nov 2014 12:54:49 +0100 Subject: [PATCH] Some new lists for recurring transactions. --- app/controllers/RecurringController.php | 10 +++- app/views/list/journals-full.blade.php | 16 ++++--- app/views/list/recurring.blade.php | 63 +++++++++++++++++++++++++ app/views/recurring/index.blade.php | 11 +---- app/views/recurring/show.blade.php | 5 +- 5 files changed, 84 insertions(+), 21 deletions(-) create mode 100644 app/views/list/recurring.blade.php diff --git a/app/controllers/RecurringController.php b/app/controllers/RecurringController.php index 809bf7e7ad..36dd8c4d24 100644 --- a/app/controllers/RecurringController.php +++ b/app/controllers/RecurringController.php @@ -80,7 +80,11 @@ class RecurringController extends BaseController */ public function index() { - return View::make('recurring.index'); + /** @var \FireflyIII\Database\Recurring $repos */ + $repos = App::make('FireflyIII\Database\Recurring'); + + $recurring = $repos->get(); + return View::make('recurring.index',compact('recurring')); } /** @@ -110,7 +114,9 @@ class RecurringController extends BaseController */ public function show(RecurringTransaction $recurringTransaction) { - return View::make('recurring.show')->with('recurring', $recurringTransaction)->with('subTitle', $recurringTransaction->name); + $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); } public function store() diff --git a/app/views/list/journals-full.blade.php b/app/views/list/journals-full.blade.php index d118ec5fa1..6405564a5b 100644 --- a/app/views/list/journals-full.blade.php +++ b/app/views/list/journals-full.blade.php @@ -1,4 +1,4 @@ -@if(is_object($journals)) +@if(is_object($journals) && method_exists($journals, 'links')) {{$journals->links()}} @endif @@ -16,7 +16,9 @@ @if(!isset($hideCategory) || (isset($hideCategory) && $hideCategory=== false)) @endif - + @if(!isset($hideRecurring) || (isset($hideRecurring) && $hideRecurring=== false)) + + @endif @foreach($journals as $journal) @if(!isset($journal->transactions[1]) || !isset($journal->transactions[0])) @@ -99,11 +101,13 @@ @endif @endif + @if(!isset($hideRecurring) || (isset($hideRecurring) && $hideRecurring=== false)) + @endif @@ -112,6 +116,6 @@ @endforeach
- @if($journal->recurringTransaction) - {{{$journal->recurringTransaction->name}}} - @endif + @if($journal->recurringTransaction) + {{{$journal->recurringTransaction->name}}} + @endif
-@if(is_object($journals)) +@if(is_object($journals) && method_exists($journals, 'links')) {{$journals->links()}} @endif \ No newline at end of file diff --git a/app/views/list/recurring.blade.php b/app/views/list/recurring.blade.php new file mode 100644 index 0000000000..7edf6d4e46 --- /dev/null +++ b/app/views/list/recurring.blade.php @@ -0,0 +1,63 @@ + + + + + + + + + + + + + @foreach($recurring as $entry) + + + + + + + + + + + + + @endforeach +
 NameMatches onMatching amountLast seen matchNext expected matchIs activeWill be automatchedRepeats every
+
+ + +
+
+ {{{$entry->name}}} + + @foreach(explode(' ',$entry->match) as $match) + {{{$match}}} + @endforeach + + {{mf($entry->amount_min)}} + — + {{mf($entry->amount_max)}} + + + + + + @if($entry->active) + + @else + + @endif + + @if($entry->automatch) + + @else + + @endif + + {{{$entry->repeat_freq}}} + @if($entry->skip > 0) + skips over {{$entry->skip}} + @endif +
\ No newline at end of file diff --git a/app/views/recurring/index.blade.php b/app/views/recurring/index.blade.php index ddfbf6f309..5ea3406b60 100644 --- a/app/views/recurring/index.blade.php +++ b/app/views/recurring/index.blade.php @@ -7,7 +7,7 @@ {{{$title}}}
-
+ @include('list.recurring')
@@ -15,13 +15,4 @@ @stop @section('scripts') - - -{{HTML::script('assets/javascript/firefly/gcharts.options.js')}} -{{HTML::script('assets/javascript/firefly/gcharts.js')}} - - - - -{{HTML::script('assets/javascript/firefly/recurring.js')}} @stop \ No newline at end of file diff --git a/app/views/recurring/show.blade.php b/app/views/recurring/show.blade.php index 3d5a738cae..910aa69dea 100644 --- a/app/views/recurring/show.blade.php +++ b/app/views/recurring/show.blade.php @@ -38,7 +38,7 @@ Matching on - @foreach(explode(',',$recurring->match) as $word) + @foreach(explode(' ',$recurring->match) as $word) {{{$word}}} @endforeach between {{mf($recurring->amount_min)}} and {{mf($recurring->amount_max)}}. @@ -74,8 +74,7 @@ Connected transaction journals
-
- + @include('list.journals-full')