Small changes in list

This commit is contained in:
James Cole 2021-04-12 06:08:21 +02:00
parent a41d7378ef
commit 39925f8139
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D
3 changed files with 7 additions and 8 deletions

View File

@ -172,7 +172,7 @@ class IndexController extends Controller
$account->location = $this->repository->getLocation($account);
$account->liability_direction = $this->repository->getMetaValue($account, 'liability_direction');
$account->current_debt = $this->repository->getMetaValue($account, 'current_debt');
$account->current_debt = $this->repository->getMetaValue($account, 'current_debt') ?? '-';
}
);
// make paginator:

View File

@ -75,7 +75,9 @@ class AccountFormRequest extends FormRequest
if ('liabilities' === $data['account_type_name']) {
$data['account_type_name'] = null;
$data['account_type_id'] = $this->integer('liability_type_id');
$data['opening_balance'] = app('steam')->negative($data['opening_balance']);
if ('' !== $data['opening_balance']) {
$data['opening_balance'] = app('steam')->negative($data['opening_balance']);
}
}
return $data;
@ -110,11 +112,6 @@ class AccountFormRequest extends FormRequest
];
$rules = Location::requestRules($rules);
if ('liabilities' === $this->get('objectType')) {
$rules['opening_balance'] = ['numeric', 'required', 'max:1000000000'];
$rules['opening_balance_date'] = 'date|required';
}
/** @var Account $account */
$account = $this->route()->parameter('account');
if (null !== $account) {

View File

@ -68,7 +68,9 @@
</td>
{% if objectType == 'liabilities' %}
<td style="text-align: right;">
<span class="text-info">{{ formatAmountByAccount(account, account.current_debt, false) }}</span>
{% if '-' != account.current_debt %}
<span class="text-info">{{ formatAmountByAccount(account, account.current_debt, false) }}</span>
{% endif %}
</td>
{% endif %}
<td class="hidden-sm hidden-xs">