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,97 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, objectType) }}
{% endblock %}
{% block content %}
<!-- set location data high up -->
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var locations = {{ locations|json_encode|raw }};
var mapboxToken = "{{ config('firefly.mapbox_api_key') }}";
</script>
<form action="{{ route('accounts.store') }}" method="post" id="store" class="form-horizontal" enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<input type="hidden" name="objectType" value="{{ objectType }}"/>
<input type="hidden" name="active" value="1"/>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('name') }}
{% if objectType == 'asset' or objectType == 'liabilities' %}
{{ CurrencyForm.currencyList('currency_id', null, {helpText:'account_default_currency'|_}) }}
{% endif %}
{% if objectType == 'liabilities' %}
{{ ExpandedForm.select('liability_type_id', liabilityTypes) }}
{{ ExpandedForm.amountNoCurrency('opening_balance', null, {label:'debt_start_amount'|_}) }}
{{ ExpandedForm.select('liability_direction', liabilityDirections) }}
{{ ExpandedForm.date('opening_balance_date', null, {label:'debt_start_date'|_}) }}
{{ ExpandedForm.percentage('interest') }}
{{ ExpandedForm.select('interest_period', interestPeriods, null, {helpText: 'interest_period_help'|_}) }}
{% endif %}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('iban') }}
{{ ExpandedForm.text('BIC', null, {maxlength: 11}) }}
{{ ExpandedForm.text('account_number') }}
{% if objectType == 'asset' %}
{{ ExpandedForm.amountNoCurrency('opening_balance') }}
{{ ExpandedForm.date('opening_balance_date') }}
{{ ExpandedForm.select('account_role', roles,null,{helpText : 'asset_account_role_help'|_}) }}
{{ ExpandedForm.amountNoCurrency('virtual_balance') }}
{% endif %}
{# only correct way to do active checkbox #}
{{ ExpandedForm.checkbox('include_net_worth', 1) }}
{{ ExpandedForm.textarea('notes',null,{helpText: trans('firefly.field_supports_markdown')}) }}
{{ ExpandedForm.location('location', null, {locations: locations}) }}
{{ 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">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'options'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.optionsList('create','account') }}
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">
{{ ('store_new_' ~ objectType ~ '_account')|_ }}
</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<script src="v1/lib/leaflet/leaflet.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<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/jquery-ui.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/accounts/create.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}
{% block styles %}
<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 rel="stylesheet" href="v1/lib/leaflet/leaflet.css?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}">
{% endblock %}

View File

@@ -0,0 +1,58 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, account) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('accounts.destroy',account.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_account', {'name': account.name}) }}</h3>
</div>
<div class="box-body">
<p class="text-danger">
{{ trans('form.permDeleteWarning') }}
</p>
<p>
{{ trans('form.account_areYouSure', {'name': account.name}) }}
</p>
{% if account.transactions|length > 0 or account.piggyBanks|length > 0 %}
<p>
{% if account.transactions|length > 0 %}
{{ Lang.choice('form.also_delete_transactions', account.transactions|length, {count: account.transactions|length}) }}
{% endif %}<br/>
{% if account.piggyBanks|length > 0 %}
{{ Lang.choice('form.also_delete_piggyBanks', account.piggyBanks|length, {count: account.piggyBanks|length}) }}
{% endif %}
</p>
{% endif %}
{% if account.transactions.count() > 0 and account.accountType.type == 'Asset account' %}
<p class="text-success">
{{ trans_choice('firefly.save_transactions_by_moving', account.transactions|length ) }}
</p>
<p>
{{ Form.select('move_account_before_delete', accountList, null, {class: 'form-control'}) }}
</p>
{% else %}
<input type="hidden" name="move_account_before_delete" value="0"/>
{% endif %}
</div>
<div class="box-footer">
<input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn pull-right btn-danger"/>
<a href="{{ URL.previous() }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,128 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute().getName(), account) }}
{% endblock %}
{% block content %}
<!-- set location data high up -->
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var locations = {{ locations|json_encode|raw }};
var mapboxToken = "{{ config('firefly.mapbox_api_key') }}";
</script>
{{ Form.model(account, {
'class': 'form-horizontal',
'id': 'update',
'url': route('accounts.update',account.id),
'enctype': 'multipart/form-data'
} ) }}
<input type="hidden" name="id" value="{{ account.id }}"/>
<input type="hidden" name="objectType" value="{{ objectType }}"/>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('name') }}
{% if account.accountType.type == 'Default account' or account.accountType.type == 'Asset account' or objectType == 'liabilities' %}
{{ CurrencyForm.currencyList('currency_id', null, {helpText:'account_default_currency'|_}) }}
{% endif %}
{% if objectType == 'liabilities' %}
{{ ExpandedForm.select('liability_type_id', liabilityTypes) }}
{{ ExpandedForm.amountNoCurrency('opening_balance', null, {label:'debt_start_amount'|_, helpText: 'debt_start_amount_help'|_}) }}
{{ ExpandedForm.select('liability_direction', liabilityDirections) }}
{{ ExpandedForm.date('opening_balance_date', null, {label:'debt_start_date'|_}) }}
{{ ExpandedForm.percentage('interest') }}
{{ ExpandedForm.select('interest_period', interestPeriods) }}
{% endif %}
</div>
</div>
</div>
<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">{{ 'optionalFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('iban') }}
{{ ExpandedForm.text('BIC', null, {maxlength: 11}) }}
{% if preFilled.account_role == 'ccAsset' %}
{{ ExpandedForm.text('account_number', null , {label:trans('form.creditCardNumber')}) }}
{% else %}
{{ ExpandedForm.text('account_number') }}
{% endif %}
{% if account.accounttype.type == 'Default account' or account.accounttype.type == 'Asset account' %}
{# get opening balance entry for this thing! #}
{{ ExpandedForm.amountNoCurrency('opening_balance',null) }}
{{ ExpandedForm.date('opening_balance_date') }}
{{ ExpandedForm.select('account_role', roles) }}
{{ ExpandedForm.amountNoCurrency('virtual_balance',null) }}
{% endif %}
{{ ExpandedForm.checkbox('include_net_worth', 1) }}
{{ ExpandedForm.textarea('notes',preFilled.notes,{helpText: trans('firefly.field_supports_markdown')}) }}
{# only correct way to do active checkbox #}
{{ ExpandedForm.checkbox('active', 1) }}
{# only correct way to do active checkbox #}
{{ ExpandedForm.location('location', null, {locations: locations}) }}
{{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
</div>
</div>
{# panel for credit card options #}
{% if preFilled.account_role == 'ccAsset' %}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'credit_card_options'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.select('cc_type',Config.get('firefly.ccTypes')) }}
{{ ExpandedForm.date('cc_monthly_payment_date',null,{'helpText' : trans('firefly.cc_monthly_payment_date_help')}) }}
</div>
</div>
{% endif %}
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
{# panel for options #}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'options'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.optionsList('update','account') }}
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">
{{ ('update_' ~ objectType ~ '_account')|_ }}
</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<script src="v1/lib/leaflet/leaflet.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<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/jquery-ui.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/accounts/edit.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}
{% block styles %}
<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 rel="stylesheet" href="v1/lib/leaflet/leaflet.css?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}">
{% endblock %}

View File

@@ -0,0 +1,83 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, objectType) }}
{% endblock %}
{% block content %}
{% if accounts.count() > 0 %}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box" id="account-index-{{ objectType }}">
<div class="box-header with-border">
<h3 class="box-title">
{{ subTitle }}
</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('accounts.create', objectType) }}"><span
class="fa fa-plus fa-fw"></span> {{ ('make_new_' ~ objectType ~ '_account')|_ }}
</a></li>
</ul>
</div>
</div>
</div>
<div class="box-body no-padding">
<div style="padding:8px;">
<a href="{{ route('accounts.create', objectType) }}" class="btn btn-success"><span class="fa fa-plus fa-fw"></span> {{ ('make_new_' ~ objectType ~ '_account')|_ }}</a>
</div>
{% include 'list.accounts' %}
</div>
<div class="box-footer">
<p>
<a href="{{ route('accounts.create', objectType) }}" class="btn btn-success"><span
class="fa fa-plus fa-fw"></span> {{ ('make_new_' ~ objectType ~ '_account')|_ }}</a>
</p>
{% if inactiveCount > 0 %}
<p><small>
<em>
<a href="{{ route('accounts.inactive.index', objectType) }}" class="text-muted">
{{ trans_choice('firefly.inactive_account_link', inactiveCount) }}
</a>
</em>
</small>
</p>
{% endif %}
{% if inactivePage %}
<p><small class="text-muted">
<em>
{{ 'all_accounts_inactive'|_ }}
<a href="{{ route('accounts.index', objectType) }}">
{{ trans('firefly.active_account_link', {count: inactiveCount}) }}
</a>
</em>
</small>
</p>
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}
{% if accounts.count() == 0 and page == 1 %}
{% include 'partials.empty' with {objectType: objectType, type: 'accounts',route: route('accounts.create', [objectType])} %}
{% endif %}
{% endblock %}
{% block styles %}
{% endblock %}
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var objectType = '{{ objectType|escape }}';
</script>
<script src="v1/js/lib/jquery-ui.min.js?v={{ FF_VERSION }}" type="text/javascript" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" nonce="{{ JS_NONCE }}" src="v1/js/ff/accounts/index.js?v={{ FF_VERSION }}"></script>
{% endblock %}

View File

@@ -0,0 +1,119 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, journal) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('accounts.reconcile.update',journal.id) }}" accept-charset="UTF-8" class="form-horizontal" id="update"
enctype="multipart/form-data">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<input type="hidden" name="id" value="{{ journal.id }}"/>
{% if errors.all|length > 0 %}
<div class="row">
<div class="col-lg-12">
<h3 class="text-danger">{{ 'errors'|_ }}</h3>
<ul>
{% for err in errors.all %}
<li class="text-danger">{{ err }}</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
{# ALWAYS AVAILABLE #}
{{ ExpandedForm.staticText('description',journal.description) }}
{# ALWAYS SHOW AMOUNT #}
{{ ExpandedForm.nonSelectableAmount('amount',data.amount, {'currency' : data.currency}) }}
{# ALWAYS SHOW DATE #}
{{ ExpandedForm.staticText('date',journal.date.formatLocalized(monthAndDayFormat)) }}
</div>
</div>
</div>
<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">{{ 'optionalFields'|_ }}</h3>
</div>
<div class="box-body">
{# category always #}
{{ ExpandedForm.text('category',data.category) }}
{# tags #}
{{ ExpandedForm.text('tags') }}
</div>
</div>
{# box for attachments #}
{% if optionalFields.attachments %}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optional_field_attachments'|_ }}</h3>
</div>
<div class="box-body">
{% if optionalFields.attachments %}
{# attachments #}
{{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
{% endif %}
</div>
</div>
{% endif %}
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
{# panel for options #}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'options'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.optionsList('update','transaction') }}
</div>
<div class="box-footer">
<button type="submit" class="pull-right btn btn-success">{{ ('update_reconciliation')|_ }}</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var what = "{{ what }}";
</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/js/lib/modernizr-custom.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/jscript/accounts?ext=.js&amp;v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/jscript/currencies?ext=.js&amp;v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript">
var journal = {{ journal.toArray()|json_encode|raw }};
var journalData = {{ data|json_encode|raw }};
</script>
<script type="text/javascript" src="v1/js/ff/accounts/edit-reconciliation.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 }}">
{% endblock %}

View File

@@ -0,0 +1,137 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, account, start, end) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'reconcile_range'|_ }}</h3>
</div>
<div class="box-body no-padding">
<table class="table table-hover">
<thead>
<tr>
<th colspan="2" style="width:50%;">{{ 'start_balance'|_ }}</th>
<th colspan="2">{{ 'end_balance'|_ }}</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width:25%;">
{{ 'date'|_ }}
</td>
<td style="width:25%;">
{{ 'balance'|_ }}
</td>
<td style="width:25%;">
{{ 'date'|_ }}
</td>
<td style="width:25%;">
{{ 'balance'|_ }}
</td>
</tr>
<tr>
<td>
<div class="input-group">
<div class="input-group-addon">
<span class="fa fa-calendar"></span>
</div>
<input type="date" value="{{ start.format('Y-m-d') }}" name="start_date" class="form-control">
</div>
</td>
<td>
<div class="input-group">
<span class="input-group-addon non-selectable-currency-symbol">{{ currency.symbol }}</span>
<input type="number" value="{{ startBalance }}" name="start_balance" class="form-control">
</div>
</td>
<td>
<div class="input-group">
<div class="input-group-addon">
<span class="fa fa-calendar"></span>
</div>
<input type="date" value="{{ end.format('Y-m-d') }}" name="end_date" class="form-control">
</div>
</td>
<td>
<div class="input-group">
<span class="input-group-addon non-selectable-currency-symbol">{{ currency.symbol }}</span>
<input type="number" value="{{ endBalance }}" name="end_balance" class="form-control">
</div>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3">
<div class="update_balance_instruction">
{{ 'update_balance_dates_instruction'|_ }}
</div>
<div class="select_transactions_instruction" style="display:none;">
{{ 'select_transactions_instruction'|_ }}
</div>
<div class="date_change_warning text-danger" style="display:none;">
{{ 'date_change_instruction'|_ }}
</div>
</td>
<td>
<a href="#" class="btn btn-default start_reconcile">{{ 'start_reconcile'|_ }}</a>
<a href="#" class="btn btn-default change_date_button" style="display: none;">{{ 'update_selection'|_ }}</a>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'reconcile_options'|_ }}</h3>
</div>
<div class="box-body">
<p class="lead" id="difference"></p>
<div class="btn-group">
<button class="btn btn-default store_reconcile" disabled><span class="fa fa-fw fa-check"></span> {{ 'store_reconcile'|_ }}</button>
</div>
</div>
</div>
</div>
</div>
<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">{{ 'transactions'|_ }}</h3>
</div>
<div class="box-body">
<div id="transactions_holder">
<p class="text-center lead">{{ 'select_range_and_balance'|_ }}</p>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
currencySymbol = "{{ currency.symbol }}";
var accountID = {{ account.id }};
var startBalance = {{ startBalance }};
var endBalance = {{ endBalance }};
var transactionsUri = '{{ transactionsUri }}';
var overviewUri = '{{ overviewUri }}';
var indexUri = '{{ indexUri }}';
var selectRangeAndBalance = '{{ 'select_range_and_balance'|_|escape('js') }}';
</script>
<script src="v1/js/ff/accounts/reconcile.js?v={{ FF_VERSION }}" type="text/javascript" nonce="{{ JS_NONCE }}"></script>
{% endblock %}

View File

@@ -0,0 +1,107 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span>&times;</span><span class="sr-only">{{ 'close'|_ }}</span>
</button>
<h4 class="modal-title">
{{ 'overview_of_reconcile_modal'|_ }}
</h4>
</div>
<form style="display: inline;" class="form-horizontal" id="income" action="{{ route }}" method="POST">
<div class="modal-body">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<input type="hidden" name="start" value="{{ start.format('Y-m-d') }}"/>
<input type="hidden" name="end" value="{{ end.format('Y-m-d') }}"/>
<input type="hidden" name="startBalance" value="{{ startBalance }}"/>
<input type="hidden" name="endBalance" value="{{ endBalance }}"/>
{% for id in selectedIds %}
<input type="hidden" name="journals[]" value="{{ id }}"/>
{% endfor %}
<table class="table table-striped table-bordered">
<tr>
<td>{{ 'submitted_start_balance'|_ }} ({{ start.formatLocalized(monthAndDayFormat) }})</td>
<td>{{ formatAmountByAccount(account, startBalance) }}</td>
</tr>
<tr>
<td>{{ trans('firefly.selected_transactions', {count: selectedIds|length}) }}</td>
<td>{{ formatAmountByAccount(account, amount) }}</td>
</tr>
<tr>
<td>{{ trans('firefly.already_cleared_transactions', {count: countCleared}) }}</td>
<td>{{ formatAmountByAccount(account, clearedAmount) }}</td>
</tr>
<tr>
<td>{{ 'submitted_end_balance'|_ }} ({{ end.formatLocalized(monthAndDayFormat) }})</td>
<td>{{ formatAmountByAccount(account, endBalance) }}</td>
</tr>
<tr>
<td>{{ 'sum_of_reconciliation'|_ }}</td>
<td>{{ formatAmountByAccount(account, reconSum) }}</td>
</tr>
<tr>
<td>{{ 'difference'|_ }}</td>
<td>
{{ formatAmountByAccount(account, difference) }}
<input type="hidden" name="difference" value="{{ difference }}"/>
</td>
</tr>
</table>
<p>
{% if diffCompare > 0 %}
{{ 'reconcile_has_more'|_ }}
{% endif %}
{% if diffCompare < 0 %}
{{ 'reconcile_has_less'|_ }}
{% endif %}
</p>
{% if diffCompare == 0 %}
<p>
{{ 'reconcile_is_equal'|_ }}
</p>
<input type="hidden" name="reconcile" value="nothing">
{% endif %}
{% if diffCompare != 0 %}
<div class="form-group">
<div class="col-lg-12">
<div class="radio">
<label>
<input type="radio" name="reconcile" value="create">
{% if diffCompare > 0 %}
{{ trans('firefly.create_neg_reconcile_transaction', {amount: formatAmountByAccount(account, (difference*-1))})|raw }}
{% endif %}
{% if diffCompare < 0 %}
{{ trans('firefly.create_pos_reconcile_transaction', {amount: formatAmountByAccount(account, (difference*-1))})|raw }}
{% endif %}
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-lg-12">
<div class="radio">
<label>
<input type="radio" checked name="reconcile" value="nothing"> {{ 'reconcile_do_nothing'|_ }}
</label>
</div>
</div>
</div>
<p>
{{ 'reconcile_go_back'|_ }}
</p>
{% endif %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>
<button type="submit" class="btn btn-primary">{{ 'confirm_reconciliation'|_ }}</button>
</div>
</form>
</div>
</div>

View File

@@ -0,0 +1,109 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, account, journal) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'transaction_journal_information'|_ }}</h3>
<div class="box-tools pull-right">
<div class="btn-group">
<button id="transaction_menu" 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('transactions.edit',journal.id) }}"><span class="fa fa-pencil fa-fw"></span> {{ 'edit'|_ }}</a></li>
<li><a href="{{ route('transactions.delete',journal.id) }}"><span class="fa fa-trash fa-fw"></span> {{ 'delete'|_ }}</a></li>
</ul>
</div>
</div>
</div>
<div class="box-body no-padding">
<table class="table table-hover">
<tbody>
<tr>
<td>{{ trans('list.type') }}</td>
<td>{{ journal.transactiontype.type|_ }}</td>
</tr>
<tr>
<td>{{ trans('list.description') }}</td>
<td>{{ journal.description }}</td>
</tr>
{# total amount #}
<tr>
<td>{{ 'total_amount'|_ }}</td>
<td>
{{ formatAmountByAccount(transaction.account, transaction.amount) }}
</td>
</tr>
<tr>
<td style="width:30%;">{{ trans('list.date') }}</td>
<td>{{ journal.date.formatLocalized(monthAndDayFormat) }}</td>
</tr>
</tbody>
</table>
</div>
<div class="box-footer">
<div class="pull-right">
<div class="btn-group">
<a class="btn btn-default" href="{{ route('transactions.edit',journal.id) }}"><span class="fa fa-pencil fa-fw"></span> {{ 'edit'|_ }}</a>
<a href="{{ route('transactions.delete',journal.id) }}" class="btn btn-danger"><span class="fa fa-trash fa-fw"></span> {{ 'delete'|_ }}
</a>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'transaction_journal_meta'|_ }}</h3>
</div>
<div class="box-body no-padding">
<table class="table table-responsive table-hover">
<tbody>
{#
<tr>
<td>{{ 'categories'|_ }}</td>
<td>{{ journalCategories(journal)|raw }}</td>
</tr>
#}
{% if journal.tags|length > 0 %}
<tr>
<td>{{ 'tags'|_ }}</td>
<td>
{% for tag in journal.tags %}
<h4 style="display: inline;"><a class="label label-success" href="{{ route('tags.show',tag) }}">
{% if tag.tagMode == 'nothing' %}
<span class="fa fa-fw fa-tag"></span>
{% endif %}
{% if tag.tagMode == 'balancingAct' %}
<span class="fa fa-fw fa-refresh"></span>
{% endif %}
{% if tag.tagMode == 'advancePayment' %}
<span class="fa fa-fw fa-sort-numeric-desc"></span>
{% endif %}
{{ tag.tag }}</a>
</h4>
{% endfor %}
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
{% endblock %}

View File

@@ -0,0 +1,176 @@
<table class="table table-striped table-condensed">
<thead>
<tr class="ignore">
<th class="hidden-xs" colspan="2">&nbsp;</th>
<th>{{ trans('list.description') }}</th>
<th style="text-align:right;">{{ trans('list.amount') }}</th>
<th class="hidden-xs hidden-sm hidden-md">{{ trans('list.reconcile') }}</th>
<th class="hidden-xs hidden-sm">{{ trans('list.date') }}</th>
<th class="hidden-xs hidden-sm hidden-md">{{ trans('list.from') }}</th>
<th class="hidden-xs hidden-sm hidden-md">{{ trans('list.to') }}</th>
<th class="hidden-xs"><span class="fa fa-pie-chart fa-fw" title="{{ trans('list.budget') }}"></span></th>
<th class="hidden-xs"><span class="fa fa-bookmark fa-fw" title="{{ trans('list.category') }}"></span></th>
</tr>
</thead>
<tbody>
{# data for previous/next markers #}
{% set endSet = false %}
{% set startSet = false %}
{% for journal in journals %}
{# start marker #}
{% if journal.date < start and startSet == false %}
<tr>
<td colspan="4">
&nbsp;
</td>
<td>
<input type="checkbox" class="check_all_btn">
</td>
<td colspan="3">
<span class="label label-default">
{{ trans('firefly.start_of_reconcile_period', {period: start.formatLocalized(monthAndDayFormat) }) }}
</span>
</td>
<td colspan="2">
&nbsp;
</td>
</tr>
{% set startSet = true %}
{% endif %}
{# end marker #}
{% if journal.date <= end and endSet == false %}
<tr>
<td colspan="4">
&nbsp;
</td>
<td>
<input type="checkbox" class="check_all_btn">
</td>
<td colspan="3">
<span class="label label-default">
{{ trans('firefly.end_of_reconcile_period', {period: end.formatLocalized(monthAndDayFormat) }) }}
</span>
</td>
<td colspan="2">
&nbsp;
</td>
</tr>
{% set endSet = true %}
{% endif %}
<tr data-date="{{ journal.date.format('Y-m-d') }}" data-id="{{ journal.transaction_journal_id }}">
<td class="hidden-xs">
<div class="btn-group btn-group-xs">
<a href="{{ route('transactions.edit', [journal.transaction_group_id]) }}" class="btn btn-xs btn-default"><span
class="fa fa-fw fa-pencil"></span></a>
</div>
</td>
<!-- icon -->
<td class="hidden-xs">
{% if journal.transaction_type_type == 'Withdrawal' %}
<span class="fa fa-long-arrow-left fa-fw" title="{{ trans('firefly.Withdrawal') }}"></span>
{% endif %}
{% if journal.transaction_type_type == 'Deposit' %}
<span class="fa fa-long-arrow-right fa-fw" title="{{ trans('firefly.Deposit') }}"></span>
{% endif %}
{% if journal.transaction_type_type == 'Transfer' %}
<span class="fa fa-exchange fa-fw" title="{{ trans('firefly.Deposit') }}"></span>
{% endif %}
{% if journal.transaction_type_type == 'Reconciliation' %}
<span class="fa-fw fa fa-calculator" title="{{ trans('firefly.reconciliation_transaction') }}"></span>
{% endif %}
{% if journal.transaction_type_type == 'Opening balance' %}
<span class="fa-fw fa fa-star-o" title="{{ trans('firefly.Opening balance') }}"></span>
{% endif %}
</td>
<!-- description -->
<td>
<a href="{{ route('transactions.show', [journal.transaction_group_id]) }}" title="{{ journal.description }}">
{% if journal.group_title %}
<span class="text-muted"><span class="fa fa-fw fa-share-alt" aria-hidden="true"></span></span> {{ journal.group_title }}:
{% endif %}
{{ journal.description }}</a>
</td>
<td style="text-align: right;">
<span style="margin-right:5px;">
{{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %}
</span>
</td>
<td>
{% if journal.date >= start and journal.date <= end %}
{% if journal.reconciled %}
<span class="fa fa-check" aria-hidden="true"></span>
<input type="hidden" name="cleared[]" data-younger="{% if journal.date < start %}true{% else %}false{% endif %}"
data-inrange="{% if journal.date >= start and journal.date <= end %}true{% else %}false"{% endif %}"
class="cleared" data-id="{{ journal.transaction_journal_id }}" value="{{ journal.amount }}">
{% else %}
<input type="checkbox" name="reconciled[]"
data-younger="{% if journal.date < start %}true{% else %}false{% endif %}"
data-inrange="{% if journal.date >= start and journal.date <= end %}true{% else %}false"{% endif %}"
value="{{ journal.amount }}" data-id="{{ journal.transaction_journal_id }}" disabled class="reconcile_checkbox">
{% endif %}
{% else %}
<!-- if not in range, just show reconciliation status -->
{% if journal.reconciled %}
<span class="fa fa-check" aria-hidden="true"></span>
{% else %}
<!-- See reference nr. 1 -->
{% endif %}
{% endif %}
</td>
<td class="hidden-sm hidden-xs">
{{ journal.date.formatLocalized(monthAndDayFormat) }}
</td>
<td class="hidden-xs hidden-sm hidden-md">
<a href="{{ route('accounts.show', [journal.source_account_id]) }}" title="{{ journal.source_account_iban|default(journal.source_account_name) }}">{{ journal.source_account_name }}</a>
</td>
<td class="hidden-xs hidden-sm hidden-md">
<a href="{{ route('accounts.show', [journal.destination_account_id]) }}" title="{{ journal.destination_account_iban|default(journal.destination_account_name) }}">{{ journal.destination_account_name }}</a>
</td>
{#
<td class="hidden-xs">
{{ transaction|transactionBudgets }}
</td>
<td class="hidden-xs">
{{ transaction|transactionCategories }}
</td>
#}
</tr>
{% endfor %}
{# if the start marker has not been generated yet, do it now, at the end of the loop. #}
{% if startSet == false %}
<tr>
<td colspan="5">
&nbsp;
</td>
<td colspan="3">
<span class="label label-default">
{{ trans('firefly.start_of_reconcile_period', {period: start.formatLocalized(monthAndDayFormat) }) }}
</span>
</td>
<td colspan="2">
&nbsp;
</td>
</tr>
{% set startSet = true %}
{% endif %}
</tbody>
</table>

View File

@@ -0,0 +1,220 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, account, start, end) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="{% if attachments.count() == 0 %}col-lg-12 col-md-12 col-sm-12 col-xs-12{% else %}col-lg-8 col-md-6 col-sm-12 col-xs-12{% endif %}">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ trans('firefly.chart_account_in_period', {
balance: formatAmountBySymbol(balance, currency.symbol, currency.decimal_places, true),
name: account.name|escape, start: start.formatLocalized(monthAndDayFormat), end: end.formatLocalized(monthAndDayFormat) })|raw }}
</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('accounts.edit', account.id) }}"><span class="fa fa-pencil fa-fw"></span> {{ 'edit'|_ }}</a></li>
<li><a href="{{ route('accounts.delete', account.id) }}"><span class="fa fa-trash fa-fw"></span> {{ 'delete'|_ }}</a></li>
</ul>
</div>
</div>
</div>
<div class="box-body">
<div>
<canvas id="overview-chart" style="width:100%;height:400px;" height="400" width="100%"></canvas>
</div>
</div>
</div>
</div>
{% if attachments.count() > 0 %}
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ 'attachments'|_ }}
</h3>
</div>
<div class="box-body no-padding">
{% include 'list.attachments' %}
</div>
</div>
</div>
{% endif %}
</div>
{% if not showAll and isLiability %}
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">pay-off by date</h3>
</div>
<div class="box-body">
Content
</div>
</div>
</div>
</div>
{% endif %}
{% if not showAll and not isLiability %}
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'expenses_by_category'|_ }}</h3>
</div>
<div class="box-body">
<div style="width:100%;margin:0 auto;">
<canvas id="account-cat-out" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'expenses_by_budget'|_ }}</h3>
</div>
<div class="box-body">
<div style="width:100%;margin:0 auto;">
<canvas id="account-budget-out" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'income_by_category'|_ }}</h3>
</div>
<div class="box-body">
<div style="width:100%;margin:0 auto;">
<canvas id="account-cat-in" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
</div>
</div>
{% endif %}
<div class="row">
{% if(location) %}
<div class="col-lg-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'location'|_ }}</h3>
</div>
<div class="box-body">
<div id="location_map" style="width:100%;height:300px;"></div>
</div>
</div>
</div>
{% endif %}
{% if account.notes.count() == 1 %}
<div class="col-lg-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'notes'|_ }}</h3>
</div>
<div class="box-body">
{{ account.notes.first().text|markdown }}
</div>
</div>
</div>
{% endif %}
</div>
<div class="row">
<div class="{% if periods|length > 0 %}col-lg-10 col-md-8 col-sm-12{% else %}col-lg-12 col-md-12 col-sm-12{% endif %}">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'transactions'|_ }} ({{ formatAmountBySymbol(balance, currency.symbol, currency.decimal_places, true)|raw }})</h3>
</div>
<div class="box-body">
{% if account.accountType.type == 'Asset account' %}
{% set showReconcile = true %}
{% else %}
{% set showReconcile = false %}
{% endif %}
{% include 'list.groups' %}
<p>
<span class="fa fa-calendar"></span>
{% if periods|length > 0 %}
<a href="{{ route('accounts.show.all', [account.id]) }}">
{{ 'show_all_no_filter'|_ }}
</a>
{% else %}
<a href="{{ route('accounts.show', [account.id]) }}">
{{ 'show_the_current_period_and_overview'|_ }}
</a>
{% endif %}
</p>
</div>
</div>
</div>
{% if periods|length > 0 %}
<div class="col-lg-2 col-md-4 col-sm-12 col-xs-12">
{% include 'list.periods' %}
</div>
{% endif %}
</div>
{% endblock %}
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var doPlaceMarker = false;
// location stuff
{% if location %}
var latitude = {{ location.latitude|default("52.3167") }};
var longitude = {{ location.longitude|default("5.5500") }};
var zoomLevel = {{ location.zoom_level|default("6") }};
doPlaceMarker = true;
// token for Mapbox:
var mapboxToken = "{{ config('firefly.mapbox_api_key') }}";
{% endif %}
var showAll = true;
currencySymbol = "{{ currency.symbol }}";
var accountID = {{ account.id }};
var chartUri = '{{ chartUri }}';
{% if not showAll %}
showAll = false;
// uri's for charts:
var incomeCategoryUri = '{{ route('chart.account.income-category', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';
var expenseCategoryUri = '{{ route('chart.account.expense-category', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';
var expenseBudgetUri = '{{ route('chart.account.expense-budget', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';
var drawVerticalLine = '';
{# render vertical line with text "today" #}
{% if start.lte(today) and end.gte(today) %}
drawVerticalLine = '{{ today.formatLocalized(monthAndDayFormat) }}';
{% endif %}
{% endif %}
</script>
{% if location %}
<script src="v1/lib/leaflet/leaflet.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endif %}
<script type="text/javascript" src="v1/js/lib/Chart.bundle.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/chartjs-plugin-annotation.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/charts.defaults.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/charts.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script src="v1/js/lib/jquery-ui.min.js?v={{ FF_VERSION }}" type="text/javascript" nonce="{{ JS_NONCE }}"></script>
<script src="v1/js/lib/jquery.color-2.1.2.min.js?v={{ FF_VERSION }}" type="text/javascript" nonce="{{ JS_NONCE }}"></script>
<script src="v1/js/ff/accounts/show.js?v={{ FF_VERSION }}" type="text/javascript" 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 %}
{% block styles %}
{% if location %}
<link rel="stylesheet" href="v1/lib/leaflet/leaflet.css?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}">
{% endif %}
{% endblock %}