diff --git a/app/Models/Account.php b/app/Models/Account.php index 1bdfd2ad71..06e36431cb 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -134,7 +134,6 @@ class Account extends Model } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function accountMeta() @@ -171,11 +170,9 @@ class Account extends Model * * @param string $fieldName * - * @codeCoverageIgnore - * - * @return string|null + * @return string */ - public function getMeta($fieldName) + public function getMeta($fieldName): string { foreach ($this->accountMeta as $meta) { if ($meta->name == $fieldName) { @@ -183,8 +180,7 @@ class Account extends Model } } - return null; - + return ''; } /** diff --git a/resources/views/accounts/create.twig b/resources/views/accounts/create.twig index 4c61ee243a..0541560806 100644 --- a/resources/views/accounts/create.twig +++ b/resources/views/accounts/create.twig @@ -21,7 +21,7 @@
- +

{{ 'optionalFields'|_ }}

@@ -29,17 +29,19 @@
{{ ExpandedForm.text('iban') }} - {% if what == 'asset' %} {{ ExpandedForm.text('accountNumber') }} - {{ ExpandedForm.balance('openingBalance') }} - {{ ExpandedForm.date('openingBalanceDate', phpdate('Y-m-d')) }} - {{ ExpandedForm.select('accountRole', Config.get('firefly.accountRoles'),null,{'helpText' : 'asset_account_role_help'|_}) }} - {{ ExpandedForm.balance('virtualBalance') }} + + {% if what == 'asset' %} + + {{ ExpandedForm.balance('openingBalance') }} + {{ ExpandedForm.date('openingBalanceDate', phpdate('Y-m-d')) }} + {{ ExpandedForm.select('accountRole', Config.get('firefly.accountRoles'),null,{'helpText' : 'asset_account_role_help'|_}) }} + {{ ExpandedForm.balance('virtualBalance') }} {% endif %}
- +
diff --git a/resources/views/accounts/edit.twig b/resources/views/accounts/edit.twig index b5d312055f..92f3065e75 100644 --- a/resources/views/accounts/edit.twig +++ b/resources/views/accounts/edit.twig @@ -29,6 +29,7 @@
{{ ExpandedForm.text('iban') }} {{ ExpandedForm.text('accountNumber') }} + {% if account.accounttype.type == 'Default account' or account.accounttype.type == 'Asset account' %} {{ ExpandedForm.balance('openingBalance',null, {'currency' : openingBalance ? openingBalance.transactionCurrency : null}) }} {{ ExpandedForm.date('openingBalanceDate') }}