Move v1 views

This commit is contained in:
James Cole
2022-01-29 14:15:34 +01:00
parent a12fd4a3ae
commit 6da6a68e33
251 changed files with 17989 additions and 0 deletions

View File

@@ -0,0 +1,223 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
{% endblock %}
{% block content %}
<form action="{{ route('recurring.store') }}" method="post" id="store" class="form-horizontal" enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
{# row with recurrence information #}
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
{# mandatory recurrence stuff #}
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatory_for_recurring'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('title') }}
{{ preFilled.first_date.format('Y-m-d') }}
{{ ExpandedForm.date('first_date',null, {helpText: trans('firefly.help_first_date'), min: preFilled.first_date}) }}
{{ ExpandedForm.select('repetition_type', [], null, {helpText: trans('firefly.change_date_other_options')}) }}
{{ ExpandedForm.number('skip', 0) }}
{{ ExpandedForm.select('weekend', weekendResponses, null, {helpText: trans('firefly.help_weekend')}) }}
{{ ExpandedForm.select('repetition_end', repetitionEnds) }}
{{ ExpandedForm.date('repeat_until',null) }}
{{ ExpandedForm.number('repetitions',null) }}
{# calendar in popup #}
<div class="form-group" id="calendar_holder">
<label for="ffInput_calendar" class="col-sm-4 control-label">{{ trans('form.calendar') }}</label>
<div class="col-sm-8">
<p class="form-control-static" id="ffInput_calendar">
<a href="#" id="calendar-link">{{ 'click_for_calendar'|_ }}</a>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
{# optional recurrence stuff #}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optional_for_recurring'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.textarea('recurring_description') }}
{# only correct way to do active checkbox #}
{{ ExpandedForm.checkbox('active', 1) }}
{{ ExpandedForm.checkbox('apply_rules',1) }}
{{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
{# mandatory transaction information #}
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatory_for_transaction'|_ }}</h3>
</div>
<div class="box-body">
<p><em>{{ 'mandatory_fields_for_tranaction'|_ }}</em></p>
{# three buttons to distinguish type of transaction#}
<div class="form-group" id="name_holder">
<label for="ffInput_type" class="col-sm-4 control-label">
{{ trans('form.transaction_type') }}
</label>
<div class="col-sm-8">
<div class="btn-group btn-group-sm">
<a href="#" class="btn btn-default switch-button" data-value="withdrawal">{{ 'withdrawal'|_ }}</a>
<a href="#" class="btn btn-default switch-button" data-value="deposit">{{ 'deposit'|_ }}</a>
<a href="#" class="btn btn-default switch-button" data-value="transfer">{{ 'transfer'|_ }}</a>
</div>
</div>
</div>
<input type="hidden" name="transaction_type" value="">
{# end of three buttons#}
{{ ExpandedForm.text('transaction_description') }}
{# transaction information (mandatory) #}
{{ CurrencyForm.currencyList('transaction_currency_id', defaultCurrency.id) }}
{{ ExpandedForm.amountNoCurrency('amount') }}
{# source account if withdrawal, or if transfer: #}
{{ AccountForm.longAccountList('source_id', null, {label: trans('form.asset_source_account')}) }}
{# for deposits, a drop down with revenue accounts, loan debt cash and mortgage #}
{{ AccountForm.activeDepositDestinations('deposit_source_id', null, {label: trans('form.deposit_source_id')}) }}
{# destination if deposit or transfer: #}
{{ AccountForm.longAccountList('destination_id', null, {label: trans('form.asset_destination_account')} ) }}
{# destination account name for withdrawals #}
{#{{ ExpandedForm.text('destination_name', null, {label: trans('form.expense_account')}) }} #}
{# NEW for withdrawals, also a drop down with expense accounts, loans, debts, mortgages or (cash). #}
{{ AccountForm.activeWithdrawalDestinations('withdrawal_destination_id', null, {label: trans('form.withdrawal_destination_id')}) }}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
{# optional transaction information #}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optional_for_transaction'|_ }}</h3>
</div>
<div class="box-body">
{# transaction information (optional) #}
{{ CurrencyForm.currencyListEmpty('foreign_currency_id') }}
{{ ExpandedForm.amountNoCurrency('foreign_amount') }}
{# BUDGET ONLY WHEN CREATING A WITHDRAWAL #}
{% if budgets|length > 1 %}
{{ ExpandedForm.select('budget_id', budgets, null) }}
{% else %}
{{ ExpandedForm.select('budget_id', budgets, null, {helpText: trans('firefly.no_budget_pointer', {link: route('budgets.index')})}) }}
{% endif %}
{# CATEGORY ALWAYS #}
{{ ExpandedForm.text('category') }}
{# BILL / SUBSCRIPTION ONLY FOR WITHDRAWALS #}
{% if bills|length > 1 %}
{{ ExpandedForm.select('bill_id', bills, null) }}
{% else %}
{{ ExpandedForm.select('bill_id', bills, null, {helpText: trans('firefly.no_bill_pointer', {link: route('bills.index')})}) }}
{% endif %}
{# TAGS #}
{{ ExpandedForm.text('tags') }}
{# RELATE THIS TRANSFER TO A PIGGY BANK #}
{{ PiggyBankForm.piggyBankList('piggy_bank_id') }}
</div>
</div>
</div>
</div>
{# row with submit stuff. #}
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'options'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.optionsList('create','recurrence') }}
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">
{{ ('store_new_recurrence')|_ }}
</button>
</div>
</div>
</div>
</div>
{#
<div class="row">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'expected_repetitions'|_ }}</h3>
</div>
<div class="box-body">
Here.
</div>
</div>
</div>
</div>
</div>
#}
</form>
{# calendar modal #}
<div class="modal fade" id="calendarModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{ 'recurring_calendar_view'|_ }}</h4>
</div>
<div class="modal-body">
<div id="recurring_calendar" style="max-width: 400px;margin: 0 auto;">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="v1/js/lib/modernizr-custom.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/typeahead/typeahead.bundle.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/common/autocomplete.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/bootstrap-tagsinput.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/jquery-ui.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/lib/fc/fullcalendar.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var transactionType = "{{ preFilled.transaction_type }}";
var suggestUri = "{{ route('recurring.suggest') }}";
var eventsUri = "{{ route('recurring.events') }}";
var oldRepetitionType= "{{ oldRepetitionType }}";
</script>
<script type="text/javascript" src="v1/js/ff/recurring/create.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}
{% block styles %}
<link href="v1/css/bootstrap-tagsinput.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
<link href="v1/css/jquery-ui/jquery-ui.structure.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
<link href="v1/css/jquery-ui/jquery-ui.theme.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
<link href="v1/lib/fc/fullcalendar.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
{% endblock %}

View File

@@ -0,0 +1,41 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, recurrence) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('recurring.destroy',recurrence.id) }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 col-lg-offset-3 col-md-12 col-sm-12">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('form.delete_recurring', {'title': recurrence.title}) }}</h3>
</div>
<div class="box-body">
<p class="text-danger">
{{ trans('form.permDeleteWarning') }}
</p>
<p>
{{ trans('form.recurring_areYouSure', {'title': recurrence.title}) }}
</p>
<p>
{% if journalsCreated > 0 %}
{{ Lang.choice('form.recurring_keep_transactions', journalsCreated, {count: journalsCreated }) }}
{% endif %}
</p>
</div>
<div class="box-footer">
<input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn btn-danger pull-right"/>
<a href="{{ URL.previous() }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,220 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, recurrence) }}
{% endblock %}
{% block content %}
{{ Form.model(recurrence, {'class' : 'form-horizontal','enctype': 'multipart/form-data','id' : 'update','url' : route('recurring.update', recurrence.id)}) }}
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
{# row with recurrence information #}
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
{# mandatory recurrence stuff #}
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatory_for_recurring'|_ }}</h3>
</div>
<div class="box-body">
<input type="hidden" name="id" value="{{ array.id }}" />
{{ ExpandedForm.text('title') }}
{{ ExpandedForm.date('first_date',array.first_date, {helpText: trans('firefly.help_first_date_no_past')}) }}
{{ ExpandedForm.select('repetition_type', [], null, {helpText: trans('firefly.change_date_other_options')}) }}
{{ ExpandedForm.number('skip', array.repetitions[0].skip) }}
{{ ExpandedForm.select('weekend', weekendResponses, array.repetitions[0].weekend, {helpText: trans('firefly.help_weekend')}) }}
{{ ExpandedForm.select('repetition_end', repetitionEnds, repetitionEnd) }}
{{ ExpandedForm.date('repeat_until',array.repeat_until) }}
{{ ExpandedForm.number('repetitions', array.nr_of_repetitions) }}
{# calendar in popup #}
<div class="form-group" id="calendar_holder">
<label for="ffInput_calendar" class="col-sm-4 control-label">{{ trans('form.calendar') }}</label>
<div class="col-sm-8">
<p class="form-control-static" id="ffInput_calendar">
<a href="#" id="calendar-link">{{ 'click_for_calendar'|_ }}</a>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
{# optional recurrence stuff #}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optional_for_recurring'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.textarea('recurring_description',array.description) }}
{# only correct way to do active checkbox #}
{{ ExpandedForm.checkbox('active', 1, preFilled.active) }}
{{ ExpandedForm.checkbox('apply_rules', 1, preFilled.apply_rules) }}
{{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
{# mandatory transaction information #}
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatory_for_transaction'|_ }}</h3>
</div>
<div class="box-body">
<p><em>{{ 'mandatory_fields_for_tranaction'|_ }}</em></p>
{# three buttons to distinguish type of transaction#}
<div class="form-group" id="name_holder">
<label for="ffInput_type" class="col-sm-4 control-label">
{{ trans('form.transaction_type') }}
</label>
<div class="col-sm-8">
<div class="btn-group btn-group-sm">
<a href="#" class="btn btn-default switch-button" data-value="withdrawal">{{ 'withdrawal'|_ }}</a>
<a href="#" class="btn btn-default switch-button" data-value="deposit">{{ 'deposit'|_ }}</a>
<a href="#" class="btn btn-default switch-button" data-value="transfer">{{ 'transfer'|_ }}</a>
</div>
</div>
</div>
<input type="hidden" name="transaction_type" value="">
{# end of three buttons#}
{{ ExpandedForm.text('transaction_description', array.transactions[0].description) }}
{# transaction information (mandatory) #}
{{ CurrencyForm.currencyList('transaction_currency_id', array.transactions[0].currency_id) }}
{{ ExpandedForm.amountNoCurrency('amount', array.transactions[0].amount) }}
{# source account if withdrawal, or if transfer: #}
{{ AccountForm.longAccountList('source_id', array.transactions[0].source_id, {label: trans('form.asset_source_account')}) }}
{# NEW for deposits, a drop down with revenue accounts, loan debt cash and mortgage #}
{{ AccountForm.activeDepositDestinations('deposit_source_id', preFilled.deposit_source_id, {label: trans('form.deposit_source_id')}) }}
{# destination if deposit or transfer: #}
{{ AccountForm.longAccountList('destination_id', array.transactions[0].destination_id, {label: trans('form.asset_destination_account')} ) }}
{# NEW for withdrawals, also a drop down with expense accounts, loans, debts, mortgages or (cash). #}
{{ AccountForm.activeWithdrawalDestinations('withdrawal_destination_id', preFilled.withdrawal_destination_id, {label: trans('form.withdrawal_destination_id')}) }}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
{# optional transaction information #}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optional_for_transaction'|_ }}</h3>
</div>
<div class="box-body">
{# transaction information (optional) #}
{{ CurrencyForm.currencyListEmpty('foreign_currency_id', array.transactions[0].foreign_currency_id) }}
{{ ExpandedForm.amountNoCurrency('foreign_amount', array.transactions[0].foreign_amount) }}
{# BUDGET ONLY WHEN CREATING A WITHDRAWAL #}
{% if budgets|length > 1 %}
{{ ExpandedForm.select('budget_id', budgets, array.transactions[0].budget_id) }}
{% else %}
{{ ExpandedForm.select('budget_id', budgets, array.transactions[0].budget_id, {helpText: trans('firefly.no_budget_pointer', {link: route('budgets.index')})}) }}
{#budgets#}
{% endif %}
{# CATEGORY ALWAYS #}
{{ ExpandedForm.text('category',array.transactions[0].category_name) }}
{# BILL ONLY WHEN CREATING A WITHDRAWAL #}
{% if bills|length > 1 %}
{{ ExpandedForm.select('bill_id', bills, array.transactions[0].bill_id) }}
{% else %}
{{ ExpandedForm.select('bill_id', bills, array.transactions[0].bill_id, {helpText: trans('firefly.no_bill_pointer', {link: route('bills.index')})}) }}
{% endif %}
{# TAGS #}
{{ ExpandedForm.text('tags', array.transactions[0].tags) }}
{# RELATE THIS TRANSFER TO A PIGGY BANK #}
{{ PiggyBankForm.piggyBankList('piggy_bank_id',array.transactions[0].piggy_bank_id) }}
</div>
</div>
</div>
</div>
{# row with submit stuff. #}
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'options'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.optionsList('update','recurrence') }}
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">
{{ ('update_recurrence')|_ }}
</button>
</div>
</div>
</div>
</div>
{#
<div class="row">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'expected_repetitions'|_ }}</h3>
</div>
<div class="box-body">
Here.
</div>
</div>
</div>
</div>
</div>
#}
</form>
{# calendar modal #}
<div class="modal fade" id="calendarModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{ 'recurring_calendar_view'|_ }}</h4>
</div>
<div class="modal-body">
<div id="recurring_calendar" style="max-width: 400px;margin: 0 auto;">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="v1/js/lib/modernizr-custom.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/typeahead/typeahead.bundle.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/common/autocomplete.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/bootstrap-tagsinput.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/jquery-ui.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/lib/fc/fullcalendar.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var transactionType = "{{ preFilled.transaction_type }}";
var suggestUri = "{{ route('recurring.suggest') }}";
var eventsUri = "{{ route('recurring.events') }}";
var currentRepType = "{{ currentRepType }}";
</script>
<script type="text/javascript" src="v1/js/ff/recurring/edit.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}
{% block styles %}
<link href="v1/css/bootstrap-tagsinput.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
<link href="v1/css/jquery-ui/jquery-ui.structure.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
<link href="v1/css/jquery-ui/jquery-ui.theme.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
<link href="v1/lib/fc/fullcalendar.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
{% endblock %}

View File

@@ -0,0 +1,166 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
{% endblock %}
{% block content %}
<!-- block with list of recurring transaction -->
{% if total > 0 %}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ 'recurrences'|_ }}
</h3>
<div class="box-tools pull-right">
<div class="btn-group">
<button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><span class="fa fa-ellipsis-v"></span></button>
<ul class="dropdown-menu" role="menu">
<li><a href="{{ route('recurring.create') }}"><span class="fa fa-plus fa-fw"></span> {{ ('make_new_recurring')|_ }}</a></li>
</ul>
</div>
</div>
</div>
<div class="box-body no-padding">
<div style="padding:8px;">
<a href="{{ route('recurring.create') }}" class="btn btn-success"><span class="fa fa-plus fa-fw"></span> {{ ('make_new_recurring')|_ }}
</a>
</div>
<!-- list of recurring here -->
<div style="padding-left:8px;">
{{ paginator.links('pagination.bootstrap-4')|raw }}
</div>
<table class="table table-responsive table-hover sortable">
<thead>
<tr>
<th class="hidden-sm hidden-xs" data-defaultsort="disabled">&nbsp;</th>
<th data-defaultsign="az">{{ trans('list.title') }}</th>
<th data-defaultsort="disabled">{{ trans('list.transaction_s') }}</th>
<th data-defaultsort="disabled">{{ trans('list.repetitions') }}</th>
<th data-defaultsign="month" data-dateformat="{{ madMomentJS }}">{{ trans('list.next_due') }}</th>
</tr>
</thead>
<tbody>
{% for rt in paginator %}
<tr>
<td class="hidden-sm hidden-xs">
<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) }}"><span
class="fa fa-fw fa-pencil"></span></a><a class="btn btn-danger btn-xs" title="{{ 'delete'|_ }}"
href="{{ route('recurring.delete',rt.id) }}"><span
class="fa fa-fw fa-trash-o"></span></a>
</div>
</td>
<td data-value="{{ rt.title }}">
{% if rt.attachments > 0 %}
<span class="fa fa-fw fa-paperclip"></span>
{% endif %}
{% if rt.active == false %}<s>{% endif %}
{{ rt.type|_ }}:
<a href="{{ route('recurring.show',rt.id) }}">{{ rt.title }}</a>
{% if rt.active == false %}</s> ({{ 'inactive'|_|lower }}){% endif %}
{% if rt.description|length > 0 %}
<small><br>{{ rt.description }}</small>
{% endif %}
</td>
<td data-value="0">
<ol>
{% for rtt in rt.transactions %}
<li>
{# normal amount + comma#}
{{ formatAmountBySymbol(rtt['amount'],rtt['currency_symbol'],rtt['currency_decimal_places']) }}{% if rtt['foreign_amount'] == null %},{% endif %}
{# foreign amount + comma #}
{% if null != rtt['foreign_amount'] %}
({{ formatAmountBySymbol(rtt['foreign_amount'],rtt['foreign_currency_symbol'],rtt['foreign_currency_decimal_places']) }}),
{% endif %}
<a href="{{ route('accounts.show', rtt['source_id']) }}">{{ rtt['source_name'] }}</a>
&rarr;
<a href="{{ route('accounts.show', rtt['destination_id']) }}">{{ rtt['destination_name'] }}</a>
</li>
{% endfor %}
</ol>
</td>
<td>
{% if null != rt.repeat_until and today > rt.repeat_until %}
<span class="text-danger">
{{ trans('firefly.repeat_until_in_past', {date: rt.repeat_until.formatLocalized(monthAndDayFormat) }) }}
</span>
{% endif %}
<ul>
{% for rep in rt.repetitions %}
<li>{{ rep.description }}
{% if rep.repetition_skip == 1 %}
({{ trans('firefly.recurring_skips_one')|lower }}).
{% endif %}
{% if rep.repetition_skip > 1 %}
({{ trans('firefly.recurring_skips_more', {count: rep.repetition_skip})|lower }}).
{% endif %}
{% if rep.weekend == 3 %}
<br>{{ 'will_jump_friday'|_ }}
{% endif %}
{% if rep.weekend == 4 %}
<br>{{ 'will_jump_monday'|_ }}
{% endif %}
{% if rep.weekend == 2 %}
<br>{{ 'except_weekends'|_ }}
{% endif %}
</li>
{% endfor %}
</ul>
<p>
{% if null == rt.repeat_until and rt.repetitions == 0 %}
{{ 'recurring_repeats_forever'|_ }}.
{% endif %}
{% if null != rt.repeat_until and rt.repetitions == 0 %}
{{ trans('firefly.recurring_repeats_until', {date: rt.repeat_until.formatLocalized(monthAndDayFormat)}) }}.
{% endif %}
{% if null == rt.repeat_until and rt.nr_of_repetitions != 0 %}
{{ trans_choice('firefly.recurring_repeats_x_times', rt.nr_of_repetitions) }}.
{% endif %}
</p>
</td>
<td>
<ul>
{% for rep in rt.repetitions %}
{% for occ in rep.occurrences %}
{% if loop.index0 < 2 %}
<li>{{ occ.formatLocalized(monthAndDayFormat) }}</li>
{% endif %}
{% endfor %}
{% endfor %}
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div style="padding-left:8px;">
{{ paginator.links('pagination.bootstrap-4')|raw }}
</div>
</div>
<div class="box-footer">
<a href="{{ route('recurring.create') }}" class="btn btn-success"><span class="fa fa-plus fa-fw"></span> {{ ('make_new_recurring')|_ }}</a>
</div>
</div>
</div>
</div>
{% endif %}
{% if total == 0 and page == 1 %}
{% include 'partials.empty' with {objectType: 'default', type: 'recurring',route: route('recurring.create')} %}
{% endif %}
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="v1/css/bootstrap-sortable.css?v={{ FF_VERSION }}" type="text/css" media="all" nonce="{{ JS_NONCE }}">
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="v1/js/lib/bootstrap-sortable.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}

View File

@@ -0,0 +1,185 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, recurrence) }}
{% endblock %}
{% block content %}
<div class="row">
<!-- basic info -->
<div class="col-lg-8 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ array.title }}
({{ array.type }})
{% if array.active == false %}
({{ 'inactive'|_|lower }})
{% endif %}
</h3>
</div>
<div class="box-body">
<p><em>{{ array.description }}</em></p>
{% if array.active == false %}
<p>
{{ 'recurrence_is_inactive'|_ }}
</p>
{% endif %}
<ul>
{% for rep in array.repetitions %}
<li>{{ rep.description }}</li>
{% endfor %}
</ul>
</div>
<div class="box-footer">
<div class="btn-group">
<a href="{{ route('recurring.edit', [array.id]) }}" class="btn btn-sm btn-default"><span class="fa fa-pencil"></span> {{ 'edit'|_ }}</a>
<a href="{{ route('recurring.delete', [array.id]) }}" class="btn btn-sm btn-danger">{{ 'delete'|_ }} <span class="fa fa-trash"></span></a>
</div>
</div>
</div>
</div>
<!-- next and previous repetitions -->
<div class="col-lg-4 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ ('expected_'~array.type~'s')|_ }}
</h3>
</div>
<div class="box-body">
{% if null != array.repeat_until and today > array.repeat_until %}
<span class="text-danger">
{{ trans('firefly.repeat_until_in_past', {date: array.repeat_until.formatLocalized(monthAndDayFormat) }) }}
</span>
{% endif %}
<ul>
{% for rep in array.repetitions %}
<li>
{{ rep.description }}
{% if rep.repetition_skip == 1 %}
({{ trans('firefly.recurring_skips_one')|lower }})
{% endif %}
{% if rep.repetition_skip > 1 %}
({{ trans('firefly.recurring_skips_more', {count: rep.repetition_skip})|lower }})
{% endif %}
<ul>
{% for occ in rep.occurrences %}
<li>{{ occ.formatLocalized(trans('config.month_and_date_day')) }}</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</div>
<div class="box-footer">
<small>
<em>{{ 'warning_duplicates_repetitions'|_ }}</em>
</small>
</div>
</div>
</div>
</div>
<div class="row">
<!-- transactions -->
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ 'transaction_data'|_ }}
</h3>
</div>
<div class="box-body no-padding">
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsign="az">{{ trans('list.description') }}</th>
<th data-defaultsign="az">{{ trans('list.source') }}</th>
<th data-defaultsign="az">{{ trans('list.destination') }}</th>
<th data-defaultsign="_19">{{ trans('list.amount') }}</th>
<th data-defaultsign="az">{{ trans('list.category') }}</th>
<th data-defaultsign="az">{{ trans('list.budget') }}</th>
<th>{{ trans('list.other_meta_data') }}</th>
</tr>
</thead>
<tbody>
{% for transaction in array.transactions %}
<tr>
<td data-value="{{ transaction.description }}">
{{ transaction.description }}
</td>
<td data-value="{{ transaction.source_name }}">
<a href="{{ route('accounts.show', [transaction.source_id]) }}">{{ transaction.source_name }}</a>
</td>
<td data-value="{{ transaction.destination_name }}">
<a href="{{ route('accounts.show', [transaction.destination_id]) }}">{{ transaction.destination_name }}</a>
</td>
<td>
{{ formatAmountBySymbol(transaction.amount,transaction.currency_symbol,transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount,transaction.foreign_currency_symbol,transaction.foreign_currency_decimal_places) }})
{% endif %}
</td>
<td data-value="{{ transaction.category_id|default(0) }}">
{% if '' != transaction.category_name %}
<a href="{{ route('categories.show', [transaction.category_id]) }}">
{{ transaction.category_name }}
</a>
{% endif %}
</td>
<td data-value="{{ transaction.budget_id|default(0) }}">
{% if '' != transaction.budget_name %}
<a href="{{ route('budgets.show', [transaction.budget_id]) }}">
{{ transaction.budget_name }}
</a>
{% endif %}
</td>
<td>
{% if transaction.tags|length > 0 %}
<p>
{% for tag in transaction.tags %}
<span class="label label-success">{{ tag }}</span>
{% endfor %}
</p>
{% endif %}
{% if 0 != transaction.piggy_bank_id and array.type == 'Transfer' %}
<a href="{{ route('piggy-banks.show', [transaction.piggy_bank_id]) }}">{{ transaction.piggy_bank_name }}</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<!-- meta data -->
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ ('created_'~array.type~'s')|_ }}
</h3>
</div>
<div class="box-body">
{% include 'list.groups' %}
</div>
</div>
</div>
</div>
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="v1/css/bootstrap-sortable.css?v={{ FF_VERSION }}" type="text/css" media="all" nonce="{{ JS_NONCE }}">
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="v1/js/lib/bootstrap-sortable.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{# required for groups.twig #}
<script type="text/javascript" src="v1/js/ff/list/groups.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}