add contraint , that everybody expect admin is limited to 3 days, Add card package

This commit is contained in:
2016-02-13 17:23:43 +01:00
parent 556bdc3066
commit 70f43468af
37 changed files with 1418 additions and 19 deletions

View File

@@ -82,10 +82,10 @@ class FrontendMenuStructure{
$items[] = ['label' => Yii::t('frontend/transfer','Ticket sale detailed'), 'url' => [ '/transfer/tickets','TransferTicketSearch[id_user]' =>\Yii::$app->user->id, 'TransferTicketSearch[id_account]' => Account::readDefault(), 'TransferTicketSearch[start]' => $this->start, 'TransferTicketSearch[end]' => $this->tomorrow ] ];
}
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/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','Leltár'), 'url' => [ '/product/inventory' ] ];

View File

@@ -86,8 +86,10 @@ class AccountStateController extends Controller {
// return $this->redirect(['view', 'id' => $model->id_account_state]);
$mail = new AccountStateMail(['model' => $model,'controller' => $this]);
$mail->sednMail();
if ( Helper::isAccountStateOpenSendMail() ){
$mail = new AccountStateMail(['model' => $model,'controller' => $this]);
$mail->sednMail();
}
return $this->redirect ( [
@@ -132,9 +134,10 @@ class AccountStateController extends Controller {
if ($model->load ( Yii::$app->request->post () ) && $model->save ()) {
$mail = new AccountStateMail(['model' => $model,'controller' => $this]);
$mail->sednMail();
if ( Helper::isAccountStateCloseSendMail()){
$mail = new AccountStateMail(['model' => $model,'controller' => $this]);
$mail->sednMail();
}
return $this->redirect ( [
'index'

View File

@@ -6,6 +6,7 @@ use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\AccountState;
use common\components\Helper;
/**
* AccountstateSearch represents the model behind the search form about `common\models\AccountState`.
@@ -80,6 +81,8 @@ class AccountstateSearch extends AccountState
$query->andFilterWhere([ '>=', 'account_state.created_at', $this->timestampStart ] );
$query->andFilterWhere([ '<', 'account_state.created_at', $this->timestampEnd ] );
Helper::restrictIfNotAdminTheStartDate($query, $this->timestampStart, ['account_state.created_at']);
$query->orderBy( 'created_at desc' );
$query->limit = 20;

View File

@@ -7,6 +7,7 @@ use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\MoneyMovement;
use yii\helpers\ArrayHelper;
use common\components\Helper;
/**
* MoneyMovementSearch represents the model behind the search form about `common\models\MoneyMovement`.
@@ -67,6 +68,8 @@ class MoneyMovementSearch extends MoneyMovement
$query->andFilterWhere([ '>=', 'money_movement.created_at', $this->timestampStart ] );
$query->andFilterWhere([ '<', 'money_movement.created_at', $this->timestampEnd ] );
Helper::restrictIfNotAdminTheStartDate($query, $this->timestampStart,['money_movement.created_at']);
return $dataProvider;
}

View File

@@ -12,6 +12,7 @@ use yii\db\Expression;
use common\models\Account;
use yii\helpers\ArrayHelper;
use common\components\Helper;
/**
* TransferSearch represents the model behind the search form about `common\models\Transfer`.
*/
@@ -91,6 +92,8 @@ class TransferSearch extends Transfer
$query->andFilterWhere(['or' , $created_condition , $paid_condition]);
Helper::restrictIfNotAdminTheStartDate($query, $this->timestampStart);
return $dataProvider;
}
@@ -106,6 +109,7 @@ class TransferSearch extends Transfer
$accountMap = ArrayHelper::map( $accounts ,'id_account','name' );
$idUser = Yii::$app->user->id;
$this->totals = Transfer::mkTotals($this->timestampStart, $this->timestampEnd, $idUser, $this->types, $this->id_account, $accounts, $accountMap);

View File

@@ -1,6 +1,7 @@
var enterPressed;
var keyDate;
var seq = '';
var socket;
$(document).ready(
function(){
@@ -69,3 +70,28 @@ function addDocumentKeypressedListener(){
}
}
function startServer(){
try{
socket = new WebSocket("ws://localhost:8025/websockets/qrcode");
console.info('socket created');
socket.onmessage = function (event) {
console.log(event.data);
var msg = JSON.stringify(event.data);
if ( msg.msg == 'qrcode'){
console.info('qrcode rcvd');
}
}
}catch(e){
}
}
//startServer();
function sendMessage(){
socket.send("Here's some text that the server is urgently awaiting!");
}

View File

@@ -576,18 +576,18 @@ function ProductSell(o){
// Some item from your model is active!
if (current.name == $input.val()) {
// This means the exact match is found. Use toLowerCase() if you want case insensitive match.
console.info(current);
// console.info(current);
_findProduct(current.id_product);
} else {
// This means it is only a partial match, you can either add a new item
// or take the active if you don't want new items
console.info('partial');
// console.info('partial');
app.product = null;
productChanged();
}
} else {
// Nothing is active so it is a new value (or maybe empty value)
console.info('incactive');
// console.info('incactive');
app.product = null;
productChanged();
}