Merge branch 'feature/credit_calc' into develop

This commit is contained in:
James Cole
2021-05-13 05:35:07 +02:00
46 changed files with 1651 additions and 235 deletions

View File

@@ -27,7 +27,8 @@
{% 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.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'|_}) }}

View File

@@ -36,6 +36,7 @@
{% 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) }}

View File

@@ -11,10 +11,16 @@
{% endif %}
{% if objectType == 'liabilities' %}
<th>{{ trans('list.liability_type') }}</th>
<th>{{ trans('form.liability_direction') }}</th>
<th>{{ trans('list.interest') }} ({{ trans('list.interest_period') }})</th>
{% endif %}
<th class="hidden-sm hidden-xs">{{ trans('form.account_number') }}</th>
<th>{{ trans('list.currentBalance') }}</th>
<th style="text-align: right;">{{ trans('list.currentBalance') }}</th>
{% if objectType == 'liabilities' %}
<th style="text-align: right;">
{{ trans('firefly.left_in_debt') }}
</th>
{% endif %}
<th class="hidden-sm hidden-xs">{{ trans('list.active') }}</th>
{# hide last activity to make room for other stuff #}
{% if objectType != 'liabilities' %}
@@ -50,10 +56,9 @@
</td>
{% endif %}
{% if objectType == 'liabilities' %}
<td>{{ account.accountTypeString }}</td>
<td>
{{ account.interest }}% ({{ account.interestPeriod|lower }})
</td>
<td>{{ account.accountTypeString }}</td>
<td>{{ trans('firefly.liability_direction_'~account.liability_direction~'_short') }}</td>
<td>{{ account.interest }}% ({{ account.interestPeriod|lower }})</td>
{% endif %}
<td class="hidden-sm hidden-xs">{{ account.iban }}{% if account.iban == '' %}{{ accountGetMetaField(account, 'account_number') }}{% endif %}</td>
<td style="text-align: right;">
@@ -61,6 +66,13 @@
{{ formatAmountByAccount(account, account.endBalance) }}
</span>
</td>
{% if objectType == 'liabilities' %}
<td style="text-align: right;">
{% if '-' != account.current_debt %}
<span class="text-info">{{ formatAmountByAccount(account, account.current_debt, false) }}</span>
{% endif %}
</td>
{% endif %}
<td class="hidden-sm hidden-xs">
{% if account.active %}
<i class="fa fa-fw fa-check"></i>

View File

@@ -118,6 +118,9 @@
{% if transaction.transaction_type_type == 'Opening balance' %}
<i class="object-handle fa-fw fa fa-star-o" title="{{ trans('firefly.Opening balance') }}"></i>
{% endif %}
{% if transaction.transaction_type_type == 'Liability credit' %}
<i class="object-handle fa-fw fa fa-star-o" title="{{ trans('firefly.Liability credit') }}"></i>
{% endif %}
</td>
<td style=" {{ style|raw }}">
@@ -136,11 +139,13 @@
{% endif %}
</td>
<td style=" {{ style|raw }}">
{# deposit #}
{% 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 %}
{# transfer #}
{% elseif transaction.transaction_type_type == 'Transfer' %}
<span class="text-info">
{{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places, false) }}
@@ -148,6 +153,7 @@
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places, false) }})
{% endif %}
</span>
{# opening balance #}
{% elseif transaction.transaction_type_type == 'Opening balance' %}
{% if transaction.source_account_type == 'Initial balance account' %}
{{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places) }}
@@ -160,6 +166,7 @@
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% endif %}
{# reconciliation #}
{% elseif transaction.transaction_type_type == 'Reconciliation' %}
{% if transaction.source_account_type == 'Reconciliation account' %}
{{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places) }}
@@ -172,6 +179,22 @@
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% endif %}
{# liability credit #}
{% elseif transaction.transaction_type_type == 'Liability credit' %}
{% if transaction.source_account_type == 'Liability credit' %}
{{ 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 %}
{% else %}
{{ 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 %}
{% endif %}
{# THE REST #}
{% else %}
{{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %}

View File

@@ -39,6 +39,7 @@
<li role="separator" class="divider"></li>
<li><a href="{{ route('transactions.clone', [transactionGroup.id]) }}"><i class="fa fa-copy"></i> {{ 'clone'|_ }}</a></li>
{% endif %}
</ul>
</div>
</div>
@@ -231,12 +232,17 @@
<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 -->