Allow editing of liabilities.

This commit is contained in:
James Cole
2018-08-05 18:59:15 +02:00
parent 0a89f4000d
commit 33294dd9f0
17 changed files with 228 additions and 107 deletions

View File

@@ -17,7 +17,7 @@
</div>
<div class="box-body">
{{ ExpandedForm.text('name') }}
{% if what == 'asset' or what=='liabilities' %}
{% if what == 'asset' or what == 'liabilities' %}
{{ ExpandedForm.currencyList('currency_id', null, {helpText:'account_default_currency'|_}) }}
{% endif %}
{% if what == 'liabilities' %}
@@ -26,7 +26,6 @@
{{ ExpandedForm.date('openingBalanceDate', null, {label:'debt_start_date'|_}) }}
{{ ExpandedForm.percentage('interest') }}
{{ ExpandedForm.select('interest_period', interestPeriods) }}
{% endif %}
</div>
</div>

View File

@@ -17,9 +17,17 @@
</div>
<div class="box-body">
{{ ExpandedForm.text('name') }}
{% if account.accountType.type == 'Default account' or account.accountType.type == 'Asset account' %}
{% if account.accountType.type == 'Default account' or account.accountType.type == 'Asset account' or what == 'liabilities' %}
{{ ExpandedForm.currencyList('currency_id', null, {helpText:'account_default_currency'|_}) }}
{% endif %}
{% if what == 'liabilities' %}
{{ ExpandedForm.select('liability_type_id', liabilityTypes) }}
{{ ExpandedForm.amountNoCurrency('openingBalance', null, {label:'debt_start_amount'|_, helpText: 'debt_start_amount_help'|_}) }}
{{ ExpandedForm.date('openingBalanceDate', null, {label:'debt_start_date'|_}) }}
{{ ExpandedForm.percentage('interest') }}
{{ ExpandedForm.select('interest_period', interestPeriods) }}
{% endif %}
</div>
</div>
@@ -47,7 +55,7 @@
{{ ExpandedForm.amountNoCurrency('virtualBalance',null) }}
{% endif %}
{{ ExpandedForm.textarea('notes',null,{helpText: trans('firefly.field_supports_markdown')}) }}
{{ ExpandedForm.textarea('notes',preFilled.notes,{helpText: trans('firefly.field_supports_markdown')}) }}
{# only correct way to do active checkbox #}
{{ ExpandedForm.checkbox('active', 1) }}

View File

@@ -9,10 +9,17 @@
{% if what == 'asset' %}
<th data-defaultsign="az" class="hidden-sm hidden-xs hidden-md">{{ trans('list.role') }}</th>
{% endif %}
{% if what == 'liabilities' %}
<th data-defaultsign="az">{{ trans('list.liability_type') }}</th>
<th data-defaultsign="_19">{{ trans('list.interest') }} ({{ trans('list.interest_period') }})</th>
{% endif %}
<th data-defaultsign="az" class="hidden-sm hidden-xs">{{ trans('form.accountNumber') }}</th>
<th data-defaultsign="_19">{{ trans('list.currentBalance') }}</th>
<th class="hidden-sm hidden-xs">{{ trans('list.active') }}</th>
<th data-defaultsign="month" class="hidden-sm hidden-xs hidden-md">{{ trans('list.lastActivity') }}</th>
{# hide last activity to make room for other stuff #}
{% if what != 'liabilities' %}
<th data-defaultsign="month" class="hidden-sm hidden-xs hidden-md">{{ trans('list.lastActivity') }}</th>
{% endif %}
<th data-defaultsign="_19" style="width:15%;"
class="hidden-sm hidden-xs hidden-md">{{ trans('list.balanceDiff') }}</th>
</tr>
@@ -40,6 +47,12 @@
{% endfor %}
</td>
{% endif %}
{% if what == 'liabilities' %}
<td>{{ account.accountTypeString }}</td>
<td data-value="{{ account.interest }}">
{{ account.interest }}% ({{ account.interestPeriod|lower }})
</td>
{% endif %}
<td class="hidden-sm hidden-xs">{{ account.iban }}{% if account.iban == '' %}{{ accountGetMetaField(account, 'accountNumber') }}{% endif %}</td>
<td data-value="{{ account.endBalance }}" style="text-align: right;">
<span style="margin-right:5px;">
@@ -53,14 +66,17 @@
<i class="fa fa-fw fa-ban"></i>
{% endif %}
</td>
{% if account.lastActivityDate %}
<td class="hidden-sm hidden-xs hidden-md" data-value="{{ account.lastActivityDate.format('Y-m-d H-i-s') }} ">
{{ account.lastActivityDate.formatLocalized(monthAndDayFormat) }}
</td>
{% else %}
<td class="hidden-sm hidden-xs hidden-md" data-value="0000-00-00 00-00-00">
<em>{{ 'never'|_ }}</em>
</td>
{# hide last activity to make room for other stuff #}
{% if what != 'liabilities' %}
{% if account.lastActivityDate %}
<td class="hidden-sm hidden-xs hidden-md" data-value="{{ account.lastActivityDate.format('Y-m-d H-i-s') }} ">
{{ account.lastActivityDate.formatLocalized(monthAndDayFormat) }}
</td>
{% else %}
<td class="hidden-sm hidden-xs hidden-md" data-value="0000-00-00 00-00-00">
<em>{{ 'never'|_ }}</em>
</td>
{% endif %}
{% endif %}
<td class="hidden-sm hidden-xs hidden-md" data-value="{{ account.difference }}" style="text-align: right;">
<span style="margin-right:5px;">

View File

@@ -57,6 +57,15 @@
</div>
</a>
</li>
<li>
<a href="{{ route('accounts.create', 'liabilities') }}">
<i class="menu-icon fa fa-ticket bg-maroon"></i>
<div class="menu-info">
<h4 class="control-sidebar-subheading">{{ 'new_liabilities_account'|_ }}</h4>
</div>
</a>
</li>
<li>
<a href="{{ route('budgets.create') }}">