From dcc2b9c1cbe9709dc99fc52791c84144af9ff8b0 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 11 Feb 2017 18:35:16 +0100 Subject: [PATCH] This fixes #559 --- app/Http/Requests/AccountFormRequest.php | 4 ++-- resources/views/accounts/create.twig | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Requests/AccountFormRequest.php b/app/Http/Requests/AccountFormRequest.php index cbd07f46ee..cadf22b600 100644 --- a/app/Http/Requests/AccountFormRequest.php +++ b/app/Http/Requests/AccountFormRequest.php @@ -77,11 +77,11 @@ class AccountFormRequest extends Request return [ 'id' => $idRule, 'name' => $nameRule, - 'openingBalance' => 'numeric', + 'openingBalance' => 'numeric|required_with:openingBalanceDate', + 'openingBalanceDate' => 'date|required_with:openingBalance', 'iban' => 'iban', 'BIC' => 'bic', 'virtualBalance' => 'numeric', - 'openingBalanceDate' => 'date', 'currency_id' => 'exists:transaction_currencies,id', 'accountNumber' => 'between:1,255|uniqueAccountNumberForUser', 'accountRole' => 'in:' . $accountRoles, diff --git a/resources/views/accounts/create.twig b/resources/views/accounts/create.twig index 171ae13b1e..2063b86e79 100644 --- a/resources/views/accounts/create.twig +++ b/resources/views/accounts/create.twig @@ -40,7 +40,7 @@ {% if what == 'asset' %} {{ ExpandedForm.balance('openingBalance') }} - {{ ExpandedForm.date('openingBalanceDate', phpdate('Y-m-d')) }} + {{ ExpandedForm.date('openingBalanceDate') }} {{ ExpandedForm.select('accountRole', roles,null,{'helpText' : 'asset_account_role_help'|_}) }} {{ ExpandedForm.balance('virtualBalance') }} {% endif %}