fix merge conflicts

This commit is contained in:
Roland Schneider 2016-01-16 19:11:01 +01:00
commit 272d2d4f8a
11 changed files with 65 additions and 31 deletions

View File

@ -1,8 +1,12 @@
-0.0.21 -0.0.22
- fix product barcode unique on admin site - fix product barcode unique on admin site
- When checking ticket, use status = Active - When checking ticket, use status = Active
- force cassa open, if trying to enter prodcut/ticket sell page - force cassa open, if trying to enter prodcut/ticket sell page
- force select default account - force select default account
-0.0.21
- account state fix account on reception
- reception user - tickets > delete ticket
- show current account
-0.0.20 -0.0.20
- account state email with pdf - account state email with pdf
- login email - login email

View File

@ -152,11 +152,29 @@ class Account extends \yii\db\ActiveRecord
} }
/** read id_transfer from session (default account )
*
* @return int id_transfer
* */
public static function readDefault( ){ public static function readDefault( ){
$session = Yii::$app->session; $session = Yii::$app->session;
$result = $session->get('id_account'); $result = $session->get('id_account');
return $result; return $result;
}
/**
* read default transfer object
* return the default account or null, if not found
* @return common\models\Account
* */
public static function readDefaultObject( ){
$account = null;
$id_account = self::readDefault();
if ( isset($id_account)){
$account = Account::findOne($id_account);
}
return $account;
} }

View File

@ -63,11 +63,10 @@ class AccountState extends \common\models\BaseFitnessActiveRecord
public function rules() public function rules()
{ {
return [ return [
[['id_account','money' ], 'required'], [['money' ], 'required'],
[['id_account', 'type', 'money', 'banknote_5_ft', 'banknote_10_ft', 'banknote_20_ft', 'banknote_50_ft', 'banknote_100_ft', 'banknote_200_ft', 'banknote_500_ft', 'banknote_1000_ft', 'banknote_2000_ft', 'banknote_5000_ft', 'banknote_10000_ft', 'banknote_20000_ft' ], 'integer'], [['type', 'money', 'banknote_5_ft', 'banknote_10_ft', 'banknote_20_ft', 'banknote_50_ft', 'banknote_100_ft', 'banknote_200_ft', 'banknote_500_ft', 'banknote_1000_ft', 'banknote_2000_ft', 'banknote_5000_ft', 'banknote_10000_ft', 'banknote_20000_ft' ], 'integer'],
[['comment' ], 'string' ,'max' => 255], [['comment' ], 'string' ,'max' => 255],
[['prev_state' ], 'integer'], [['prev_state' ], 'integer'],
[['id_account'] , 'validatePrevState'],
]; ];
} }

View File

@ -46,6 +46,7 @@ class Product extends \common\models\BaseFitnessActiveRecord {
[['id_product_category', 'id_account', 'name'], 'required'], [['id_product_category', 'id_account', 'name'], 'required'],
[['id_product_category', 'id_account', 'purchase_price', 'sale_price', 'profit_margins', 'status'], 'integer'], [['id_product_category', 'id_account', 'purchase_price', 'sale_price', 'profit_margins', 'status'], 'integer'],
[['product_number', 'barcode'], 'string', 'max' => 20], [['product_number', 'barcode'], 'string', 'max' => 20],
[['product_number', 'barcode'], 'filter', 'filter' => 'trim', 'skipOnArray' => true],
[['name'], 'string', 'max' => 128], [['name'], 'string', 'max' => 128],
[['description'], 'string', 'max' => 255], [['description'], 'string', 'max' => 255],
// [['product_number'], 'unique' ], // [['product_number'], 'unique' ],

View File

@ -23,33 +23,28 @@ class TransferListSearch extends Transfer
public $mode = "reception";//reception or admin public $mode = "reception";//reception or admin
/**start date string*/
public $start; public $start;
/**end date string*/
public $end; public $end;
/**start date*/
public $timestampStart; public $timestampStart;
/** end date*/
public $timestampEnd; public $timestampEnd;
/**if include cassa open*/
public $includeCassaOpen = false; public $includeCassaOpen = false;
/**total with cassa open*/
public $totalWithCassa; public $totalWithCassa;
/**last cassa open*/
public $cassaOpen; public $cassaOpen;
// public $totalsCreatedAt = ['total' => 0, 'accounts' =>[] ];
// public $totalsCreatedAtNotPaid= ['total' => 0, 'accounts' =>[]];
// public $totalsCreatedAtPaid= ['total' => 0, 'accounts' =>[]];
// public $totalsPaidAt= ['total' => 0, 'accounts' =>[]];
// public $totalsPaidAtNotCreatedAt= ['total' => 0, 'accounts' =>[]];
public $totals; public $totals;
/**The accounts*/
public $accounts; public $accounts;
/**types*/
public $types; public $types;
/**users*/
public $users; public $users;
/** /**
* all money gained with ticket sell * all money gained with ticket sell
* */ * */

View File

@ -84,7 +84,7 @@ class FrontendMenuStructure{
if ( $isadmin || Yii::$app->user->can('reception.transfers') ){ if ( $isadmin || Yii::$app->user->can('reception.transfers') ){
$items[] = ['label' => Yii::t('frontend/transfer','Transfers'), 'url' => ['/transfer/index', 'TransferSearch[id_user]' =>\Yii::$app->user->id, 'TransferSearch[id_account]' => Account::readDefault(), 'TransferSearch[start]' => $this->start, 'TransferSearch[end]' => $this->tomorrow ] ]; $items[] = ['label' => Yii::t('frontend/transfer','Transfers'), 'url' => ['/transfer/index', 'TransferSearch[id_user]' =>\Yii::$app->user->id, 'TransferSearch[id_account]' => Account::readDefault(), 'TransferSearch[start]' => $this->start, 'TransferSearch[end]' => $this->tomorrow ] ];
$items[] = ['label' => Yii::t('frontend/collection','Collections'), 'url' => ['/collection/index' , 'CollectionSearch[start]' =>$this->start,'CollectionSearch[end]' => $this->tomorrow ] ]; //$items[] = ['label' => Yii::t('frontend/collection','Collections'), 'url' => ['/collection/index' , 'CollectionSearch[start]' =>$this->start,'CollectionSearch[end]' => $this->tomorrow ] ];
} }
$items[] = ['label' => Yii::t('frontend/card','Vendégek'), 'url' => [ '/card/index' ] ]; $items[] = ['label' => Yii::t('frontend/card','Vendégek'), 'url' => [ '/card/index' ] ];

View File

@ -74,12 +74,14 @@ class AccountStateController extends Controller {
$lastStates = AccountState::readLastForUser ( AccountState::TYPE_CLOSE ); $lastStates = AccountState::readLastForUser ( AccountState::TYPE_CLOSE );
$lastStates = AccountState::modelsToArray ( $lastStates ); $lastStates = AccountState::modelsToArray ( $lastStates );
// \Yii::$app->session->setFlash('error','ok');
$model = new AccountState (); $model = new AccountState ();
$model->type = AccountState::TYPE_OPEN; $model->type = AccountState::TYPE_OPEN;
$model->id_user = Yii::$app->user->id; $model->id_user = Yii::$app->user->id;
$model->id_account = Account::readDefault (); $model->id_account = Account::readDefault ();
$account = Account::readDefaultObject();
if ($model->load ( Yii::$app->request->post () ) && $model->save ()) { if ($model->load ( Yii::$app->request->post () ) && $model->save ()) {
// return $this->redirect(['view', 'id' => $model->id_account_state]); // return $this->redirect(['view', 'id' => $model->id_account_state]);
@ -98,7 +100,8 @@ class AccountStateController extends Controller {
return $this->render ( 'open', [ return $this->render ( 'open', [
'model' => $model, 'model' => $model,
'accounts' => $accounts, 'accounts' => $accounts,
'lastStates' => $lastStates 'lastStates' => $lastStates,
'account' => $account
] ); ] );
} }
} }
@ -115,6 +118,7 @@ class AccountStateController extends Controller {
$model->type = AccountState::TYPE_CLOSE; $model->type = AccountState::TYPE_CLOSE;
$model->id_user = Yii::$app->user->id; $model->id_user = Yii::$app->user->id;
$model->id_account = Account::readDefault (); $model->id_account = Account::readDefault ();
$account = Account::readDefaultObject();
$lastCassaState = AccountState::readLast(null,null, Account::readDefault()); $lastCassaState = AccountState::readLast(null,null, Account::readDefault());
@ -143,6 +147,7 @@ class AccountStateController extends Controller {
return $this->render ( 'close', [ return $this->render ( 'close', [
'model' => $model, 'model' => $model,
'accounts' => $accounts, 'accounts' => $accounts,
'account' => $account,
'lastStates' => $lastStates , 'lastStates' => $lastStates ,
'lastCassaState' => $lastCassaState, 'lastCassaState' => $lastCassaState,
] ); ] );

View File

@ -16,10 +16,14 @@ use frontend\components\HtmlHelper;
<?php $form = ActiveForm::begin(); ?> <?php $form = ActiveForm::begin(); ?>
<div class='row'> <div class='row'>
<div class='col-md-6'> <div class='col-md-8'>
<?= $form->field($model, 'id_account')->dropDownList( HtmlHelper::mkAccountOptions($accounts) ) ?> <div class="form-group field-accountstate-money required">
<label class="control-label" for="accountstate-money">Kassza</label><br>
<?php echo ( isset($account) ? $account->name : 'Nincs alapértelmezett kassza kiválasztva!' )?>
</div> </div>
<div class='col-md-6'> <?php //echo $form->field($model, 'id_account')->dropDownList( HtmlHelper::mkAccountOptions($accounts) ) ?>
</div>
<div class='col-md-4'>
<?= $form->field($model, 'money')->textInput(['class' => 'form-control text-right']); ?> <?= $form->field($model, 'money')->textInput(['class' => 'form-control text-right']); ?>
</div> </div>
</div> </div>

View File

@ -6,6 +6,7 @@ use frontend\components\HtmlHelper;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model common\models\AccountState */ /* @var $model common\models\AccountState */
/* @var $account common\models\Account the default account */
/* @var $form yii\widgets\ActiveForm */ /* @var $form yii\widgets\ActiveForm */
?> ?>
@ -16,10 +17,15 @@ use frontend\components\HtmlHelper;
<?php echo Html::activeHiddenInput($model, "prev_state") ?> <?php echo Html::activeHiddenInput($model, "prev_state") ?>
<div class='row'> <div class='row'>
<div class='col-md-6'> <div class='col-md-8'>
<?= $form->field($model, 'id_account')->dropDownList( HtmlHelper::mkAccountOptions($accounts) ) ?> <div class="form-group field-accountstate-money required">
<label class="control-label" for="accountstate-money">Kassza</label><br>
<?php echo ( isset($account) ? $account->name : 'Nincs alapértelmezett kassza kiválasztva!' )?>
</div> </div>
<div class='col-md-6'>
<?php //echo $form->field($model, 'id_account')->dropDownList( HtmlHelper::mkAccountOptions($accounts) ) ?>
</div>
<div class='col-md-4'>
<?= $form->field($model, 'money')->textInput(['class' => 'form-control text-right']); ?> <?= $form->field($model, 'money')->textInput(['class' => 'form-control text-right']); ?>
</div> </div>
</div> </div>

View File

@ -22,6 +22,7 @@ $this->registerJs ( 'new AccountState( '. json_encode($options).');' );
<?= $this->render('_form_close', [ <?= $this->render('_form_close', [
'model' => $model, 'model' => $model,
'accounts' => $accounts, 'accounts' => $accounts,
'account' => $account,
'lastCassaState' => $lastCassaState, 'lastCassaState' => $lastCassaState,
]) ?> ]) ?>

View File

@ -24,6 +24,7 @@ $this->registerJs ( 'new AccountState( '. json_encode($options).');' );
<?= $this->render('_form_open', [ <?= $this->render('_form_open', [
'model' => $model, 'model' => $model,
'accounts' => $accounts, 'accounts' => $accounts,
'account' => $account,
]) ?> ]) ?>
</div> </div>