mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-21 11:48:53 +00:00
This commit is contained in:
@@ -109,6 +109,12 @@ class CreateController extends Controller
|
||||
'include_net_worth' => $hasOldInput ? (bool) $request->old('include_net_worth') : true,
|
||||
]
|
||||
);
|
||||
// issue #8321
|
||||
$showNetWorth = true;
|
||||
if ('liabilities' !== $objectType && 'asset' !== $objectType) {
|
||||
$showNetWorth = false;
|
||||
}
|
||||
|
||||
|
||||
// put previous url in session if not redirect from store (not "create another").
|
||||
if (true !== session('accounts.create.fromStore')) {
|
||||
@@ -119,7 +125,7 @@ class CreateController extends Controller
|
||||
|
||||
return view(
|
||||
'accounts.create',
|
||||
compact('subTitleIcon', 'liabilityDirections', 'locations', 'objectType', 'interestPeriods', 'subTitle', 'roles', 'liabilityTypes')
|
||||
compact('subTitleIcon', 'liabilityDirections', 'showNetWorth', 'locations', 'objectType', 'interestPeriods', 'subTitle', 'roles', 'liabilityTypes')
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -128,6 +128,12 @@ class EditController extends Controller
|
||||
$includeNetWorth = $repository->getMetaValue($account, 'include_net_worth');
|
||||
$includeNetWorth = null === $includeNetWorth ? true : '1' === $includeNetWorth;
|
||||
|
||||
// issue #8321
|
||||
$showNetWorth = true;
|
||||
if ('liabilities' !== $objectType && 'asset' !== $objectType) {
|
||||
$showNetWorth = false;
|
||||
}
|
||||
|
||||
// code to handle active-checkboxes
|
||||
$hasOldInput = null !== $request->old('_token');
|
||||
$virtualBalance = null === $account->virtual_balance ? '0' : $account->virtual_balance;
|
||||
@@ -155,7 +161,7 @@ class EditController extends Controller
|
||||
|
||||
$request->session()->flash('preFilled', $preFilled);
|
||||
|
||||
return view('accounts.edit', compact('account', 'currency', 'subTitle', 'subTitleIcon', 'locations', 'liabilityDirections', 'objectType', 'roles', 'preFilled', 'liabilityTypes', 'interestPeriods'));
|
||||
return view('accounts.edit', compact('account', 'currency', 'showNetWorth', 'subTitle', 'subTitleIcon', 'locations', 'liabilityDirections', 'objectType', 'roles', 'preFilled', 'liabilityTypes', 'interestPeriods'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -57,7 +57,9 @@
|
||||
{{ ExpandedForm.amountNoCurrency('virtual_balance') }}
|
||||
{% endif %}
|
||||
{# only correct way to do active checkbox #}
|
||||
{% if showNetWorth %}
|
||||
{{ ExpandedForm.checkbox('include_net_worth', 1) }}
|
||||
{% endif %}
|
||||
{{ ExpandedForm.textarea('notes',null,{helpText: trans('firefly.field_supports_markdown')}) }}
|
||||
{{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
|
||||
</div>
|
||||
|
@@ -67,7 +67,9 @@
|
||||
{{ ExpandedForm.amountNoCurrency('virtual_balance',null) }}
|
||||
|
||||
{% endif %}
|
||||
{% if showNetWorth %}
|
||||
{{ ExpandedForm.checkbox('include_net_worth', 1) }}
|
||||
{% endif %}
|
||||
{{ ExpandedForm.textarea('notes',preFilled.notes,{helpText: trans('firefly.field_supports_markdown')}) }}
|
||||
{# only correct way to do active checkbox #}
|
||||
{{ ExpandedForm.checkbox('active', 1) }}
|
||||
|
Reference in New Issue
Block a user