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,199 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, journals) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('transactions.bulk.update') }}" accept-charset="UTF-8" class="form-horizontal" id="update">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mass_bulk_journals'|_ }}</h3>
</div>
<div class="box-body">
<p>
{{ 'mass_bulk_journals_explain'|_ }}
</p>
<div class="row">
<div class="col-lg-8 col-md-12 col-sm-12 col-xs-12">
<table class="table table-striped table-condensed">
<thead>
<tr>
<th>{{ trans('list.description') }}</th>
<th>{{ trans('list.amount') }}</th>
<th>{{ trans('list.date') }}</th>
<th>{{ trans('list.category') }}</th>
<th>{{ trans('list.budget') }}</th>
<th>{{ trans('list.tags') }}</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for journal in journals %}
<input type="hidden" name="journals[]" value="{{ journal.transaction_journal_id }}"/>
<tr>
<td>
<a href="{{ route('transactions.show', [journal.transaction_group_id]) }}">
{{ journal.description }}</a></td>
<td>
{% if journal.transaction_type_type == 'Deposit' %}
{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %}
{% elseif journal.transaction_type_type == 'Transfer' %}
<span class="text-info">
{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %}
</span>
{% else %}
{{ 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 %}
{% endif %}
</td>
<td>{{ journal.date.formatLocalized(monthAndDayFormat) }}</td>
<td>
{% if journal.category_id != null %}
<a href="{{ route('categories.show', [journal.category_id]) }}" title="{{ journal.category_name }}">{{ journal.category_name }}</a>
{% endif %}
</td>
<td>
{% if journal.budget_id != null %}
<a href="{{ route('budgets.show', [journal.budget_id]) }}" title="{{ journal.budget_name }}">{{ journal.budget_name }}</a>
{% endif %}
</td>
<td>
{% for tag in journal.tags %}
{% if 0 != tag.id %}
<span style="display: inline;"><a class="label label-success" href="{{ route('tags.show', [tag.id]) }}">
<span class="fa fa-fw fa-tag"></span>
{{ tag.name }}</a>
</span>
{% endif %}
{% endfor %}
</td>
<td>
{% if journal.journals_in_group > 1 %}
<span title="{{ 'part_of_split'|_ }}" class="text-danger fa fa-fw fa-exclamation-triangle"></span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<p>
{{ 'bulk_set_new_values'|_ }}
</p>
<div class="row">
<div class="col-lg-8 col-md-12 col-sm-12 col-xs-12">
<table class="table table-striped table-condensed">
<tr>
<th style="width:25%;">{{ trans('list.category') }}</th>
<td>
<input class="form-control" placeholder="" name="category" autocomplete="off" type="text" value="">
</td>
<td>
<div class="checkbox">
<label>
<input name="ignore_category" type="checkbox" value="1" checked>
{{ 'no_bulk_category'|_ }}
</label>
</div>
</td>
</tr>
<tr>
<th>{{ trans('list.budget') }}</th>
<td>
<select class="form-control" name="budget_id">
{% for id, budget in budgetList %}
<option value="{{ id }}" label="{{ budget }}">{{ budget }}</option>
{% endfor %}
</select>
</td>
<td>
<div class="checkbox">
<label>
<input name="ignore_budget" type="checkbox" value="1" checked>
{{ 'no_bulk_budget'|_ }}
</label>
</div>
</td>
</tr>
<tr>
<th>{{ trans('list.tags') }}</th>
<td>
<input class="form-control" placeholder="" name="tags" autocomplete="off" type="text" value="">
</td>
<td>
<div class="radio">
<label>
<input type="radio" name="tags_action" id="tags_action_do_nothing" value="no_nothing" checked />
{{ 'no_bulk_tags'|_ }}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="tags_action" id="tags_action_do_replace" value="do_replace" />
{{ 'replace_with_these_tags'|_ }}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="tags_action" id="tags_action_do_append" value="do_append" />
{{ 'append_these_tags'|_ }}
</label>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="box-footer">
<div class="row">
<div class="col-lg-8">
<input type="submit" name="submit" value="{{ trans('form.update_all_journals') }}" class="btn btn-success pull-right"/>
<a href="{{ route('index') }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var 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/ff/transactions/mass/edit-bulk.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 }}">
{% endblock %}

View File

@@ -0,0 +1,285 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, group, groupTitle) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('transactions.convert.index.post', [destinationType.type|lower, group.id]) }}" accept-charset="UTF-8"
class="form-horizontal"
enctype="multipart/form-data">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-12 col-sm-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ ('convert_options_'~sourceType.type~destinationType.type)|_ }}</h3>
</div>
<div class="box-body">
<p>
{# ONE: WITHDRAWAL TO DEPOSIT #}
{% if sourceType.type == 'Withdrawal' and destinationType.type == 'Deposit' %}
{{ trans_choice('firefly.convert_expl_w_d', groupArray.transactions|length) }}
{{ trans_choice('firefly.convert_select_sources', groupArray.transactions|length) }}
{% endif %}
{# TWO: WITHDRAWAL TO TRANSFER #}
{% if sourceType.type == 'Withdrawal' and destinationType.type == 'Transfer' %}
{{ trans_choice('firefly.convert_expl_w_t', groupArray.transactions|length) }}
{{ trans_choice('firefly.convert_select_destinations', groupArray.transactions|length) }}
{% endif %}
{# THREE: DEPOSIT TO WITHDRAWAL #}
{% if sourceType.type == 'Deposit' and destinationType.type == 'Withdrawal' %}
{{ trans_choice('firefly.convert_expl_d_w', groupArray.transactions|length) }}
{{ trans_choice('firefly.convert_select_destinations', groupArray.transactions|length) }}
{% endif %}
{# FOUR: DEPOSIT TO TRANSFER#}
{% if sourceType.type == 'Deposit' and destinationType.type == 'Transfer' %}
{{ trans_choice('firefly.convert_expl_d_t', groupArray.transactions|length) }}
{{ trans_choice('firefly.convert_select_sources', groupArray.transactions|length) }}
{% endif %}
{# FIVE: TRANSFER TO WITHDRAWAL #}
{% if sourceType.type == 'Transfer' and destinationType.type == 'Withdrawal' %}
{{ trans_choice('firefly.convert_expl_t_w', groupArray.transactions|length) }}
{{ trans_choice('firefly.convert_select_destinations', groupArray.transactions|length) }}
{% endif %}
{# SIX: TRANSFER TO DEPOSIT #}
{% if sourceType.type == 'Transfer' and destinationType.type == 'Deposit' %}
{{ trans_choice('firefly.convert_expl_t_d', groupArray.transactions|length) }}
{{ trans_choice('firefly.convert_select_sources', groupArray.transactions|length) }}
{% endif %}
</p>
<table class="table">
<tr>
<th style="width:10%;">ID</th>
<th style="width:25%;">Description</th>
<th style="width:25%;">Source account</th>
<th style="width:25%;">Destination account</th>
<th style="width:15%;">Amount</th>
</tr>
{% for transaction in groupArray.transactions %}
<tr>
<td>#{{ transaction.transaction_journal_id }}</td>
<td>{{ transaction.description }}</td>
<td>
{# ONE: WITHDRAWAL TO DEPOSIT #}
{% if sourceType.type == 'Withdrawal' and destinationType.type == 'Deposit' %}
{# NEW DESTINATION = Asset, SOURCE MUST BE [Revenue, Cash, Loan, Debt, Mortgage] #}
{% if transaction.source_type == 'Asset account' %}
{{ Form.select('source_id['~transaction.transaction_journal_id~']', validDepositSources, null, {class: 'form-control'}) }}
{% endif %}
{# NEW DESTINATION = [Loan, Debt, Mortgage], SOURCE MUST BE [Revenue] #}
{% if
transaction.source_type == 'Loan' or
transaction.source_type == 'Debt' or
transaction.source_type == 'Mortgage' %}
<input
autocomplete="off"
placeholder="Source account"
name="source_name[{{ transaction.transaction_journal_id }}]"
type="text"
value="{% if transaction.destination_type != "Cash account" %}{{ preFilled.source_name[transaction.transaction_journal_id]|default(transaction.destination_name) }}{% endif %}"
class="form-control tt-input input-revenue"
spellcheck="false" dir="auto">
{% endif %}
{% endif %}
{# TWO: WITHDRAWAL TO TRANSFER #}
{% if sourceType.type == 'Withdrawal' and destinationType.type == 'Transfer' %}
<a href="{{ route('accounts.show', [transaction.source_id]) }}"
title="{{ transaction.source_iban|default(transaction.source_name) }}">{{ transaction.source_name }}</a>
{# hide source in hidden input #}
<input type="hidden" name="source_id[{{ transaction.transaction_journal_id }}]" value="{{ transaction.source_id }}">
{% endif %}
{# THREE: DEPOSIT TO WITHDRAWAL #}
{% if sourceType.type == 'Deposit' and destinationType.type == 'Withdrawal' %}
<a href="{{ route('accounts.show', [transaction.destination_id]) }}"
title="{{ transaction.destination_iban|default(transaction.destination_name) }}">{{ transaction.destination_name }}</a>
{# hide new source in hidden input #}
<input type="hidden" name="source_id[{{ transaction.transaction_journal_id }}]" value="{{ transaction.destination_id }}">
{% endif %}
{# FOUR: DEPOSIT TO TRANSFER#}
{% if sourceType.type == 'Deposit' and destinationType.type == 'Transfer' %}
{# if new destination is asset, then asset#}
{% if transaction.destination_type == 'Asset account' %}
{{ Form.select('source_id['~transaction.transaction_journal_id~']', assets,null, {class: 'form-control'}) }}
{% endif %}
{% if transaction.destination_type == 'Loan' or
transaction.destination_type == 'Debt' or
transaction.destination_type == 'Mortgage' %}
{{ Form.select('source_id['~transaction.transaction_journal_id~']', liabilities,null, {class: 'form-control'}) }}
{% endif %}
{# if new destination liability, then liability.#}
{% endif %}
{# FIVE: TRANSFER TO WITHDRAWAL #}
{% if sourceType.type == 'Transfer' and destinationType.type == 'Withdrawal' %}
<a href="{{ route('accounts.show', [transaction.source_id]) }}"
title="{{ transaction.source_iban|default(transaction.source_name) }}">{{ transaction.source_name }}</a>
{# hide source in hidden input #}
<input type="hidden" name="source_id[{{ transaction.transaction_journal_id }}]" value="{{ transaction.source_id }}">
{% endif %}
{# SIX: TRANSFER TO DEPOSIT #}
{% if sourceType.type == 'Transfer' and destinationType.type == 'Deposit' %}
{# NEW DESTINATION = Asset, SOURCE MUST BE [Revenue, Cash, Loan, Debt, Mortgage] #}
{% if
transaction.source_type == 'Asset account' %}
{{ Form.select('source_id['~transaction.transaction_journal_id~']', validDepositSources, null, {class: 'form-control'}) }}
{% endif %}
{# NEW DESTINATION = [Debt, Mortgage, Load], SOURCE MUST BE [Revenue] #}
{% if
transaction.source_type == 'Loan' or
transaction.source_type == 'Debt' or
transaction.source_type == 'Mortgage' %}
<input
autocomplete="off"
placeholder="Source account"
name="source_name[{{ transaction.transaction_journal_id }}]"
type="text"
value="{% if transaction.destination_type != "Cash account" %}{{ transaction.source_name }}{% endif %}"
class="form-control tt-input"
spellcheck="false" dir="auto">
{% endif %}
{% endif %}
</td>
<td>
{# ONE: WITHDRAWAL TO DEPOSIT #}
{% if sourceType.type == 'Withdrawal' and destinationType.type == 'Deposit' %}
<a href="{{ route('accounts.show', [transaction.source_id]) }}"
title="{{ transaction.source_iban|default(transaction.source_name) }}">{{ transaction.source_name }}</a>
{# hide destination in hidden input #}
<input type="hidden" name="destination_id[{{ transaction.transaction_journal_id }}]" value="{{ transaction.source_id }}">
{% endif %}
{# TWO: WITHDRAWAL TO TRANSFER #}
{% if sourceType.type == 'Withdrawal' and destinationType.type == 'Transfer' %}
{#if the source is a liability, destination must also be a liability.#}
{% if
transaction.source_type == 'Loan' or
transaction.source_type == 'Debt' or
transaction.source_type == 'Mortgage' %}
{{ Form.select('destination_id['~transaction.transaction_journal_id~']', liabilities, null, {class: 'form-control'}) }}
{% endif %}
{# if the source is an asset, destination can only be an asset. #}
{% if transaction.source_type == 'Asset account' %}
{{ Form.select('destination_id['~transaction.transaction_journal_id~']', assets, null, {class: 'form-control'}) }}
{% endif %}
{% endif %}
{# THREE: DEPOSIT TO WITHDRAWAL #}
{% if sourceType.type == 'Deposit' and destinationType.type == 'Withdrawal' %}
{# if new source is Asset, destination must be [Expense, Loan, Debt or Mortgage] #}
{% if transaction.destination_type == 'Asset account' %}
{{ Form.select('destination_id['~transaction.transaction_journal_id~']', validWithdrawalDests, null, {class: 'form-control'}) }}
{% endif %}
{% if transaction.destination_type == 'Loan' or
transaction.destination_type == 'Debt' or
transaction.destination_type == 'Mortgage' %}
{# if new source is Liability, destination must be expense account. #}
<input
autocomplete="off"
placeholder="Destination account"
name="destination_name[{{ transaction.transaction_journal_id }}]"
type="text"
value="{% if transaction.source_type != "Cash account" %}{{ transaction.source_name }}{% endif %}"
class="form-control tt-input"
spellcheck="false" dir="auto">
{% endif %}
{% endif %}
{# FOUR: DEPOSIT TO TRANSFER#}
{% if sourceType.type == 'Deposit' and destinationType.type == 'Transfer' %}
<a href="{{ route('accounts.show', [transaction.destination_id]) }}"
title="{{ transaction.destination_iban|default(transaction.destination_name) }}">{{ transaction.destination_name }}</a>
{# hide destination in hidden input #}
<input type="hidden" name="destination_id[{{ transaction.transaction_journal_id }}]" value="{{ transaction.destination_id }}">
{% endif %}
{# FIVE: TRANSFER TO WITHDRAWAL #}
{% if sourceType.type == 'Transfer' and destinationType.type == 'Withdrawal' %}
{% if transaction.source_type == 'Asset account' %}
{{ Form.select('destination_id['~transaction.transaction_journal_id~']', validWithdrawalDests, null, {class: 'form-control'}) }}
{% endif %}
{% if transaction.source_type == 'Loan' or
transaction.source_type == 'Debt' or
transaction.source_type == 'Mortgage' %}
<input
autocomplete="off"
placeholder="Destination account"
name="destination_name[{{ transaction.transaction_journal_id }}]"
type="text"
value="{% if transaction.source_type != "Cash account" %}{{ transaction.destination_name }}{% endif %}"
class="form-control tt-input"
spellcheck="false" dir="auto">
{% endif %}
{% endif %}
{# SIX: TRANSFER TO DEPOSIT #}
{% if sourceType.type == 'Transfer' and destinationType.type == 'Deposit' %}
<a href="{{ route('accounts.show', [transaction.destination_id]) }}"
title="{{ transaction.destination_iban|default(transaction.destination_name) }}">{{ transaction.destination_name }}</a>
{# hide destination in hidden input #}
<input type="hidden" name="destination_id[{{ transaction.transaction_journal_id }}]" value="{{ transaction.destination_id }}">
{% endif %}
</td>
<td>
{% if transaction.transaction_type_type == 'Deposit' %}
{{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% elseif transaction.transaction_type_type == 'Transfer' %}
<span class="text-info">{{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places, false) }}
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places, false) }})
{% endif %}</span>
{% else %}
{{ 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 %}
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div>
<div class="box-footer">
<a href="{{ route('transactions.show', group.id) }}" class="btn btn-danger">{{ 'cancel'|_ }}</a>
<button type="submit" id="transaction-btn" class="btn btn-success pull-right">
{{ trans('form.convert_'~sourceType.type) }}
</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<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/transactions/convert.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}

View File

@@ -0,0 +1,20 @@
{% set VUE_SCRIPT_NAME = 'create_transaction' %}
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, objectType) }}
{% endblock %}
{% block content %}
<div id="create_transaction"></div>
{% endblock %}
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var allowedOpposingTypes = {{ allowedOpposingTypes|json_encode|raw }};
var accountToTypes = {{ accountToTypes|json_encode|raw }};
var defaultCurrency = {{ defaultCurrency.toArray()|json_encode|raw }};
var cashAccountId = {{ cash.id }};
var previousUrl = '{{ previousUrl }}';
window.sourceId = {{ sourceId }};
window.destinationId = {{ destinationId }};
</script>
{% endblock %}

View File

@@ -0,0 +1,35 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, group) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('transactions.destroy',group.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-6 col-sm-12">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('form.delete_journal', {'description': group.title|default(journal.description)}) }}</h3>
</div>
<div class="box-body">
<p class="text-danger">
{{ trans('form.permDeleteWarning') }}
</p>
<p>
{{ trans('form.journal_areYouSure', {'description': group.title|default(journal.description)}) }}
</p>
</div>
<div class="box-footer">
<input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn btn-danger pull-right"/>
<a href="{{ previous }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,28 @@
{% set VUE_SCRIPT_NAME = 'edit_transaction' %}
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, transactionGroup) }}
{% endblock %}
{% block content %}
<div id="edit_transaction"></div>
{% endblock %}
{% block definitions %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var allowedOpposingTypes = {{ allowedOpposingTypes|json_encode|raw }};
var accountToTypes = {{ accountToTypes|json_encode|raw }};
var defaultCurrency = {{ defaultCurrency.toArray()|json_encode|raw }};
var allowedSourceDests = {{ allowedSourceDests|json_encode|raw }};
var expectedSourceTypes = {{ expectedSourceTypes|json_encode|raw }};
var cashAccountId = {{ cash.id }};
var previousUrl = '{{ previousUrl }}';
</script>
{% endblock %}
{% block scripts %}
{% endblock %}
{% block styles %}
{% endblock %}

View File

@@ -0,0 +1,140 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, objectType, start, end) }}
{% endblock %}
{% block content %}
{# upper show-all instruction #}
{% if periods|length > 0 %}
<div class="row">
<div class="col-lg-offset-10 col-lg-2 col-md-offset-10 col-md-2 col-sm-12 col-xs-12">
<p class="small text-center"><a href="{{ route('transactions.index.all',[objectType]) }}">{{ 'showEverything'|_ }}</a></p>
</div>
</div>
{% endif %}
{% if periods|length > 0 %}
{% set boxSize = 'col-lg-4 col-md-6 col-sm-12 col-xs-12' %}
<div class="row">
{# for withdrawals, deposits and transfers #}
<div class="{{ boxSize }}">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'categories'|_ }}</h3>
</div>
<div class="box-body">
<canvas id="category_chart" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
{# only for withdrawals #}
{% if objectType == 'withdrawal' %}
<div class="{{ boxSize }}">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'budgets'|_ }}</h3>
</div>
<div class="box-body">
<canvas id="budget_chart" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
{% endif %}
{% if objectType != 'withdrawal' %}
<div class="{{ boxSize }}">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'all_source_accounts'|_ }}</h3>
</div>
<div class="box-body">
<canvas id="source_chart" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
{% endif %}
{# for all #}
<div class="{{ boxSize }}">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'all_destination_accounts'|_ }}</h3>
</div>
<div class="box-body">
<canvas id="destination_chart" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
</div>
{% endif %}
{# list with journals #}
<div class="row">
<div class="{% if periods|length > 0 %}col-lg-10 col-md-10 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">{{ subTitle }}</h3>
</div>
<div class="box-body no-padding">
<div style="padding:8px;">
<a href="{{ route('transactions.create', [objectType]) }}" class="btn btn-success"><span class="fa fa-plus fa-fw"></span> {{ 'create_new_transaction'|_ }}</a>
</div>
{# actual list #}
{% include 'v1.list.groups' %}
</div>
<div class="box-footer">
{# links for other views #}
{% if periods|length > 0 %}
<p>
<span class="fa fa-calendar"></span>
<a href="{{ route('transactions.index.all', [objectType]) }}">{{ 'show_all_no_filter'|_ }}</a>
</p>
{% else %}
<p>
<span class="fa fa-calendar"></span>
<a href="{{ route('transactions.index', [objectType]) }}">{{ 'show_the_current_period_and_overview'|_ }}</a>
</p>
{% endif %}
</div>
</div>
</div>
{# boxes with info #}
{% if periods|length > 0 %}
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
{% include 'v1.list.periods' %}
</div>
{% endif %}
</div>
{# lower show-all instruction #}
{% if periods|length > 0 %}
<div class="row">
<div class="col-lg-offset-10 col-lg-2 col-md-offset-10 col-md-2 col-sm-12 col-xs-12">
<p class="small text-center"><a href="{{ route('transactions.index.all', [objectType]) }}">{{ 'showEverything'|_ }}</a></p>
</div>
</div>
{% endif %}
{% endblock %}
{% block scripts %}
{# required for groups.twig #}
<script type="text/javascript" src="v1/js/ff/list/groups.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var showAll = {% if periods|length > 0 %}false{% else %}true{% endif %};
var categoryChartUri = '{{ route('chart.transactions.categories', [objectType, start.format('Y-m-d'), end.format('Y-m-d')]) }}';
var budgetChartUri = '{{ route('chart.transactions.budgets', [start.format('Y-m-d'), end.format('Y-m-d')]) }}';
var destinationChartUri = '{{ route('chart.transactions.destinationAccounts', [objectType, start.format('Y-m-d'), end.format('Y-m-d')]) }}';
var sourceChartUri = '{{ route('chart.transactions.sourceAccounts', [objectType, start.format('Y-m-d'), end.format('Y-m-d')]) }}';
</script>
<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 type="text/javascript" src="v1/js/ff/transactions/index.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}

View File

@@ -0,0 +1,33 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, link) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('transactions.link.destroy', [link.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-6 col-sm-12">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('firefly.delete_journal_link', {source: link.source.description|escape, destination: link.destination.description|escape, source_link: route('transactions.show', [link.source_id]) , destination_link: route('transactions.show',link.destination_id)})|raw }}</h3>
</div>
<div class="box-body">
<p class="text-danger">
{{ trans('form.permDeleteWarning') }}
</p>
<p>
{{ trans('form.journal_link_areYouSure', {source: link.source.description|escape, destination: link.destination.description|escape, source_link: route('transactions.show', [link.source_id]) , destination_link: route('transactions.show',link.destination_id)})|raw }}
</p>
</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,52 @@
<form action="{{ route('transactions.link.store', [journal.id]) }}" method="post" class="form-horizontal">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="hidden" name="opposing" value="">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{ 'link_to_other_transaction'|_ }}</h4>
</div>
<div class="modal-body" id="helpBody">
<p>{{ 'select_transaction_to_link'|_ }}</p>
<div class="form-group">
<label for="link_type" class="col-sm-4 control-label">{{ 'this_transaction'|_ }}</label>
<div class="col-sm-8">
<select id="link_type" class="form-control" name="link_type">
{% for linkType in linkTypes %}
<option label="{{ journalLinkTranslation('inward', linkType.inward) }}"
value="{{ linkType.id }}_inward">{{ journalLinkTranslation('inward', linkType.inward) }}</option>
<option label="{{ journalLinkTranslation('outward', linkType.outward) }}"
value="{{ linkType.id }}_outward">{{ journalLinkTranslation('outward', linkType.outward) }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group" id="journal-selection">
<label for="selected" class="col-sm-4 control-label">{{ 'selected_transaction'|_ }}</label>
<div class="col-sm-8">
<p class="form-control-static" id="selected-journal">
</p>
</div>
</div>
<div class="form-group" id="journal-selector">
<label for="link_other" class="col-sm-4 control-label">{{ 'transaction'|_ }}</label>
<div class="col-sm-8">
<input type="text" name="link_other" autocomplete="off" id="link_other" value="" class="form-control link-journal">
</div>
</div>
<div class="form-group">
<label for="notes" class="col-sm-4 control-label">{{ 'link_notes'|_ }}</label>
<div class="col-sm-8">
<textarea id="notes" name="notes" class="form-control"></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>
<button type="submit" class="btn btn-primary">{{ 'submit'|_ }}</button>
</div>
</div>
</div>
</form>

View File

@@ -0,0 +1,109 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, journals) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('transactions.mass.destroy') }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-8 coll-offset-md-2 col-sm-12">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mass_delete_journals'|_ }}</h3>
</div>
<div class="box-body">
<p class="text-danger">
{{ trans('form.permDeleteWarning') }}
{{ 'perm-delete-many'|_ }}
</p>
<p>
{{ trans('form.mass_journal_are_you_sure') }}
{{ trans('form.mass_make_selection') }}
</p>
<table class="table table-striped table-condensed">
<tr>
<th>&nbsp;</th>
<th>{{ trans('list.transaction_type') }}</th>
<th>{{ trans('list.description') }}</th>
<th>{{ trans('list.amount') }}</th>
<th class="hidden-sm hidden-xs">{{ trans('list.date') }}</th>
<th class="hidden-xs">{{ trans('list.from') }}</th>
<th class="hidden-xs">{{ trans('list.to') }}</th>
</tr>
{% for journal in journals %}
<tr>
<td>
<input type="checkbox" name="confirm_mass_delete[]" value="{{ journal.transaction_journal_id }}" checked/>
</td>
<td>
{% 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>
<td>
<a href="{{ route('transactions.show',journal.transaction_journal_id) }}"
title="{{ journal.description }}">{{ journal.description }}</a>
</td>
<td>
{% if journal.transaction_type_type == 'Deposit' %}
{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %}
{% elseif journal.transaction_type_type == 'Transfer' %}
<span class="text-info">{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %}
</span>
{% else %}
{{ 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 %}
{% endif %}
</td>
<td>
{{ journal.date.formatLocalized(monthAndDayFormat) }}
</td>
<td>
<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>
<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>
</tr>
{% endfor %}
</table>
</div>
<div class="box-footer">
<input type="submit" name="submit" value="{{ trans('form.delete_all_permanently') }}" class="btn btn-danger pull-right"/>
<a href="{{ route('index') }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,182 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, journals) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('transactions.mass.update') }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mass_edit_journals'|_ }}</h3>
</div>
<div class="box-body">
<p>
{{ 'cannot_edit_other_fields'|_ }}
<span class="text-danger">{{ 'cannot_change_amount_reconciled'|_ }}</span>
</p>
<table class="table table-striped table-condensed">
<tr>
<th class="">&nbsp;</th>
<th class="col-lg-2 col-md-2 col-sm-2">{{ trans('list.description') }}</th>
<th class="col-lg-1 col-md-1 col-sm-1">{{ trans('list.amount') }}</th>
<th class="col-lg-1 col-md-1 col-sm-1">{{ trans('list.date') }}</th>
<th class="col-lg-2 col-md-2 col-sm-2">{{ trans('list.from') }}</th>
<th class="col-lg-2 col-md-2 col-sm-2">{{ trans('list.to') }}</th>
<th class="col-lg-2 col-md-2 col-sm-2">{{ trans('list.category') }}</th>
<th class="col-lg-2 col-md-2 col-sm-2">{{ trans('list.budget') }}</th>
</tr>
{% for journal in journals %}
<tr>
<td>
{# LINK TO EDIT FORM #}
<a href="{{ route('transactions.edit', journal.transaction_group_id) }}" class="btn btn-xs btn-default"><span
class="fa fa-fw fa-pencil"></span></a>
<input type="hidden" name="journals[]" value="{{ journal.transaction_journal_id }}"/>
</td>
<td>
{# DESCRIPTION #}
<input class="form-control input-sm" autocomplete="off"
placeholder="{{ journal.description }}" name="description[{{ journal.transaction_journal_id }}]"
type="text" value="{{ journal.description }}">
</td>
{# AMOUNT #}
<td>
{% if journal.reconciled == false %}
<div class="input-group input-group-sm">
<span class="input-group-addon">{{ journal.currency_symbol }}</span>
<input name="amount[{{ journal.transaction_journal_id }}]" class="form-control" autocomplete="off"
step="any" type="number" value="{{ journal.amount }}">
<input type="hidden" name="transaction_currency_id[{{ journal.transaction_journal_id }}]"
value="{{ journal.currency_id }}">
</div>
{% if journal.foreign_amount %}
{# insert foreign data #}
<div class="input-group input-group-sm">
<span class="input-group-addon">{{ journal.foreign_currency_symbol }}</span>
<input name="foreign_amount[{{ journal.transaction_journal_id }}]" class="form-control" autocomplete="off"
step="any" type="number" value="{{ journal.foreign_amount }}">
<input type="hidden" name="foreign_currency_id[{{ journal.transaction_journal_id }}]"
value="{{ journal.foreign_currency_id }}">
</div>
{% endif %}
{% endif %}
<span class="text-sm">
{% if journal.reconciled != false %}
{% if journal.transaction_type_type == 'Deposit' %}
{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %}
{% elseif journal.transaction_type_type == 'Transfer' %}
<span class="text-info">
{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %}
</span>
{% else %}
{{ 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 %}
{% endif %}
{% endif %}
</span>
</td>
<td>
{# DATE #}
<input class="form-control input-sm" autocomplete="off"
name="date[{{ journal.transaction_journal_id }}]" type="date" value="{{ journal.date|slice(0,10) }}">
</td>
<!-- {{ journal.transaction_type_type }} -->
<!-- Source: {{ journal.source_account_name }} ({{ journal.source_account_id }}) -->
<!-- Destination: {{ journal.destination_account_name }} ({{ journal.destination_account_id }}) -->
<td style="position: relative;">
{# SOURCE ACCOUNT ID FOR TRANSFER OR WITHDRAWAL #}
{% if journal.transaction_type_type == 'Transfer' or journal.transaction_type_type == 'Withdrawal' %}
<select class="form-control input-sm" name="source_id[{{ journal.transaction_journal_id }}]">
{% for account in withdrawalSources %}
<option value="{{ account.id }}"{% if account.id == journal.source_account_id %} selected{% endif %}
label="{{ account.name }}">{{ account.name }}</option>
{% endfor %}
</select>
{% endif %}
{# SOURCE ACCOUNT NAME FOR DEPOSIT #}
{% if journal.transaction_type_type == 'Deposit' %}
<input class="form-control input-sm"
placeholder="{% if journal.source_type != 'Cash account' %}{{ journal.source_account_name }}{% endif %}"
autocomplete="off"
name="source_name[{{ journal.transaction_journal_id }}]" type="text"
value="{% if journal.source_type != 'Cash account' %}{{ journal.source_account_name }}{% endif %}">
{% endif %}
</td>
<td style="position: relative;">
{# DESTINATION ACCOUNT NAME FOR TRANSFER AND DEPOSIT #}
{% if journal.transaction_type_type == 'Transfer' or journal.transaction_type_type == 'Deposit' %}
<select class="form-control input-sm" name="destination_id[{{ journal.transaction_journal_id }}]">
{% for account in depositDestinations %}
<option value="{{ account.id }}"{% if account.id == journal.destination_account_id %} selected="selected"{% endif %}
label="{{ account.name }}">{{ account.name }}</option>
{% endfor %}
</select>
{% endif %}
{# DESTINATION ACCOUNT NAME FOR WITHDRAWAL #}
{% if journal.transaction_type_type == 'Withdrawal' %}
<input class="form-control input-sm"
placeholder="{% if journal.destination_type != 'Cash account' %}{{ journal.destination_account_name }}{% endif %}"
name="destination_name[{{ journal.transaction_journal_id }}]" type="text" autocomplete="off"
value="{% if journal.destination_type != 'Cash account' %}{{ journal.destination_account_name }}{% endif %}">
{% endif %}
</td>
{# category #}
<td style="position: relative;">
<input class="form-control input-sm" placeholder="{{ journal.category_name }}" autocomplete="off"
name="category[{{ journal.transaction_journal_id }}]" type="text" value="{{ journal.category_name }}">
</td>
{# budget #}
<td>
{% if journal.transaction_type_type == 'Withdrawal' %}
<select class="form-control input-sm" name="budget_id[{{ journal.transaction_journal_id }}]">
<option value="0" label="({{ 'no_budget'|_ }})"
{% if journal.budget_id == 0 %}selected="selected"{% endif %}
>{{ 'no_budget'|_ }}
</option>
{% for budget in budgets %}
<option value="{{ budget.id }}"{% if budget.id == journal.budget_id %} selected="selected"{% endif %}
label="{{ budget.name }}">{{ budget.name }}</option>
{% endfor %}
</select>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div>
<div class="box-footer">
<input type="submit" name="submit" value="{{ trans('form.update_all_journals') }}" class="btn btn-success pull-right"/>
<a href="{{ route('index') }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var 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/ff/transactions/mass/edit.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}

View File

@@ -0,0 +1,455 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, transactionGroup) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-6">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'transaction_journal_information'|_ }}</h3>
<div class="btn-group btn-group-xs pull-right">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ 'actions'|_}} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
{# edit + delete #}
<li><a href="{{ route('transactions.edit', [transactionGroup.id]) }}"><span class="fa fa-pencil"></span> {{ 'edit'|_ }}</a></li>
<li><a href="{{ route('transactions.delete', [transactionGroup.id]) }}"><span class="fa fa-trash"></span> {{ 'delete'|_ }}</a></li>
<li role="separator" class="divider"></li>
{# convert to different type #}
{% if groupArray.transactions[0].type != 'withdrawal' %}
<li><a href="{{ route('transactions.convert.index', ['withdrawal', transactionGroup.id]) }}"><span class="fa fa-exchange"></span> {{ 'convert_to_withdrawal'|_ }}</a></li>
{% endif %}
{% if groupArray.transactions[0].type != 'deposit' %}
<li><a href="{{ route('transactions.convert.index', ['deposit', transactionGroup.id]) }}"><span class="fa fa-exchange"></span> {{ 'convert_to_deposit'|_ }}</a></li>
{% endif %}
{% if groupArray.transactions[0].type != 'transfer' %}
<li><a href="{{ route('transactions.convert.index', ['transfer', transactionGroup.id]) }}"><span class="fa fa-exchange"></span> {{ 'convert_to_transfer'|_ }}</a></li>
{% endif %}
{# clone #}
{% if groupArray.transactions[0].type != 'opening balance' and groupArray.transactions[0].type != 'reconciliation' %}
<li role="separator" class="divider"></li>
<li><a href="#" class="clone-transaction" data-id="{{ transactionGroup.id }}"><span class="fa fa-copy"></span> {{ 'clone'|_ }}</a></li>
{% endif %}
</ul>
</div>
</div>
<div class="box-body no-padding">
<table class="table table-hover">
<tbody>
<tr>
<td>{{ trans('list.type') }}</td>
<td>{{ first.transactiontype.type|_ }}</td>
</tr>
<tr>
<td>{{ trans('list.description') }}</td>
<td>
{% if splits == 1 %}
{{ first.description }}
{% else %}
{{ transactionGroup.title }}
{% endif %}
</td>
</tr>
<tr>
<td style="width:30%;">{{ trans('list.date') }}</td>
<td>
{{ first.date.formatLocalized(dateTimeFormat) }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="box box-primary">
<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-hover">
<tbody>
{% if first.transactiontype.type != 'Withdrawal' or splits == 1 %}
<tr>
<td>
{{ trans_choice('firefly.source_accounts', accounts['source']|length ) }}
</td>
<td>
{% for account in accounts['source'] %}
{% if 'Cash account' == account.type %}
<span class="text-success">({{ 'cash'|_ }})</span>
{% else %}
<a href="{{ route('accounts.show',account.id) }}"
title="{{ account.iban|default(account.name) }}">
{{ account.name }}
</a>
{% endif %}
{% if loop.index0 != accounts['source']|length -1 %}, {% endif %}
{% endfor %}
</td>
</tr>
{% endif %}
{% if first.transactiontype.type != 'Deposit' or splits == 1 %}
<tr>
<td>
{{ trans_choice('firefly.destination_accounts', accounts['destination']|length ) }}
</td>
<td>
{% for account in accounts['destination'] %}
{% if 'Cash account' == account.type %}
<span class="text-success">({{ 'cash'|_ }})</span>
{% else %}
<a href="{{ route('accounts.show',account.id) }}"
title="{{ account.iban|default(account.name) }}">
{{ account.name }}
</a>
{% endif %}
{% if loop.index0 != accounts['destination']|length -1 %}, {% endif %}
{% endfor %}
</td>
</tr>
{% endif %}
<tr>
<td style="width:30%;">{{ 'total_amount'|_ }}</td>
<td>
{% for amount in amounts %}
{% if first.transactiontype.type == 'Withdrawal' or first.transactiontype.type == 'Deposit' %}
{{ formatAmountBySymbol(amount.amount*-1,amount.symbol, amount.decimal_places) }}{% if loop.index0 != amounts|length -1 %}, {% endif %}
{% elseif first.transactiontype.type == 'Transfer' %}
<span class="text-info">
{{ formatAmountBySymbol(amount.amount, amount.symbol, amount.decimal_places, false) }}{% if loop.index0 != amounts|length -1 %}, {% endif %}
</span>
{% elseif first.transactiontype.type == 'Opening balance' %}
{# Opening balance stored amount is always negative: find out which way the money goes #}
{% if groupArray.transactions[0].source_type == 'Initial balance account' %}
{{ formatAmountBySymbol(amount.amount*-1,amount.symbol, amount.decimal_places) }}
{% else %}
{{ formatAmountBySymbol(amount.amount,amount.symbol, amount.decimal_places) }}
{% endif %}
{% endif %}
{% endfor %}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row">
</div>
{% if splits > 1 %}
<div class="row">
<div class="col-lg-12">
<h3>{{ 'splits'|_ }}</h3>
</div>
</div>
{% endif %}
{% set boxSize=6 %}
{% if(splits == 2) %}
{% set boxSize=6 %}
{% endif %}
{% if (splits > 2) %}
{% set boxSize = 4 %}
{% endif %}
<div class="row">
{% for index,journal in groupArray.transactions %}
<div class="col-lg-{{ boxSize }}">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ journal.description }}
{% if journal.reconciled %}
<span class="fa fa-check"></span>
{% endif %}
{% if splits > 1 %}
<small>
{{ index+1 }} / {{ splits }}
</small>
{% endif %}
</h3>
<div class="btn-group btn-group-xs pull-right">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ 'actions'|_}} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
{# edit + delete #}
<li><a href="{{ route('transactions.edit', [transactionGroup.id]) }}"><span class="fa fa-pencil"></span> {{ 'edit'|_ }}</a></li>
<li><a href="{{ route('transactions.delete', [transactionGroup.id]) }}"><span class="fa fa-trash"></span> {{ 'delete'|_ }}</a></li>
<li role="separator" class="divider"></li>
{# convert to different type #}
{% if groupArray.transactions[0].type != 'withdrawal' %}
<li><a href="{{ route('transactions.convert.index', ['withdrawal', transactionGroup.id]) }}"><span class="fa fa-exchange"></span> {{ 'convert_to_withdrawal'|_ }}</a></li>
{% endif %}
{% if groupArray.transactions[0].type != 'deposit' %}
<li><a href="{{ route('transactions.convert.index', ['deposit', transactionGroup.id]) }}"><span class="fa fa-exchange"></span> {{ 'convert_to_deposit'|_ }}</a></li>
{% endif %}
{% if groupArray.transactions[0].type != 'transfer' %}
<li><a href="{{ route('transactions.convert.index', ['transfer', transactionGroup.id]) }}"><span class="fa fa-exchange"></span> {{ 'convert_to_transfer'|_ }}</a></li>
{% endif %}
{# clone #}
{% if groupArray.transactions[0].type != 'opening balance' and groupArray.transactions[0].type != 'reconciliation' %}
<li role="separator" class="divider"></li>
<li><a href="#" data-id="{{ transactionGroup.id }}" class="clone-transaction"><span class="fa fa-copy"></span> {{ 'clone'|_ }}</a></li>
{% endif %}
<li><a href="#" class="link-modal" data-journal="{{ journal.transaction_journal_id }}"><span class="fa fa-fw fa-link"></span>{{ 'link_transaction'|_ }}</a></li>
<li role="separator" class="divider"></li>
<li><a href="{{ route('rules.create-from-journal', [journal.transaction_journal_id]) }}"><span class="fa fa-fw fa-random"></span>{{ 'create_rule_from_transaction'|_ }}</a></li>
<li><a href="{{ route('recurring.create-from-journal', [journal.transaction_journal_id]) }}"><span class="fa fa-fw fa-paint-brush"></span>{{ 'create_recurring_from_transaction'|_ }}</a></li>
</ul>
</div>
</div>
<div class="box-body no-padding">
<table class="table">
<tr>
<td colspan="2">
<!-- type is: "{{ first.transactiontype.type }}" -->
{% if 'Cash account' == journal.source_type %}
<span class="text-success">({{ 'cash'|_ }})</span>
{% else %}
<a href="{{ route('accounts.show', journal.source_id) }}"
title="{{ journal.source_iban|default(journal.source_name) }}">{{ journal.source_name }}</a> &rarr;
{% endif %}
{% if first.transactiontype.type == 'Withdrawal' or first.transactiontype.type == 'Deposit' %}
{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places) }}
{% elseif first.transactiontype.type == 'Transfer' or first.transactiontype.type == 'Opening balance' %}
<span class="text-info">
{{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places, false) }}
</span>
{% elseif first.transactiontype.type == 'Liability credit' %}
<span class="text-info">
{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places, false) }}
</span>
{% endif %}
<!-- do foreign amount -->
{% if null != journal.foreign_amount %}
{% if first.transactiontype.type == 'Withdrawal' or first.transactiontype.type == 'Deposit' %}
({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% elseif first.transactiontype.type == 'Transfer' %}
<span class="text-info">
({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
</span>
{% endif %}
{% endif %}
&rarr;
{% if 'Cash account' == journal.destination_type %}
<span class="text-success">({{ 'cash'|_ }})</span>
{% else %}
<a href="{{ route('accounts.show', journal.destination_id) }}"
title="{{ journal.destination_iban|default(journal.destination_name) }}">{{ journal.destination_name }}</a>
{% endif %}
</td>
</tr>
{% if null != journal.category_id %}
<tr>
<td style="width:30%;">{{ 'category'|_ }}</td>
<td><a href="{{ route('categories.show', [journal.category_id]) }}">{{ journal.category_name }}</a></td>
</tr>
{% endif %}
{% if null != journal.budget_id and first.transactiontype.type == 'Withdrawal' %}
<tr>
<td>{{ 'budget'|_ }}</td>
<td><a href="{{ route('budgets.show', [journal.budget_id]) }}">{{ journal.budget_name }}</a></td>
</tr>
{% endif %}
{% if null != journal.bill_id and first.transactiontype.type == 'Withdrawal' %}
<tr>
<td>{{ 'bill'|_ }}</td>
<td><a href="{{ route('bills.show', [journal.bill_id]) }}">{{ journal.bill_name }}</a></td>
</tr>
{% endif %}
<!-- other fields -->
{% for dateField in ['interest_date','book_date','process_date','due_date','payment_date','invoice_date'] %}
{% if journalHasMeta(journal.transaction_journal_id, dateField) %}
<tr>
<td>{{ trans('list.'~dateField) }}</td>
<td>{{ journalGetMetaDate(journal.transaction_journal_id, dateField).formatLocalized(monthAndDayFormat) }}</td>
</tr>
{% endif %}
{% endfor %}
{% for metaField in ['external_id','bunq_payment_id','internal_reference','sepa_batch_id','sepa_ct_id','sepa_ct_op','sepa_db','sepa_country','sepa_cc','sepa_ep','sepa_ci','external_url'] %}
{% if journalHasMeta(journal.transaction_journal_id, metaField) %}
<tr>
<td>{{ trans('list.'~metaField) }}</td>
<td>
{% if 'external_url' == metaField %}
{% set uri = journalGetMetaField(journal.transaction_journal_id, metaField) %}
<a href="{{ uri }}" rel="noopener noreferrer nofollow" target="_blank">
{% if uri|length > 60 %}
{{ uri|slice(0, 60) ~ '...' }}
{% else %}
{{ uri }}
{% endif %}
</a>
{% endif %}
{% if 'external_url' != metaField %}
{{ journalGetMetaField(journal.transaction_journal_id, metaField) }}
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
{% if null != journal.notes and '' != journal.notes %}
<tr>
<td>{{ trans('list.notes') }}</td>
<td class="markdown">{{ journal.notes|default('')|markdown }}</td>
</tr>
{% endif %}
{% if journalHasMeta(journal.transaction_journal_id, 'recurring_total') and journalHasMeta(journal.transaction_journal_id, 'recurring_count') %}
{% set recurringTotal = journalGetMetaField(journal.transaction_journal_id, 'recurring_total') %}
{% if 0 == recurringTotal %}
{% set recurringTotal = '∞' %}
{% endif %}
<tr>
<td>{{ trans('list.recurring_transaction') }}</td>
<td>{{ trans('firefly.recurring_info', {total: recurringTotal, count: journalGetMetaField(journal.transaction_journal_id, 'recurring_count') }) }}</td>
</tr>
{% endif %}
{% 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.id) }}">
<span class="fa fa-fw fa-tag"></span>{{ tag.tag }}</a>
</h4>
{% endfor %}
</td>
</tr>
{% endif %}
</table>
</div>
</div>
<!-- Transaction links -->
{% if links[journal.transaction_journal_id]|length > 0 %}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ 'journal_links'|_ }}
</h3>
</div>
<div class="box-body no-padding">
<table class="table">
{% for link in links[journal.transaction_journal_id] %}
<tr>
<td style="width:120px;">
<div class="btn-group btn-group-xs">
<a href="#" class="btn btn-default switch-link" data-id="{{ link.id }}"><span
class="fa fa-fw fa-arrows-h"></span></a>
<a href="{{ route('transactions.link.delete', [link.id]) }}" class="btn btn-danger"><span class="fa fa-trash"></span></a>
</div>
</td>
<td>
{% if link.editable %}
{{ link.link }}
{% else %}
{{ trans('firefly.'~link.link) }}
{% endif %}
"<a href="{{ route('transactions.show', link.group) }}"
title="{{ link.description }}">{{ link.description }}</a>"
({{ link.amount|raw }})
{% if '' != link.foreign_amount %}
({{ link.foreign_amount|raw }})
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endif %}
<!-- Attachments -->
{% if attachments[journal.transaction_journal_id]|length > 0 %}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'attachments'|_ }}</h3>
</div>
<div class="box-body no-padding">
{% include 'v1.list.attachments' with {attachments: attachments[journal.transaction_journal_id]} %}
</div>
</div>
{% endif %}
<!-- Piggy bank events -->
{% if events[journal.transaction_journal_id]|length > 0 %}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'piggy_events'|_ }}</h3>
</div>
<div class="box-body no-padding">
<table class="table table-hover">
{% for event in events[journal.transaction_journal_id] %}
<tr>
<td style="width:30%;">{{ event.amount|raw }}</td>
<td>
<a href="{{ route('piggy-banks.show', [event.piggy_id]) }}">{{ event.piggy }}</a></td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endif %}
</div>
{% endfor %}
</div>
{# modal for linking journals. Will be filled by AJAX #}
<div class="modal fade" tabindex="-1" role="dialog" id="linkJournalModal">
</div>
{% endblock %}
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var modalDialogURI = '{{ route('transactions.link.modal', ['%JOURNAL%']) }}';
var acURI = '{{ route('api.v1.autocomplete.transactions-with-id') }}';
var groupURI = '{{ route('transactions.show',['%GROUP%']) }}';
var cloneGroupUrl = '{{ route('transactions.clone') }}';
$('.switch-link').on('click', switchLink);
var switchLinkUrl = '{{ route('transactions.link.switch') }}';
function switchLink(e) {
e.preventDefault();
var obj = $(e.currentTarget);
$.post(switchLinkUrl, {
_token: token,
id: obj.data('id')
}).done(function () {
location.reload();
}).fail(function () {
console.error('I failed :(');
});
//alert(obj.data('id'));
return false
}
</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/transactions/show.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}

View File

@@ -0,0 +1,43 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, journal) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('transactions.destroy',journal.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-6 col-sm-12">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('form.delete_journal', {'description': journal.description}) }}</h3>
</div>
<div class="box-body">
<p class="text-danger">
{{ trans('form.permDeleteWarning') }}
</p>
<p>
{{ trans('form.journal_areYouSure', {'description': journal.description}) }}
</p>
</div>
<div class="box-footer">
<input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn btn-danger pull-right"/>
{% if journal.transactiontype.type == 'Withdrawal' %}
<a href="{{ route('transactions.index','withdrawal') }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
{% endif %}
{% if journal.transactiontype.type == 'Deposit' %}
<a href="{{ route('transactions.index','deposit') }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
{% endif %}
{% if journal.transactiontype.type == 'Transfer' %}
<a href="{{ route('transactions.index','transfers') }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
{% endif %}
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1 @@
<!-- do not use -->