change account dropdown to fix account on account state open/close
This commit is contained in:
@@ -74,10 +74,14 @@ class AccountStateController extends Controller {
|
||||
$lastStates = AccountState::readLastForUser ( AccountState::TYPE_CLOSE );
|
||||
$lastStates = AccountState::modelsToArray ( $lastStates );
|
||||
|
||||
|
||||
$model = new AccountState ();
|
||||
$model->type = AccountState::TYPE_OPEN;
|
||||
$model->id_user = Yii::$app->user->id;
|
||||
$model->id_account = Account::readDefault ();
|
||||
|
||||
$account = Account::readDefaultObject();
|
||||
|
||||
if ($model->load ( Yii::$app->request->post () ) && $model->save ()) {
|
||||
// return $this->redirect(['view', 'id' => $model->id_account_state]);
|
||||
|
||||
@@ -96,7 +100,8 @@ class AccountStateController extends Controller {
|
||||
return $this->render ( 'open', [
|
||||
'model' => $model,
|
||||
'accounts' => $accounts,
|
||||
'lastStates' => $lastStates
|
||||
'lastStates' => $lastStates,
|
||||
'account' => $account
|
||||
] );
|
||||
}
|
||||
}
|
||||
@@ -113,6 +118,7 @@ class AccountStateController extends Controller {
|
||||
$model->type = AccountState::TYPE_CLOSE;
|
||||
$model->id_user = Yii::$app->user->id;
|
||||
$model->id_account = Account::readDefault ();
|
||||
$account = Account::readDefaultObject();
|
||||
|
||||
$lastCassaState = AccountState::readLast(null,null, Account::readDefault());
|
||||
|
||||
@@ -141,6 +147,7 @@ class AccountStateController extends Controller {
|
||||
return $this->render ( 'close', [
|
||||
'model' => $model,
|
||||
'accounts' => $accounts,
|
||||
'account' => $account,
|
||||
'lastStates' => $lastStates ,
|
||||
'lastCassaState' => $lastCassaState,
|
||||
] );
|
||||
|
||||
Reference in New Issue
Block a user