Skip to content

Firefly III: a personal finances manager

Some new lists for recurring transactions.

James Cole54685c1f5ff8
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
<table class="table table-striped table-bordered">
@@ -16,7 +16,9 @@
@if(!isset($hideCategory) || (isset($hideCategory) && $hideCategory=== false))
<th><i class="fa fa-bar-chart fa-fw" title="Category"></i></th>
@endif
- <th><i class="fa fa-fw fa-rotate-right" title="Recurring transaction"></i></th>
+ @if(!isset($hideRecurring) || (isset($hideRecurring) && $hideRecurring=== false))
+ <th><i class="fa fa-fw fa-rotate-right" title="Recurring transaction"></i></th>
+ @endif
</tr>
@foreach($journals as $journal)
@if(!isset($journal->transactions[1]) || !isset($journal->transactions[0]))
@@ -99,11 +101,13 @@
@endif
</td>
@endif
+ @if(!isset($hideRecurring) || (isset($hideRecurring) && $hideRecurring=== false))
<td>
- @if($journal->recurringTransaction)
- <a href="{{route('recurring.show',$journal->recurring_transaction_id)}}">{{{$journal->recurringTransaction->name}}}</a>
- @endif
+ @if($journal->recurringTransaction)
+ <a href="{{route('recurring.show',$journal->recurring_transaction_id)}}">{{{$journal->recurringTransaction->name}}}</a>
+ @endif
</td>
+ @endif
</tr>
@@ -112,6 +116,6 @@
@endforeach
</table>
-@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 @@
+<table class="table table-bordered table-striped">
+ <tr>
+ <th>&nbsp;</th>
+ <th>Name</th>
+ <th>Matches on</th>
+ <th>Matching amount</th>
+ <th>Last seen match</th>
+ <th>Next expected match</th>
+ <th>Is active</th>
+ <th>Will be automatched</th>
+ <th>Repeats every</th>
+ </tr>
+ @foreach($recurring as $entry)
+ <tr>
+ <td>
+ <div class="btn-group btn-group-xs">
+ <a href="{{route('recurring.edit',$entry->id)}}" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
+ <a href="{{route('recurring.delete',$entry->id)}}" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-trash"></span></a>
+ </div>
+ </td>
+ <td>
+ <a href="{{route('recurring.show',$entry->id)}}" title="{{{$entry->name}}}">{{{$entry->name}}}</a>
+ </td>
+ <td>
+ @foreach(explode(' ',$entry->match) as $match)
+ <span class="label label-info">{{{$match}}}</span>
+ @endforeach
+ </td>
+ <td>
+ {{mf($entry->amount_min)}}
+ &mdash;
+ {{mf($entry->amount_max)}}
+ </td>
+ <td>
+ <!-- TODO -->
+ </td>
+ <td>
+ <!-- TODO -->
+ </td>
+ <td>
+ @if($entry->active)
+ <i class="fa fa-fw fa-check"></i>
+ @else
+ <i class="fa fa-fw fa-ban"></i>
+ @endif
+ </td>
+ <td>
+ @if($entry->automatch)
+ <i class="fa fa-fw fa-check"></i>
+ @else
+ <i class="fa fa-fw fa-ban"></i>
+ @endif
+ </td>
+ <td>
+ {{{$entry->repeat_freq}}}
+ @if($entry->skip > 0)
+ skips over {{$entry->skip}}
+ @endif
+ </td>
+ </tr>
+
+ @endforeach
+</table>
\ 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 @@
<i class="fa {{$mainTitleIcon}}"></i> {{{$title}}}
</div>
<div class="panel-body">
- <div id="recurring-table"></div>
+ @include('list.recurring')
</div>
</div>
</div>
@@ -15,13 +15,4 @@
@stop
@section('scripts')
-<!-- load the libraries and scripts necessary for Google Charts: -->
-<script type="text/javascript" src="https://www.google.com/jsapi"></script>
-{{HTML::script('assets/javascript/firefly/gcharts.options.js')}}
-{{HTML::script('assets/javascript/firefly/gcharts.js')}}
-
-
-<script src="assets/javascript/firefly/accounts.js"></script>
-
-{{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 @@
<tr>
<td colspan="2">
Matching on
- @foreach(explode(',',$recurring->match) as $word)
+ @foreach(explode(' ',$recurring->match) as $word)
<span class="label label-info">{{{$word}}}</span>
@endforeach
between {{mf($recurring->amount_min)}} and {{mf($recurring->amount_max)}}.
@@ -74,8 +74,7 @@
Connected transaction journals
</div>
<div class="panel-body">
- <div id="transaction-table"></div>
-
+ @include('list.journals-full')
</div>
</div>
</div>