Some new lists for recurring transactions.

This commit is contained in:
James Cole 2014-11-14 12:54:49 +01:00
parent eb8f8fa935
commit 54685c1f5f
5 changed files with 84 additions and 21 deletions

View File

@ -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()

View File

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

View File

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

View File

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

View File

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