mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-15 19:09:50 +00:00
Various cleanup in transaction and journal display code.
This commit is contained in:
@@ -34,13 +34,14 @@
|
||||
<td data-value="{{ link.source.description }}">
|
||||
<a href="{{ route('transactions.show', [link.source_id]) }}">{{ link.source.description }}</a>
|
||||
</td>
|
||||
<td>{{ journalAmount(link.source) }}</td>
|
||||
<td>{{ link.source|journalTotalAmount }}</td>
|
||||
<td>{{ linkType.outward }}</td>
|
||||
<td data-value="{{ link.destination.description }}">
|
||||
<a href="{{ route('transactions.show', [link.destination_id]) }}">{{ link.destination.description }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ journalAmount(link.destination) }}
|
||||
{{ link.destination|journalTotalAmount }}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
@@ -7,14 +7,10 @@
|
||||
href="{{ route('transactions.show',transaction.journal_id) }}"
|
||||
{% endif %}
|
||||
>
|
||||
{{ transaction|typeIconTransaction }}
|
||||
{% if transaction.transaction_description|length > 0 %}
|
||||
{{ transaction.transaction_description }} ({{ transaction.description }})
|
||||
{% else %}
|
||||
{{ transaction.description }}
|
||||
{% endif %}
|
||||
{{ transaction|transactionIcon }}
|
||||
{{ transaction|transactionDescription }}
|
||||
<span class="pull-right small">
|
||||
{{ transactionAmount(transaction) }}
|
||||
{{ transaction|transactionAmount }}
|
||||
</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
||||
@@ -27,80 +27,8 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for transaction in journals %}
|
||||
<tr class="drag" data-date="{{ transaction.date.format('Y-m-d') }}" data-id="{{ transaction.journal_id }}">
|
||||
{# input buttons #}
|
||||
<td class="hidden-xs">
|
||||
<div class="select_single" style="display:none;">
|
||||
<input name="select_all_single[]" class="select_all_single" value="{{ transaction.journal_id }}" type="checkbox"/>
|
||||
</div>
|
||||
<div class="btn-group btn-group-xs edit_buttons edit_tr_buttons">{% if sorting %}<a href="#" class="handle btn btn-default btn-xs"><i
|
||||
class="fa fa-fw fa-arrows-v"></i></a>{% endif %}<a href="{{ route('transactions.edit',transaction.journal_id) }}"
|
||||
class="btn btn-xs btn-default"><i class="fa fa-fw fa-pencil"></i></a><a
|
||||
href="{{ route('transactions.delete',transaction.journal_id) }}" class="btn btn-xs btn-danger"><i
|
||||
class="fa fa-fw fa-trash-o"></i></a></div>
|
||||
</td>
|
||||
|
||||
{# icon #}
|
||||
<td class="hidden-xs">
|
||||
{{ transaction|typeIconTransaction }}
|
||||
</td>
|
||||
|
||||
{# description #}
|
||||
<td>
|
||||
<a href="{{ route('transactions.show',transaction.journal_id) }}">
|
||||
|
||||
{% if transaction.transaction_description|length > 0 %}
|
||||
{{ transaction.transaction_description }} ({{ transaction.description }})
|
||||
{% else %}
|
||||
{{ transaction.description }}
|
||||
{% endif %}
|
||||
</a>
|
||||
{# is a split journal #}
|
||||
{{ splitJournalIndicator(transaction.journal_id) }}
|
||||
|
||||
{# count attachments #}
|
||||
{{ attachmentIndicator(transaction.journal_id) }}
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
<span style="margin-right:5px;">
|
||||
{{ transactionAmount(transaction) }}
|
||||
</span>
|
||||
|
||||
</td>
|
||||
<td class="hidden-sm hidden-xs">
|
||||
{{ transaction.date.formatLocalized(monthAndDayFormat) }}
|
||||
</td>
|
||||
<td class="hidden-xs hidden-sm hidden-md">
|
||||
{{ transactionSourceAccount(transaction) }}
|
||||
</td>
|
||||
<td class="hidden-xs hidden-sm hidden-md">
|
||||
{{ transactionDestinationAccount(transaction) }}
|
||||
</td>
|
||||
|
||||
<!-- Do NOT hide the budget? -->
|
||||
{% if not hideBudgets %}
|
||||
<td class="hidden-xs">
|
||||
{{ transactionBudgets(transaction) }}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
<!-- Do NOT hide the category? -->
|
||||
{% if not hideCategories %}
|
||||
<td class="hidden-xs">
|
||||
{{ transactionCategories(transaction) }}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
<!-- Do NOT hide the bill? -->
|
||||
{% if not hideBills %}
|
||||
<td class="hidden-xs">
|
||||
{% if transaction.bill_id %}
|
||||
<a href="{{ route('bills.show',transaction.bill_id) }}">{{ transaction.bill_name }}</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% for transaction in transactions %}
|
||||
{% include 'partials.transaction-row' %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
65
resources/views/partials/transaction-row.twig
Normal file
65
resources/views/partials/transaction-row.twig
Normal file
@@ -0,0 +1,65 @@
|
||||
|
||||
<tr class="drag" data-date="{{ transaction.date.format('Y-m-d') }}" data-id="{{ transaction.journal_id }}">
|
||||
{# input buttons #}
|
||||
<td class="hidden-xs">
|
||||
<div class="select_single" style="display:none;">
|
||||
<input name="select_all_single[]" class="select_all_single" value="{{ transaction.journal_id }}" type="checkbox"/>
|
||||
</div>
|
||||
<div class="btn-group btn-group-xs edit_buttons edit_tr_buttons">{% if sorting %}<a href="#" class="handle btn btn-default btn-xs"><i
|
||||
class="fa fa-fw fa-arrows-v"></i></a>{% endif %}<a href="{{ route('transactions.edit',transaction.journal_id) }}"
|
||||
class="btn btn-xs btn-default"><i class="fa fa-fw fa-pencil"></i></a><a
|
||||
href="{{ route('transactions.delete',transaction.journal_id) }}" class="btn btn-xs btn-danger"><i
|
||||
class="fa fa-fw fa-trash-o"></i></a></div>
|
||||
</td>
|
||||
|
||||
{# icon #}
|
||||
<td class="hidden-xs">
|
||||
{{ transaction|transactionIcon }}
|
||||
</td>
|
||||
|
||||
{# description #}
|
||||
<td>
|
||||
<a href="{{ route('transactions.show',transaction.journal_id) }}">
|
||||
{{ transaction|transactionDescription }}
|
||||
</a>
|
||||
{# is a split journal #}
|
||||
{{ transaction|transactionIsSplit }}
|
||||
{# count attachments #}
|
||||
{{ transaction|transactionHasAtt }}
|
||||
</td>
|
||||
<td style="text-align: right;"><span style="margin-right:5px;">{{ transaction|transactionAmount }}</span></td>
|
||||
<td class="hidden-sm hidden-xs">
|
||||
{{ transaction.date.formatLocalized(monthAndDayFormat) }}
|
||||
</td>
|
||||
<td class="hidden-xs hidden-sm hidden-md">
|
||||
{# all source accounts #}
|
||||
{{ transaction|transactionSourceAccount }}
|
||||
</td>
|
||||
<td class="hidden-xs hidden-sm hidden-md">
|
||||
{# all destination accounts #}
|
||||
{{ transaction|transactionDestinationAccount }}
|
||||
</td>
|
||||
|
||||
{# Do NOT hide the budget? #}
|
||||
{% if not hideBudgets %}
|
||||
<td class="hidden-xs">
|
||||
{{ transaction|transactionBudgets }}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
{# Do NOT hide the category? #}
|
||||
{% if not hideCategories %}
|
||||
<td class="hidden-xs">
|
||||
{{ transaction|transactionCategories }}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
{# Do NOT hide the bill? #}
|
||||
{% if not hideBills %}
|
||||
<td class="hidden-xs">
|
||||
{% if transaction.bill_id %}
|
||||
<a href="{{ route('bills.show',transaction.bill_id) }}">{{ transaction.bill_name }}</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
@@ -11,68 +11,61 @@
|
||||
{% if not hideDestination %}
|
||||
<th class="hidden-xs">{{ trans('list.to') }}</th>
|
||||
{% endif %}
|
||||
<!-- Hide budgets? -->
|
||||
{# Hide budgets? #}
|
||||
{% if not hideBudget %}
|
||||
<th class="hidden-xs"><i class="fa fa-tasks fa-fw" title="{{ trans('list.budget') }}"></i></th>
|
||||
{% endif %}
|
||||
|
||||
<!-- Hide categories? -->
|
||||
{# Hide categories? #}
|
||||
{% if not hideCategory %}
|
||||
<th class="hidden-xs"><i class="fa fa-bar-chart fa-fw" title="{{ trans('list.category') }}"></i></th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!--
|
||||
Make sum:
|
||||
{# Make sum: #}
|
||||
{% set sum = 0 %}
|
||||
-->
|
||||
{% for transaction in journals %}
|
||||
<!-- add to sum
|
||||
{% set sum = (sum + transaction.transaction_amount) %}
|
||||
-->
|
||||
<tr class="drag" data-date="{{ transaction.date.format('Y-m-d') }}" data-id="{{ transaction.journal_id }}">
|
||||
<td class="hidden-xs">
|
||||
{{ transaction|typeIconTransaction }}
|
||||
{{ transaction|transactionIcon }}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('transactions.show',transaction.journal_id) }}">
|
||||
{% if transaction.transaction_description|length > 0 %}
|
||||
{{ transaction.transaction_description }} ({{ transaction.description }})
|
||||
{% else %}
|
||||
{{ transaction.description }}
|
||||
{% endif %}
|
||||
{{ transaction|transactionDescription }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{# TODO replace with new format code #}
|
||||
{{ transactionAmount(transaction) }}
|
||||
{{ transaction|transactionAmount }}
|
||||
</td>
|
||||
<td class="hidden-sm hidden-xs">
|
||||
{{ transaction.date.formatLocalized(monthAndDayFormat) }}
|
||||
</td>
|
||||
{% if not hideSource %}
|
||||
<td class="hidden-xs">
|
||||
{{ transactionSourceAccount(transaction) }}
|
||||
{{ transaction|transactionSourceAccount }}
|
||||
</td>
|
||||
{% endif %}
|
||||
{% if not hideDestination %}
|
||||
<td class="hidden-xs">
|
||||
{{ transactionDestinationAccount(transaction) }}
|
||||
{{ transaction|transactionDestinationAccount }}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
<!-- Do NOT hide the budget? -->
|
||||
{# Do NOT hide the budget? #}
|
||||
{% if not hideBudget %}
|
||||
<td class="hidden-xs">
|
||||
{{ transactionBudgets(transaction) }}
|
||||
{{ transaction|transactionBudgets }}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
<!-- Do NOT hide the category? -->
|
||||
{# Do NOT hide the category? #}
|
||||
{% if not hideCategory %}
|
||||
<td class="hidden-xs">
|
||||
{{ transactionCategories(transaction) }}
|
||||
{{ transaction|transactionCategories }}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<a href="{{ route('transactions.delete',transaction.journal_id) }}" class="btn btn-xs btn-danger"><i class="fa fa-fw fa-trash-o"></i></a>
|
||||
</div>
|
||||
</td>
|
||||
<td class="hide-icon">{{ transaction|typeIconTransaction }}</td>
|
||||
<td class="hide-icon">{{ transaction|transactionIcon }}</td>
|
||||
|
||||
<td class="hide-description">
|
||||
<a href="{{ route('transactions.show',transaction.journal_id) }}">
|
||||
@@ -59,7 +59,7 @@
|
||||
</td>
|
||||
<td class="hide-balance_before" style="text-align: right;">{{ formatAmountByCurrency(transaction.currency, transaction.before) }}</td>
|
||||
<td class="hide-amount" style="text-align: right;">
|
||||
{{ transactionAmount(transaction) }}
|
||||
{{ transaction|transactionAmount }}
|
||||
</td>
|
||||
<td class="hide-balance_after" style="text-align: right;">{{ formatAmountByCurrency(transaction.currency, transaction.after) }}</td>
|
||||
|
||||
@@ -104,17 +104,17 @@
|
||||
|
||||
|
||||
<td class="hide-from">
|
||||
{{ transactionSourceAccount(transaction) }}
|
||||
{{ transaction|transactionSourceAccount }}
|
||||
</td>
|
||||
<td class="hide-to">
|
||||
{{ transactionDestinationAccount(transaction) }}
|
||||
{{ transaction|transactionDestinationAccount }}
|
||||
</td>
|
||||
|
||||
<td class="hide-budget">
|
||||
{{ transactionBudgets(transaction) }}
|
||||
{{ transaction|transactionBudgets }}
|
||||
</td>
|
||||
<td class="hide-category">
|
||||
{{ transactionCategories(transaction) }}
|
||||
{{ transaction|transactionCategories }}
|
||||
</td>
|
||||
{% if transaction.bill_id %}
|
||||
<td class="hide-bill">
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
class="fa fa-fw fa-trash-o"></i></a></div>
|
||||
</td>
|
||||
<td class="hidden-xs">
|
||||
{{ transaction|typeIconTransaction }}
|
||||
{{ transaction|transactionIcon }}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('transactions.show',transaction.journal_id) }}">
|
||||
@@ -39,7 +39,7 @@
|
||||
{{ transaction.description }}
|
||||
{% endif %}
|
||||
</a>
|
||||
{{ splitJournalIndicator(transaction.journal_id) }}
|
||||
{{ transaction|transactionIsSplit }}
|
||||
|
||||
{% if transaction.transactionJournal.attachments|length > 0 %}
|
||||
<i class="fa fa-paperclip"
|
||||
@@ -48,23 +48,23 @@
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
<span style="margin-right:5px;">
|
||||
{{ transactionAmount(transaction) }}
|
||||
{{ transaction|transactionAmount }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="hidden-sm hidden-xs">
|
||||
{{ transaction.date.formatLocalized(monthAndDayFormat) }}
|
||||
</td>
|
||||
<td class="hidden-xs">
|
||||
{{ transactionSourceAccount(transaction) }}
|
||||
{{ transaction|transactionSourceAccount }}
|
||||
</td>
|
||||
<td class="hidden-xs">
|
||||
{{ transactionDestinationAccount(transaction) }}
|
||||
{{ transaction|transactionDestinationAccount }}
|
||||
</td>
|
||||
<td class="hidden-xs">
|
||||
{{ transactionBudgets(transaction) }}
|
||||
{{ transaction|transactionBudgets }}
|
||||
</td>
|
||||
<td class="hidden-xs">
|
||||
{{ transactionCategories(transaction) }}
|
||||
{{ transaction|transactionCategories }}
|
||||
</td>
|
||||
<td class="hidden-xs">
|
||||
{% if transaction.bill_id %}
|
||||
|
||||
@@ -43,7 +43,8 @@
|
||||
<a href="{{ route('transactions.show',journal.id) }}" title="{{ journal.description }}">{{ journal.description }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ journalAmount(journal) }}
|
||||
{{ journal|journalTotalAmount }}
|
||||
|
||||
</td>
|
||||
<td>
|
||||
{{ journal.date.formatLocalized(monthAndDayFormat) }}
|
||||
|
||||
@@ -88,11 +88,13 @@
|
||||
<tr>
|
||||
<td>{{ 'total_amount'|_ }}</td>
|
||||
<td>
|
||||
{{ journalAmount(journal) }}
|
||||
{{ journal|journalTotalAmount }}
|
||||
|
||||
{# if more transactions, list each one: #}
|
||||
{% if transactions|length > 1 %}
|
||||
({{ journalTotalAmount(journal) }})
|
||||
({% for transaction in transactions %}{{ transaction|transactionArrayAmount }}{% if loop.index != loop.length %}, {% endif %}{% endfor %})
|
||||
{% endif %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -336,12 +338,12 @@
|
||||
<a href="{{ route('transactions.show',link.destination.id) }}">
|
||||
#{{ link.destination.id }}: {{ link.destination.description }}
|
||||
</a>
|
||||
({{ journalAmount(link.destination) }})
|
||||
({{ link.destination|journalTotalAmount }})
|
||||
{% else %}
|
||||
{{ journalLinkTranslation('inward', link.linkType.inward) }}
|
||||
<a href="{{ route('transactions.show',link.source.id) }}">
|
||||
#{{ link.source.id }}: {{ link.source.description }}</a>
|
||||
({{ journalAmount(link.source) }})
|
||||
({{ link.source|journalTotalAmount }})
|
||||
{% endif %}
|
||||
{% if link.comment != "" %}
|
||||
<br/><em>{{ link.comment }}</em>
|
||||
|
||||
Reference in New Issue
Block a user