diff --git a/app/Http/Requests/AccountFormRequest.php b/app/Http/Requests/AccountFormRequest.php index 4cc9298b32..66d7097a96 100644 --- a/app/Http/Requests/AccountFormRequest.php +++ b/app/Http/Requests/AccountFormRequest.php @@ -69,6 +69,9 @@ class AccountFormRequest extends FormRequest if (false === $this->boolean('include_net_worth')) { $data['include_net_worth'] = '0'; } + if('0' === $data['opening_balance']) { + $data['opening_balance'] = ''; + } // if the account type is "liabilities" there are actually four types of liability // that could have been selected. @@ -95,7 +98,7 @@ class AccountFormRequest extends FormRequest $ccPaymentTypes = implode(',', array_keys(config('firefly.ccTypes'))); $rules = [ 'name' => 'required|min:1|uniqueAccountForUser', - 'opening_balance' => 'numeric|required_with:opening_balance_date|nullable|max:1000000000', + 'opening_balance' => 'numeric|nullable|max:1000000000', 'opening_balance_date' => 'date|required_with:opening_balance|nullable', 'iban' => ['iban', 'nullable', new UniqueIban(null, $this->string('objectType'))], 'BIC' => 'bic|nullable', diff --git a/resources/views/v1/form/location.twig b/resources/views/v1/form/location.twig index 247df184f4..7f5518951f 100644 --- a/resources/views/v1/form/location.twig +++ b/resources/views/v1/form/location.twig @@ -1,19 +1,3 @@ -