Refactored accountRepository::getJournals > accountTasker > getJournals

This commit is contained in:
James Cole
2016-10-09 21:36:03 +02:00
parent 5bb8c6a366
commit e94ae126fd
25 changed files with 843 additions and 167 deletions

View File

@@ -37,7 +37,7 @@
<h3 class="box-title">{{ 'transactions'|_ }}</h3>
</div>
<div class="box-body">
{% include 'list.journals' with {sorting:true, accountPerspective: account} %}
{% include 'list.journals-tasker' with {sorting:true} %}
</div>
</div>
</div>

View File

@@ -39,7 +39,7 @@
<h3 class="box-title">{{ 'transactions'|_ }}</h3>
</div>
<div class="box-body">
{% include 'list.journals' with {sorting:true} %}
{% include 'list.journals-tasker' with {sorting:true} %}
</div>
</div>
</div>

View File

@@ -79,7 +79,7 @@
</div>
<div class="box-body no-padding">
{% include 'list.journals-tiny' with {'transactions': data[0],'account': data[1]} %}
{% include 'list.journals-tiny-tasker' with {'transactions': data[0],'account': data[1]} %}
</div>
<div class="box-footer clearfix">
<a class="btn btn-sm btn-default btn-flat pull-right"

View File

@@ -0,0 +1,134 @@
{{ journals.render|raw }}
<table class="table table-hover table-compressed {% if sorting %}sortable-table{% endif %}">
<thead>
<tr class="ignore">
<th class="hidden-xs no_select_boxes" colspan="2">&nbsp;</th>
<th class="hidden-xs select_boxes" colspan="2" style="display: none;"><input name="select_all" class="select_all" type="checkbox"/></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>
<!-- Hide budgets? -->
{% if not hideBudgets %}
<th class="hidden-xs"><i class="fa fa-tasks fa-fw" title="{{ trans('list.budget') }}"></i></th>
{% endif %}
<!-- Hide categories? -->
{% if not hideCategories %}
<th class="hidden-xs"><i class="fa fa-bar-chart fa-fw" title="{{ trans('list.category') }}"></i></th>
{% endif %}
<!-- Hide bills? -->
{% if not hideBills %}
<th class="hidden-xs"><i class="fa fa-fw fa-rotate-right" title="{{ trans('list.bill') }}"></i></th>
{% endif %}
</tr>
</thead>
<!-- to be fixed:
SORTING
ATTACHMENT COUNT
SPLIT JOURNAL INDICATOR
-->
<tbody>
{% for transaction in journals %}
<tr class="drag" data-date="{{ transaction.date.format('Y-m-d') }}" data-id="{{ transaction.journal_id }}">
<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">
{% 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>
<td class="hidden-xs">
{{ transaction|typeIconTransaction }}
</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 %}
</a>
{{ splitJournalIndicator(transaction.journal_id) }}
</td>
<td>
<!-- format amount of transaction -->
{{ formatAmountWithCode(transaction.transaction_amount, transaction.transaction_currency_code) }}
<!-- and then amount of journal itself. -->
{{ optionalJournalAmount(transaction.journal_id, transaction.transaction_amount,
transaction.transaction_currency_code, transaction.transaction_type_type) }}
</td>
<td class="hidden-sm hidden-xs">
{{ transaction.date.formatLocalized(monthAndDayFormat) }}
</td>
<td class="hidden-xs">
{{ transactionSourceAccount(transaction) }}
</td>
<td class="hidden-xs">
{{ 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>
{% endfor %}
</tbody>
</table>
<div class="row mass_edit_all" style="display: none;">
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
<div class="mass_button_options btn-group btn-group" style="display:none;">
<a href="#" class="btn btn-default mass_edit"><i class="fa fa-fw fa-pencil"></i> <span>{{ 'edit_selected'|_ }}</span></a>
<a href="#" class="btn btn-danger mass_delete"><i class="fa fa-fw fa-trash"></i> <span>{{ 'delete_selected'|_ }}</span></a>
</div>
</div>
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
<div class="mass_buttons btn-group btn-group pull-right">
<a href="#" class="btn btn-default mass_select"><i class="fa fa-fw fa-check-square-o"></i> {{ 'select_transactions'|_ }}</a>
<a href="#" class="btn btn-default mass_stop_select" style="display:none;"><i class="fa faw-fw fa-square-o"
aria-hidden="true"></i> {{ 'stop_selection'|_ }}</a>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
{{ journals.render|raw }}
</div>
</div>
<script type="text/javascript">
var edit_selected_txt = "{{ 'edit_selected'|_ }}";
var delete_selected_txt = "{{ 'delete_selected'|_ }}";
</script>

View File

@@ -0,0 +1,25 @@
<div class="list-group">
{% for transaction in transactions %}
<a class="list-group-item" title="{{ transaction.date.formatLocalized(trans('config.month_and_day')) }}"
{% if transaction.transaction_type_type == 'Opening balance' %}
href="#"
{% else %}
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 %}
<span class="pull-right small">
<!-- format amount of transaction -->
{{ formatAmountWithCode(transaction.transaction_amount, transaction.transaction_currency_code) }}
<!-- and then amount of journal itself. -->
{{ optionalJournalAmount(transaction.journal_id, transaction.transaction_amount,
transaction.transaction_currency_code, transaction.transaction_type_type) }}
</span>
</a>
{% endfor %}
</div>

View File

@@ -0,0 +1,92 @@
<table class="table table-hover table-condensed">
<thead>
<tr>
<th>&nbsp;</th>
<th>{{ trans('list.description') }}</th>
<th>{{ trans('list.amount') }}</th>
<th class="hidden-sm hidden-xs">{{ trans('list.date') }}</th>
{% if not hideSource %}
<th class="hidden-xs">{{ trans('list.from') }}</th>
{% endif %}
{% if not hideDestination %}
<th class="hidden-xs">{{ trans('list.to') }}</th>
{% endif %}
<!-- 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? -->
{% 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:
{% 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 }}
</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 %}
</a>
</td>
<td>
<!-- format amount of transaction -->
{{ formatAmountWithCode(transaction.transaction_amount, transaction.transaction_currency_code) }}
<!-- and then amount of journal itself. -->
{{ optionalJournalAmount(transaction.journal_id, transaction.transaction_amount,
transaction.transaction_currency_code, transaction.transaction_type_type) }}
</td>
<td class="hidden-sm hidden-xs">
{{ transaction.date.formatLocalized(monthAndDayFormat) }}
</td>
{% if not hideSource %}
<td class="hidden-xs">
{{ transactionSourceAccount(transaction) }}
</td>
{% endif %}
{% if not hideDestination %}
<td class="hidden-xs">
{{ transactionDestinationAccount(transaction) }}
</td>
{% endif %}
<!-- Do NOT hide the budget? -->
{% if not hideBudget %}
<td class="hidden-xs">
{{ transactionBudgets(transaction) }}
</td>
{% endif %}
<!-- Do NOT hide the category? -->
{% if not hideCategory %}
<td class="hidden-xs">
{{ transactionCategories(transaction) }}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="2" style="text-align: right;"><em>{{ 'sum'|_ }}:</em></td>
<td>{{ sum|formatAmount }}</td>
</tr>
</tfoot>
</table>
{{ journals.render|raw }}

View File

@@ -8,7 +8,7 @@
</div>
<div class="modal-body">
{% set hideDestination = true %}
{% include 'popup/list/journals.twig' %}
{% include 'popup/list/journals-tasker.twig' %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>

View File

@@ -10,7 +10,7 @@
{% set hideBudget = true %}
{% set hideSource = true %}
{% set accountPerspective = account %}
{% include 'popup/list/journals.twig' %}
{% include 'popup/list/journals-tasker.twig' %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>

View File

@@ -62,7 +62,7 @@
balance: auditData[account.id].endBalance|formatAmount
})|raw }}
</p>
{% include 'reports/partials/journals-audit.twig' with {'journals': auditData[account.id].journals,'account':account} %}
{% include 'reports/partials/journals-audit-tasker.twig' with {'journals': auditData[account.id].journals,'account':account} %}
<p style="padding:10px;">
{{ trans('firefly.audit_end_balance',
{

View File

@@ -0,0 +1,160 @@
{{ journals.render|raw }}
<table class="table table-hover table-compressed">
<thead>
<tr class="ignore">
<th class="hide-buttons">&nbsp;</th>
<th class="hide-icon">&nbsp;</th>
<th class="hide-description">{{ trans('list.description') }}</th>
<th class="hide-balance_before">{{ trans('list.balance_before') }}</th>
<th class="hide-amount">{{ trans('list.amount') }}</th>
<th class="hide-balance_after">{{ trans('list.balance_after') }}</th>
<th class="hide-date">{{ trans('list.date') }}</th>
<th class="hide-book_date">{{ trans('list.book_date') }}</th>
<th class="hide-process_date">{{ trans('list.process_date') }}</th>
<th class="hide-interest_date">{{ trans('list.interest_date') }}</th>
<!-- new optional fields (3x) -->
<th class="hide-interest_date">{{ trans('list.due_date') }}</th>
<th class="hide-payment_date">{{ trans('list.payment_date') }}</th>
<th class="hide-invoice_date">{{ trans('list.invoice_date') }}</th>
<th class="hide-from">{{ trans('list.from') }}</th>
<th class="hide-to">{{ trans('list.to') }}</th>
<th class="hide-budget"><i class="fa fa-tasks fa-fw" title="{{ trans('list.budget') }}"></i></th>
<th class="hide-category"><i class="fa fa-bar-chart fa-fw" title="{{ trans('list.category') }}"></i></th>
<th class="hide-bill">{{ trans('list.bill') }}</th>
<!-- more optional fields (2x) -->
<th class="hide-internal_reference">{{ trans('list.internal_reference') }}</th>
<th class="hide-notes">{{ trans('list.notes') }}</th>
<th class="hide-create_date">{{ trans('list.create_date') }}</th>
<th class="hide-update_date">{{ trans('list.update_date') }}</th>
</tr>
</thead>
<tbody>
{% for transaction in journals %}
<tr data-date="{{ transaction.date.format('Y-m-d') }}" data-id="{{ journal.id }}">
<td class="hide-buttons">
<div class="btn-group btn-group-xs">
<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>
<td class="hide-icon">{{ transaction|typeIconTransaction }}</td>
<td class="hide-description">
<a href="{{ route('transactions.show',transaction.journal_id) }}">
{% if transaction.transaction_description|length > 0 %}
{{ transaction.transaction_description }} ({{ transaction.description }})
{% else %}
{{ transaction.description }}
{% endif %}
</a>
</td>
<td class="hide-balance_before">{{ transaction.before|formatAmount }}</td>
<td class="hide-amount">
<!-- format amount of transaction -->
{{ formatAmountWithCode(transaction.transaction_amount, transaction.transaction_currency_code) }}
<!-- and then amount of journal itself. -->
{{ optionalJournalAmount(transaction.journal_id, transaction.transaction_amount,
transaction.transaction_currency_code, transaction.transaction_type_type) }}
</td>
<td class="hide-balance_after">{{ transaction.after|formatAmount }}</td>
<td class="hide-date">{{ transaction.date.formatLocalized(monthAndDayFormat) }}</td>
<td class="hide-book_date">
{% if transaction.transactionJournal.hasMeta('book_date') %}
{{ transaction.transactionJournal.getMeta('book_date').formatLocalized(monthAndDayFormat) }}
{% endif %}
</td>
<td class="hide-process_date">
{% if transaction.transactionJournal.hasMeta('process_date') %}
{{ transaction.transactionJournal.getMeta('process_date').formatLocalized(monthAndDayFormat) }}
{% endif %}
</td>
<td class="hide-interest_date">
{% if transaction.transactionJournal.hasMeta('interest_date') %}
{{ transaction.transactionJournal.getMeta('interest_date').formatLocalized(monthAndDayFormat) }}
{% endif %}
</td>
<!-- new optional fields (3x) -->
<td class="hide-due_date">
{% if transaction.transactionJournal.hasMeta('due_date') %}
{{ transaction.transactionJournal.getMeta('due_date').formatLocalized(monthAndDayFormat) }}
{% endif %}
</td>
<td class="hide-payment_date">
{% if transaction.transactionJournal.hasMeta('payment_date') %}
{{ transaction.transactionJournal.getMeta('payment_date').formatLocalized(monthAndDayFormat) }}
{% endif %}
</td>
<td class="hide-invoice_date">
{% if transaction.transactionJournal.hasMeta('invoice_date') %}
{{ transaction.transactionJournal.getMeta('invoice_date').formatLocalized(monthAndDayFormat) }}
{% endif %}
</td>
<td class="hide-from">
{{ transactionSourceAccount(transaction) }}
</td>
<td class="hide-to">
{{ transactionDestinationAccount(transaction) }}
</td>
<td class="hide-budget">
{{ transactionBudgets(transaction) }}
</td>
<td class="hide-category">
{{ transactionCategories(transaction) }}
</td>
{% if transaction.bill_id %}
<td class="hide-bill">
<i class="fa fa-fw fa-rotate-right" title="{{ trans('list.bill') }}"></i>&nbsp
<a href="{{ route('bills.show',transaction.bill_id) }}">{{ transaction.bill_name }}</a>
</td>
{% else %}
<td class="hide-bill">&nbsp;</td>
{% endif %}
<!-- new optional fields (2x) -->
<td class="hide-internal_reference">
{% if transaction.transactionJournal.hasMeta('internal_reference') %}
{{ transaction.transactionJournal.getMeta('internal_reference') }}
{% endif %}
</td>
<td class="hide-notes">
{% if transaction.transactionJournal.hasMeta('notes') %}
{{ transaction.transactionJournal.getMeta('notes')|nl2br }}
{% endif %}
</td>
<td class="hide-create_date">
{{ transaction.transactionJournal.created_at.formatLocalized(dateTimeFormat) }}
</td>
<td class="hide-update_date">
{{ transaction.transactionJournal.updated_at.formatLocalized(dateTimeFormat) }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{{ journals.render|raw }}