Merge branch 'release/v0.1.07'
This commit is contained in:
commit
84dda3dd2c
@ -1,3 +1,5 @@
|
|||||||
|
-0.1.07
|
||||||
|
- fix frontend ticket/sell displayed accounts
|
||||||
-0.1.06
|
-0.1.06
|
||||||
- add inventory waste gui
|
- add inventory waste gui
|
||||||
-0.1.05
|
-0.1.05
|
||||||
|
|||||||
@ -5,7 +5,7 @@ return [
|
|||||||
'supportEmail' => 'rocho02@gmail.com',
|
'supportEmail' => 'rocho02@gmail.com',
|
||||||
'infoEmail' => 'info@rocho-net.hu',
|
'infoEmail' => 'info@rocho-net.hu',
|
||||||
'user.passwordResetTokenExpire' => 3600,
|
'user.passwordResetTokenExpire' => 3600,
|
||||||
'version' => 'v0.1.06',
|
'version' => 'v0.1.07',
|
||||||
'company' => 'movar',//gyor
|
'company' => 'movar',//gyor
|
||||||
'company_name' => "Freimann Kft.",
|
'company_name' => "Freimann Kft.",
|
||||||
'product_visiblity' => 'account',// on reception which products to display. account or global
|
'product_visiblity' => 'account',// on reception which products to display. account or global
|
||||||
|
|||||||
@ -6,6 +6,8 @@ use Yii;
|
|||||||
use yii\behaviors\TimestampBehavior;
|
use yii\behaviors\TimestampBehavior;
|
||||||
use yii\helpers\ArrayHelper;
|
use yii\helpers\ArrayHelper;
|
||||||
|
|
||||||
|
/** @noinspection PhpUnnecessaryFullyQualifiedNameInspection */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the model class for table "account".
|
* This is the model class for table "account".
|
||||||
*
|
*
|
||||||
@ -86,7 +88,7 @@ class Account extends \yii\db\ActiveRecord
|
|||||||
|
|
||||||
public function getStatusHuman(){
|
public function getStatusHuman(){
|
||||||
$result = null;
|
$result = null;
|
||||||
$s = self::statuses($this->status);
|
$s = self::statuses();
|
||||||
if ( array_key_exists($this->status, $s)){
|
if ( array_key_exists($this->status, $s)){
|
||||||
$result = $s[$this->status];
|
$result = $s[$this->status];
|
||||||
}
|
}
|
||||||
@ -102,7 +104,7 @@ class Account extends \yii\db\ActiveRecord
|
|||||||
|
|
||||||
public function getTypeHuman(){
|
public function getTypeHuman(){
|
||||||
$result = null;
|
$result = null;
|
||||||
$s = self::types($this->type);
|
$s = self::types();
|
||||||
if ( array_key_exists($this->type, $s)){
|
if ( array_key_exists($this->type, $s)){
|
||||||
$result = $s[$this->type];
|
$result = $s[$this->type];
|
||||||
}
|
}
|
||||||
@ -115,11 +117,14 @@ class Account extends \yii\db\ActiveRecord
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* $param int $forceIncludeAccount id account, that should be included in list, even if it is inactive
|
* $param int $forceIncludeAccount id account, that should be included in list, even if it is inactive
|
||||||
* */
|
* @param null $forceIncludeAccount the next account should be included too, even if it is not
|
||||||
|
* allowed for user
|
||||||
|
* @return array|null|\yii\db\ActiveRecord[]
|
||||||
|
*/
|
||||||
public static function readAccounts($forceIncludeAccount = null){
|
public static function readAccounts($forceIncludeAccount = null){
|
||||||
$accounts = null;
|
$accounts = null;
|
||||||
|
|
||||||
if ( $forceIncludeAccount == null){
|
if ( $forceIncludeAccount == null) {
|
||||||
$accounts = Account::find()->andWhere(['status' => Account::STATUS_ACTIVE])->all();
|
$accounts = Account::find()->andWhere(['status' => Account::STATUS_ACTIVE])->all();
|
||||||
}else{
|
}else{
|
||||||
$accounts = Account::find()->andWhere( ['or', ['status' => Account::STATUS_ACTIVE], ['id_account' => $forceIncludeAccount ] ])->all();
|
$accounts = Account::find()->andWhere( ['or', ['status' => Account::STATUS_ACTIVE], ['id_account' => $forceIncludeAccount ] ])->all();
|
||||||
@ -134,6 +139,7 @@ class Account extends \yii\db\ActiveRecord
|
|||||||
|
|
||||||
$query->innerJoinWith('userAccountAssignments');
|
$query->innerJoinWith('userAccountAssignments');
|
||||||
$query->andWhere(['user_account_assignment.id_user' => Yii::$app->user->id]);
|
$query->andWhere(['user_account_assignment.id_user' => Yii::$app->user->id]);
|
||||||
|
|
||||||
if ( $forceIncludeAccount == null){
|
if ( $forceIncludeAccount == null){
|
||||||
$query->andWhere(['status' => Account::STATUS_ACTIVE])->all();
|
$query->andWhere(['status' => Account::STATUS_ACTIVE])->all();
|
||||||
}else{
|
}else{
|
||||||
@ -166,7 +172,7 @@ class Account extends \yii\db\ActiveRecord
|
|||||||
/**
|
/**
|
||||||
* read default transfer object
|
* read default transfer object
|
||||||
* return the default account or null, if not found
|
* return the default account or null, if not found
|
||||||
* @return common\models\Account
|
* @return \common\models\Account
|
||||||
* */
|
* */
|
||||||
public static function readDefaultObject( ){
|
public static function readDefaultObject( ){
|
||||||
$account = null;
|
$account = null;
|
||||||
@ -179,8 +185,10 @@ class Account extends \yii\db\ActiveRecord
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* read assigned account
|
* read assigned account.
|
||||||
* */
|
* @param $idAccount integer The id of the account to read
|
||||||
|
* @return array|null|\yii\db\ActiveRecord
|
||||||
|
*/
|
||||||
public static function readOne($idAccount){
|
public static function readOne($idAccount){
|
||||||
$accounts = null;
|
$accounts = null;
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,8 @@ use yii\db\Query;
|
|||||||
use yii\db\Expression;
|
use yii\db\Expression;
|
||||||
use common\components\Helper;
|
use common\components\Helper;
|
||||||
|
|
||||||
|
/** @noinspection PhpUnnecessaryFullyQualifiedNameInspection */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the model class for table "ticket".
|
* This is the model class for table "ticket".
|
||||||
*
|
*
|
||||||
@ -30,6 +32,8 @@ use common\components\Helper;
|
|||||||
* @property string $created_at
|
* @property string $created_at
|
||||||
* @property string $updated_at
|
* @property string $updated_at
|
||||||
* @property int id_contract
|
* @property int id_contract
|
||||||
|
*
|
||||||
|
* @property \common\models\Card card
|
||||||
*/
|
*/
|
||||||
class Ticket extends \common\models\BaseFitnessActiveRecord
|
class Ticket extends \common\models\BaseFitnessActiveRecord
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,18 +2,16 @@
|
|||||||
|
|
||||||
namespace frontend\controllers;
|
namespace frontend\controllers;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
use Yii;
|
use Yii;
|
||||||
use common\models\Ticket;
|
use common\models\Ticket;
|
||||||
use frontend\models\TicketSearch;
|
use frontend\models\TicketSearch;
|
||||||
use frontend\models\ReceptionForm;
|
|
||||||
use frontend\models\TicketCreate;
|
use frontend\models\TicketCreate;
|
||||||
use yii\web\Controller;
|
|
||||||
use yii\web\NotFoundHttpException;
|
use yii\web\NotFoundHttpException;
|
||||||
use yii\filters\VerbFilter;
|
use yii\filters\VerbFilter;
|
||||||
use common\models\Discount;
|
use common\models\Discount;
|
||||||
use common\models\TicketType;
|
use common\models\TicketType;
|
||||||
use common\models\Account;
|
use common\models\Account;
|
||||||
use yii\base\Object;
|
|
||||||
use common\models\Transfer;
|
use common\models\Transfer;
|
||||||
use common\models\User;
|
use common\models\User;
|
||||||
use common\models\ShoppingCart;
|
use common\models\ShoppingCart;
|
||||||
@ -30,6 +28,7 @@ class TicketController extends FrontendController
|
|||||||
{
|
{
|
||||||
public function behaviors()
|
public function behaviors()
|
||||||
{
|
{
|
||||||
|
/** @noinspection PhpUnnecessaryFullyQualifiedNameInspection */
|
||||||
return [
|
return [
|
||||||
'verbs' => [
|
'verbs' => [
|
||||||
'class' => VerbFilter::className(),
|
'class' => VerbFilter::className(),
|
||||||
@ -60,7 +59,9 @@ class TicketController extends FrontendController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Lists all Ticket models.
|
* Lists all Ticket models.
|
||||||
|
* @param null $number
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
* @throws NotFoundHttpException
|
||||||
*/
|
*/
|
||||||
public function actionIndex($number = null)
|
public function actionIndex($number = null)
|
||||||
{
|
{
|
||||||
@ -84,7 +85,9 @@ class TicketController extends FrontendController
|
|||||||
/**
|
/**
|
||||||
* Creates a new Ticket model.
|
* Creates a new Ticket model.
|
||||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||||
|
* @param null $number
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
* @throws NotFoundHttpException
|
||||||
*/
|
*/
|
||||||
public function actionCreate($number = null)
|
public function actionCreate($number = null)
|
||||||
{
|
{
|
||||||
@ -108,7 +111,7 @@ class TicketController extends FrontendController
|
|||||||
|
|
||||||
$ticketTypes = TicketType::read(null, null);
|
$ticketTypes = TicketType::read(null, null);
|
||||||
|
|
||||||
$accounts = Account::readAccounts();
|
$accounts = Account::read();
|
||||||
|
|
||||||
$user = User::findOne( [ 'id' => Yii::$app->user->id ] );
|
$user = User::findOne( [ 'id' => Yii::$app->user->id ] );
|
||||||
|
|
||||||
@ -138,6 +141,8 @@ class TicketController extends FrontendController
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function actionUpdate($id){
|
public function actionUpdate($id){
|
||||||
|
|
||||||
|
/** @var \frontend\models\TicketUpdate $model */
|
||||||
$model = TicketUpdate::findOne($id);
|
$model = TicketUpdate::findOne($id);
|
||||||
|
|
||||||
if ( !isset($model)){
|
if ( !isset($model)){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user