Also do some account meta on the create screen.

This commit is contained in:
James Cole 2014-12-05 21:44:01 +01:00
parent 919a0c01e4
commit 357638a26c
4 changed files with 10 additions and 2 deletions

View File

@ -163,7 +163,7 @@ class AccountController extends BaseController
'subTitle', 'Edit ' . strtolower( 'subTitle', 'Edit ' . strtolower(
$account->accountType->type $account->accountType->type
) . ' "' . $account->name . '"' ) . ' "' . $account->name . '"'
)->with('roles', Config::get('firefly.accountRoles')); );
} }
/** /**

View File

@ -272,6 +272,13 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
$this->storeInitialBalance($account, $data); $this->storeInitialBalance($account, $data);
} }
switch ($account->accountType->type) {
case 'Asset account':
case 'Default account':
$account->updateMeta('accountRole', $data['account_role']);
break;
}
/* Tell transaction journal to store a new one.*/ /* Tell transaction journal to store a new one.*/
\Event::fire('account.store', [$account]); \Event::fire('account.store', [$account]);

View File

@ -33,6 +33,7 @@
{{Form::ffDate('openingbalancedate', date('Y-m-d'))}} {{Form::ffDate('openingbalancedate', date('Y-m-d'))}}
@endif @endif
{{Form::ffCheckbox('active','1',true)}} {{Form::ffCheckbox('active','1',true)}}
{{Form::ffSelect('account_role',Config::get('firefly.accountRoles'))}}
</div> </div>
</div> </div>

View File

@ -28,7 +28,7 @@
@if($account->accounttype->type == 'Default account' || $account->accounttype->type == 'Asset account') @if($account->accounttype->type == 'Default account' || $account->accounttype->type == 'Asset account')
{{Form::ffBalance('openingbalance')}} {{Form::ffBalance('openingbalance')}}
{{Form::ffDate('openingbalancedate')}} {{Form::ffDate('openingbalancedate')}}
{{Form::ffSelect('account_role',$roles)}} {{Form::ffSelect('account_role',Config::get('firefly.accountRoles'))}}
@endif @endif
</div> </div>
</div> </div>