mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-07-06 06:03:55 -07:00
270 lines
15 KiB
PHP
270 lines
15 KiB
PHP
<div class="pl-2">
|
|
{{ paginator.links('pagination.bootstrap-4')|raw }}
|
|
</div>
|
|
<table class="table table-responsive table-hover" id="bill-sortable">
|
|
<thead>
|
|
<tr>
|
|
<th class="hidden-sm hidden-xs"> </th>
|
|
<th class="hidden-sm hidden-xs"> </th>
|
|
<th>{{ trans('list.name') }}</th>
|
|
<th class="hidden-sm hidden-md hidden-xs">{{ trans('list.linked_to_rules') }}</th>
|
|
<th class="text-end">{{ trans('list.matchingAmount') }}</th>
|
|
<th class="hidden-sm hidden-xs">{{ trans('list.paid_current_period') }}</th>
|
|
<th class="hidden-sm hidden-xs">{{ trans('list.next_expected_match') }}</th>
|
|
<th class="hidden-sm hidden-xs">{{ trans('list.repeat_freq') }}</th>
|
|
</tr>
|
|
</thead>
|
|
{% for objectGroupOrder, objectGroup in bills %}
|
|
{% if objectGroup.bills|length > 0 %}
|
|
<tbody class="bill-connected-list"
|
|
{% if objectGroupOrder != 0 %}data-title="{{ objectGroup.object_group_title }}"
|
|
@elsedata-title=""@endif>
|
|
<tr>
|
|
<td class="hidden-sm hidden-xs"> </td>
|
|
<td class="hidden-sm hidden-xs"> </td>
|
|
<td colspan="6"><small>{{ objectGroup.object_group_title }}</small></td>
|
|
</tr>
|
|
{% for entry in objectGroup.bills %}
|
|
<tr class="bill-sortable" data-id="{{ entry.id }}" data-name="{{ entry.name }}"
|
|
data-order="{{ entry.order }}" data-position="{{ loop.index0 }}">
|
|
<td class="hidden-sm hidden-xs">
|
|
<span class="bi bi-list bill-handle"></span>
|
|
</td>
|
|
<td class="hidden-sm hidden-xs">
|
|
<div class="btn-group btn-group-sm edit_tr_buttons"><a href="{{ route('subscriptions.edit',entry.id) }}"
|
|
class="btn btn-outline-secondary btn-xs"><span
|
|
class="bi bi-pencil"></span></a><a
|
|
href="{{ route('subscriptions.delete',entry.id) }}" class="btn btn-danger btn-xs"><span
|
|
class="bi bi-trash"></span></a></div>
|
|
</td>
|
|
<td>
|
|
{% if not entry.active %}
|
|
<span class="bi bi-ban"></span>
|
|
@endif
|
|
<a href="{{ route('subscriptions.show',entry.id) }}" title="{{ entry.name }}">{{ entry.name }}</a>
|
|
{{-- count attachments --}}
|
|
{% if entry.attachments.count() > 0 %}
|
|
<span class="bi bi-paperclip"></span>
|
|
@endif
|
|
|
|
</td>
|
|
<td class="hidden-sm hidden-md hidden-xs rules">
|
|
{% if entry.rules|length > 0 %}
|
|
<ul class="list-unstyled">
|
|
{% for rule in entry.rules %}
|
|
<li>
|
|
<a href="{{ route('rules.edit', [rule.id]) }}">
|
|
{{ rule.title }}
|
|
</a>
|
|
{% if not rule.active %}({{ 'list_inactive_rule'|_|lower }})@endif
|
|
</li>
|
|
@endforeach
|
|
</ul>
|
|
@endif
|
|
</td>
|
|
<td class="text-end">
|
|
<span class="mr-2" title="{!! format_amount_by_symbol(entry.amount_min, entry.currency_symbol, entry.currency_decimal_places, false)|escape }} -- {!! format_amount_by_symbol(entry.amount_max, entry.currency_symbol, entry.currency_decimal_places, false)|escape }}">
|
|
~ {!! format_amount_by_symbol((entry.amount_max + entry.amount_min)/2, entry.currency_symbol, entry.currency_decimal_places) }}
|
|
|
|
{% if '0' != entry.pc_amount_max and null != entry.pc_amount_max %}
|
|
(~ {!! format_amount_by_symbol((entry.pc_amount_max + entry.pc_amount_min)/2, $primaryCurrency->symbol, $primaryCurrency->decimal_places) }})
|
|
@endif
|
|
</span>
|
|
</td>
|
|
|
|
{{--
|
|
paidDates = 0 (bill not paid in period)
|
|
pay_dates = 0 (bill not expected to be paid in this period)
|
|
bill is active.
|
|
--}}
|
|
{% if entry.paid_dates|length == 0 and entry.pay_dates|length == 0 and entry.active %}
|
|
<td class="paid_in_period text-muted">
|
|
{{ trans('firefly.not_expected_period') }}
|
|
</td>
|
|
<td class="expected_in_period hidden-sm hidden-xs">
|
|
{% if entry.next_expected_match %}
|
|
{{ formatDate(entry.next_expected_match, monthAndDayFormat) }}
|
|
@endif
|
|
</td>
|
|
@endif
|
|
|
|
{{--
|
|
paid_dates = 0 (bill not paid in period)
|
|
pay_dates > 0 (bill IS expected to be paid in this period)
|
|
bill is active
|
|
first pay date is in the past.
|
|
--}}
|
|
{% if entry.paid_dates|length == 0 and entry.pay_dates|length > 0 and entry.active %}
|
|
{% if entry.next_expected_match_diff == trans('firefly.not_expected_period') %} {{-- terrible code, you should sue me for this. --}}
|
|
<td class="paid_in_period text-muted">
|
|
{{ entry.next_expected_match_diff }}
|
|
</td>
|
|
@else
|
|
<td class="paid_in_period text-warning">
|
|
{{ entry.next_expected_match_diff }}
|
|
<!-- {{ trans('firefly.bill_expected_date', {date: entry.next_expected_match_diff }) }} -->
|
|
</td>
|
|
@endif
|
|
<td class="expected_in_period hidden-sm hidden-xs">
|
|
|
|
{% for date in entry.pay_dates %}
|
|
{{ formatDate(date, monthAndDayFormat) }}<br>
|
|
@endforeach
|
|
|
|
</td>
|
|
@endif
|
|
|
|
{{--
|
|
paid_dates >= 0 (bill is paid X times).
|
|
Don't care about pay_dates.
|
|
--}}
|
|
{% if entry.paid_dates|length > 0 and entry.active %}
|
|
<td class="paid_in_period text-success">
|
|
|
|
{% for currentPaid in entry.paid_dates %}
|
|
<a href="{{ route('transactions.show',currentPaid.transaction_group_id) }}">
|
|
{{ formatDate(currentPaid.date, monthAndDayFormat) }}
|
|
</a>
|
|
<br/>
|
|
@endforeach
|
|
</td>
|
|
<td class="expected_in_period hidden-sm hidden-xs">
|
|
{% if entry.next_expected_match %}
|
|
{{ formatDate(entry.next_expected_match, monthAndDayFormat) }}
|
|
@else
|
|
<span class="text-muted">{{ entry.next_expected_match_diff }}</span>
|
|
@endif
|
|
</td>
|
|
@endif
|
|
{{-- bill is not active --}}
|
|
{% if not entry.active %}
|
|
<td class="paid_in_period text-muted">
|
|
~
|
|
</td>
|
|
<td class="expected_in_period text-muted hidden-sm hidden-xs">~</td>
|
|
@endif
|
|
<td class="hidden-sm hidden-xs">
|
|
{{ ('repeat_freq_'~entry.repeat_freq)|_ }}
|
|
{% if entry.skip > 0 %}
|
|
{{ 'skips_over'|_ }} {{ entry.skip }}
|
|
@endif
|
|
{% if entry.end_date %}
|
|
<br>
|
|
{% if carbonize(entry.end_date).lte(today) %}
|
|
<span class="text-danger">
|
|
{{ trans('firefly.bill_end_index_line', {date: carbonize(entry.end_date).isoFormat($monthAndDayFormat) }) }}
|
|
</span>
|
|
@else
|
|
{{ trans('firefly.bill_end_index_line', {date: carbonize(entry.end_date).isoFormat($monthAndDayFormat) }) }}
|
|
@endif
|
|
@endif
|
|
{% if entry.extension_date %}
|
|
<br>
|
|
{% if carbonize(entry.extension_date).lte(today) %}
|
|
<span class="text-danger">
|
|
{{ trans('firefly.bill_extension_index_line', {date: carbonize(entry.extension_date).isoFormat($monthAndDayFormat) }) }}
|
|
</span>
|
|
@else
|
|
{{ trans('firefly.bill_extension_index_line', {date: carbonize(entry.extension_date).isoFormat($monthAndDayFormat) }) }}
|
|
@endif
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
{% for sum in sums[objectGroupOrder] %}
|
|
{% if '0' != sum.avg %}
|
|
<tr>
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- handle -->
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- buttons -->
|
|
<td colspan="2" class="text-end"> <!-- title -->
|
|
<small>{{ __('firefly.sum') }} ({{ sum.currency_name }}) ({{ 'active_exp_bills_only'|_ }})</small>
|
|
</td>
|
|
<td class="text-end"> <!-- amount -->
|
|
{!! format_amount_by_symbol(sum.avg, sum.currency_symbol, sum.currency_decimal_places) }}
|
|
</td>
|
|
<td> </td> <!-- paid in period -->
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- next expected match -->
|
|
<td class="hidden-sm hidden-xs"> </td><!-- repeats -->
|
|
</tr>
|
|
@endif
|
|
{% if '0' != sum.total_left_to_pay %}
|
|
<tr>
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- handle -->
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- buttons -->
|
|
<td colspan="2" class="text-end"> <!-- title -->
|
|
<small>{{ __('firefly.sum') }} ({{ sum.currency_name }}) ({{ 'left_to_pay_active_bills'|_ }})</small>
|
|
</td>
|
|
<td class="text-end"> <!-- amount -->
|
|
{!! format_amount_by_symbol(sum.total_left_to_pay, sum.currency_symbol, sum.currency_decimal_places) }}
|
|
</td>
|
|
<td> </td> <!-- paid in period -->
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- next expected match -->
|
|
<td class="hidden-sm hidden-xs"> </td><!-- repeats -->
|
|
</tr>
|
|
@endif
|
|
{% if '0' != sum.per_period %}
|
|
<tr>
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- handle -->
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- buttons -->
|
|
<td colspan="2" class="text-end"> <!-- title -->
|
|
<small>{{ ('per_period_sum_'~sum.period)|_ }} ({{ sum.currency_name }})
|
|
({{ 'active_bills_only'|_ }})</small>
|
|
</td>
|
|
<td class="text-end"> <!-- amount -->
|
|
{!! format_amount_by_symbol(sum.per_period, sum.currency_symbol, sum.currency_decimal_places) }}
|
|
</td>
|
|
<td> </td> <!-- paid in period -->
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- next expected match -->
|
|
<td class="hidden-sm hidden-xs"> </td><!-- repeats -->
|
|
</tr>
|
|
@endif
|
|
@endforeach
|
|
</tbody>
|
|
@endif
|
|
@endforeach
|
|
{% if totals|length > 0 %}
|
|
<tfoot>
|
|
<tr>
|
|
<td colspan="8" class="top-dark-border"></td>
|
|
</tr>
|
|
{% for sum in totals %}
|
|
{% if '0' != sum.avg %}
|
|
<tr>
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- handle -->
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- buttons -->
|
|
<td colspan="2" class="text-end"> <!-- title -->
|
|
<small>{{ __('firefly.sum') }} ({{ sum.currency_name }}) ({{ 'active_exp_bills_only_total'|_ }})</small>
|
|
</td>
|
|
<td class="text-end"> <!-- amount -->
|
|
{!! format_amount_by_symbol(sum.avg, sum.currency_symbol, sum.currency_decimal_places) }}
|
|
</td>
|
|
<td> </td> <!-- paid in period -->
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- next expected match -->
|
|
<td class="hidden-sm hidden-xs"> </td><!-- repeats -->
|
|
</tr>
|
|
@endif
|
|
{% if '0' != sum.per_period %}
|
|
<tr>
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- handle -->
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- buttons -->
|
|
<td colspan="2" class="text-end"> <!-- title -->
|
|
<small>{{ ('per_period_sum_'~sum.period)|_ }} ({{ sum.currency_name }})
|
|
({{ 'active_bills_only_total'|_ }})</small>
|
|
</td>
|
|
<td class="text-end"> <!-- amount -->
|
|
{!! format_amount_by_symbol(sum.per_period, sum.currency_symbol, sum.currency_decimal_places) }}
|
|
</td>
|
|
<td> </td> <!-- paid in period -->
|
|
<td class="hidden-sm hidden-xs"> </td> <!-- next expected match -->
|
|
<td class="hidden-sm hidden-xs"> </td><!-- repeats -->
|
|
</tr>
|
|
@endif
|
|
@endforeach
|
|
</tfoot>
|
|
@endif
|
|
|
|
</table>
|
|
<div class="pl-2">
|
|
{{ paginator.links('pagination.bootstrap-4')|raw }}
|
|
</div>
|