mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-19 08:00:19 +00:00
Code for #2466
This commit is contained in:
@@ -25,7 +25,6 @@ namespace FireflyIII\Http\Controllers\Recurring;
|
|||||||
|
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
|
||||||
use FireflyIII\Http\Controllers\Controller;
|
use FireflyIII\Http\Controllers\Controller;
|
||||||
use FireflyIII\Models\Recurrence;
|
use FireflyIII\Models\Recurrence;
|
||||||
use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;
|
use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;
|
||||||
@@ -48,6 +47,7 @@ class IndexController extends Controller
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* IndexController constructor.
|
* IndexController constructor.
|
||||||
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
@@ -82,6 +82,9 @@ class IndexController extends Controller
|
|||||||
$page = 0 === (int)$request->get('page') ? 1 : (int)$request->get('page');
|
$page = 0 === (int)$request->get('page') ? 1 : (int)$request->get('page');
|
||||||
$pageSize = (int)app('preferences')->get('listPageSize', 50)->data;
|
$pageSize = (int)app('preferences')->get('listPageSize', 50)->data;
|
||||||
$collection = $this->recurring->get();
|
$collection = $this->recurring->get();
|
||||||
|
$today = new Carbon;
|
||||||
|
$year = new Carbon;
|
||||||
|
$year->addYear();
|
||||||
|
|
||||||
// split collection
|
// split collection
|
||||||
$total = $collection->count();
|
$total = $collection->count();
|
||||||
@@ -99,6 +102,7 @@ class IndexController extends Controller
|
|||||||
$array['first_date'] = new Carbon($array['first_date']);
|
$array['first_date'] = new Carbon($array['first_date']);
|
||||||
$array['repeat_until'] = null === $array['repeat_until'] ? null : new Carbon($array['repeat_until']);
|
$array['repeat_until'] = null === $array['repeat_until'] ? null : new Carbon($array['repeat_until']);
|
||||||
$array['latest_date'] = null === $array['latest_date'] ? null : new Carbon($array['latest_date']);
|
$array['latest_date'] = null === $array['latest_date'] ? null : new Carbon($array['latest_date']);
|
||||||
|
$array['occurrences'] = array_slice($this->recurring->getOccurrencesInRange($recurrence->recurrenceRepetitions->first(), $today, $year),0,1);
|
||||||
$recurring[] = $array;
|
$recurring[] = $array;
|
||||||
}
|
}
|
||||||
$paginator = new LengthAwarePaginator($recurring, $total, $pageSize, $page);
|
$paginator = new LengthAwarePaginator($recurring, $total, $pageSize, $page);
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ return [
|
|||||||
'linked_to_rules' => 'Relevant rules',
|
'linked_to_rules' => 'Relevant rules',
|
||||||
'active' => 'Is active?',
|
'active' => 'Is active?',
|
||||||
'percentage' => 'pct.',
|
'percentage' => 'pct.',
|
||||||
|
'next_due' => 'Next due',
|
||||||
'transaction_type' => 'Type',
|
'transaction_type' => 'Type',
|
||||||
'lastActivity' => 'Last activity',
|
'lastActivity' => 'Last activity',
|
||||||
'balanceDiff' => 'Balance difference',
|
'balanceDiff' => 'Balance difference',
|
||||||
|
|||||||
@@ -39,8 +39,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th class="hidden-sm hidden-xs" data-defaultsort="disabled"> </th>
|
<th class="hidden-sm hidden-xs" data-defaultsort="disabled"> </th>
|
||||||
<th data-defaultsign="az">{{ trans('list.title') }}</th>
|
<th data-defaultsign="az">{{ trans('list.title') }}</th>
|
||||||
<th data-defaultsign="_19">{{ trans('list.transaction_s') }}</th>
|
<th data-defaultsort="disabled">{{ trans('list.transaction_s') }}</th>
|
||||||
<th data-defaultsort="disabled">{{ trans('list.repetitions') }}</th>
|
<th data-defaultsort="disabled">{{ trans('list.repetitions') }}</th>
|
||||||
|
<th data-defaultsign="month" data-dateformat="{{ madMomentJS }}">{{ trans('list.next_due') }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -49,7 +50,8 @@
|
|||||||
<td class="hidden-sm hidden-xs">
|
<td class="hidden-sm hidden-xs">
|
||||||
<div class="btn-group btn-group-xs edit_tr_buttons">
|
<div class="btn-group btn-group-xs edit_tr_buttons">
|
||||||
<a class="btn btn-default btn-xs" title="{{ 'edit'|_ }}" href="{{ route('recurring.edit',rt.id) }}"><i
|
<a class="btn btn-default btn-xs" title="{{ 'edit'|_ }}" href="{{ route('recurring.edit',rt.id) }}"><i
|
||||||
class="fa fa-fw fa-pencil"></i></a><a class="btn btn-danger btn-xs" title="{{ 'delete'|_ }}" href="{{ route('recurring.delete',rt.id) }}"><i
|
class="fa fa-fw fa-pencil"></i></a><a class="btn btn-danger btn-xs" title="{{ 'delete'|_ }}"
|
||||||
|
href="{{ route('recurring.delete',rt.id) }}"><i
|
||||||
class="fa fa-fw fa-trash-o"></i></a>
|
class="fa fa-fw fa-trash-o"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -57,7 +59,7 @@
|
|||||||
{% if rt.active == false %}<s>{% endif %}
|
{% if rt.active == false %}<s>{% endif %}
|
||||||
{{ rt.type|_ }}:
|
{{ rt.type|_ }}:
|
||||||
<a href="{{ route('recurring.show',rt.id) }}">{{ rt.title }}</a>
|
<a href="{{ route('recurring.show',rt.id) }}">{{ rt.title }}</a>
|
||||||
{% if rt.active == false %}</s> ({{ 'inactive'|_|lower }}){% endif %}
|
{% if rt.active == false %}</s> ({{ 'inactive'|_|lower }}){% endif %}
|
||||||
{% if rt.description|length > 0 %}
|
{% if rt.description|length > 0 %}
|
||||||
<small><br>{{ rt.description }}</small>
|
<small><br>{{ rt.description }}</small>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -86,12 +88,12 @@
|
|||||||
<ul>
|
<ul>
|
||||||
{% for rep in rt.repetitions %}
|
{% for rep in rt.repetitions %}
|
||||||
<li>{{ rep.description }}
|
<li>{{ rep.description }}
|
||||||
{% if rep.repetition_skip == 1 %}
|
{% if rep.repetition_skip == 1 %}
|
||||||
({{ trans('firefly.recurring_skips_one')|lower }}).
|
({{ trans('firefly.recurring_skips_one')|lower }}).
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if rep.repetition_skip > 1 %}
|
{% if rep.repetition_skip > 1 %}
|
||||||
({{ trans('firefly.recurring_skips_more', {count: rep.repetition_skip})|lower }}).
|
({{ trans('firefly.recurring_skips_more', {count: rep.repetition_skip})|lower }}).
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if rep.weekend == 3 %}
|
{% if rep.weekend == 3 %}
|
||||||
{{ 'will_jump_friday'|_ }}
|
{{ 'will_jump_friday'|_ }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -114,9 +116,13 @@
|
|||||||
{% if null == rt.repeat_until and rt.nr_of_repetitions != 0 %}
|
{% if null == rt.repeat_until and rt.nr_of_repetitions != 0 %}
|
||||||
{{ trans('firefly.recurring_repeats_x_times', {count: rt.nr_of_repetitions}) }}.
|
{{ trans('firefly.recurring_repeats_x_times', {count: rt.nr_of_repetitions}) }}.
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
|
{% if rt.occurrences|length == 0 %}
|
||||||
|
<td> </td>
|
||||||
|
{% else %}
|
||||||
|
<td>{{ rt.occurrences[0].formatLocalized(monthAndDayFormat) }}</td>
|
||||||
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user