Finish version/v.0.0.66
This commit is contained in:
commit
75717df610
@ -1,3 +1,5 @@
|
|||||||
|
-0.0.66
|
||||||
|
- add contract changes
|
||||||
-0.0.65
|
-0.0.65
|
||||||
- change trigger to detect move in and move out
|
- change trigger to detect move in and move out
|
||||||
-0.0.64
|
-0.0.64
|
||||||
|
|||||||
@ -4,7 +4,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.0.65',
|
'version' => 'v0.0.66',
|
||||||
'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
|
||||||
|
|||||||
@ -34,6 +34,7 @@ class Contract extends \yii\db\ActiveRecord
|
|||||||
public static $FLAG_CANCELED = 20;
|
public static $FLAG_CANCELED = 20;
|
||||||
public static $FLAG_ACTIVE= 30;
|
public static $FLAG_ACTIVE= 30;
|
||||||
public static $FLAG_EXPIRED = 40;
|
public static $FLAG_EXPIRED = 40;
|
||||||
|
public static $FLAG_CANCELED_2 = 50;
|
||||||
|
|
||||||
|
|
||||||
public function behaviors()
|
public function behaviors()
|
||||||
@ -129,13 +130,6 @@ class Contract extends \yii\db\ActiveRecord
|
|||||||
return $this->hasOne(Discount::className(), ['id_discount' => 'id_discount']);
|
return $this->hasOne(Discount::className(), ['id_discount' => 'id_discount']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public static $STATUS_PAID = 10;
|
|
||||||
// public static $STATUS_NOT_PAID = 20;
|
|
||||||
|
|
||||||
// public static $FLAG_DELETED = 10;
|
|
||||||
// public static $FLAG_CANCELED = 20;
|
|
||||||
// public static $FLAG_ACTIVE= 30;
|
|
||||||
// public static $FLAG_EXPIRED = 40;
|
|
||||||
|
|
||||||
|
|
||||||
public static function statuses(){
|
public static function statuses(){
|
||||||
@ -150,6 +144,7 @@ class Contract extends \yii\db\ActiveRecord
|
|||||||
return [
|
return [
|
||||||
static::$FLAG_ACTIVE => "Aktív",
|
static::$FLAG_ACTIVE => "Aktív",
|
||||||
static::$FLAG_CANCELED => "Felbontva",
|
static::$FLAG_CANCELED => "Felbontva",
|
||||||
|
static::$FLAG_CANCELED_2 => "Felbontva, újrakötés lehetőségével",
|
||||||
static::$FLAG_DELETED => "Törölve",
|
static::$FLAG_DELETED => "Törölve",
|
||||||
static::$FLAG_EXPIRED => "Lejárt",
|
static::$FLAG_EXPIRED => "Lejárt",
|
||||||
];
|
];
|
||||||
@ -163,6 +158,13 @@ class Contract extends \yii\db\ActiveRecord
|
|||||||
return Helper::getArrayValue(self::flags(), $flag, "");
|
return Helper::getArrayValue(self::flags(), $flag, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getFlagsDoesNotProhibitNewContract(){
|
||||||
|
return [
|
||||||
|
static::$FLAG_CANCELED_2,
|
||||||
|
static::$FLAG_DELETED
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function getStatusName() {
|
public function getStatusName() {
|
||||||
return self::toStatusName($this->status);
|
return self::toStatusName($this->status);
|
||||||
}
|
}
|
||||||
@ -190,6 +192,8 @@ class Contract extends \yii\db\ActiveRecord
|
|||||||
return $this->flag == static::$FLAG_ACTIVE;
|
return $this->flag == static::$FLAG_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function getPriceMonthly(){
|
public function getPriceMonthly(){
|
||||||
return $this->ticket->price_brutto;
|
return $this->ticket->price_brutto;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -199,8 +199,15 @@ class ContractController extends Controller {
|
|||||||
/**
|
/**
|
||||||
* EGY RÉSZLET KIFIZETÉSE
|
* EGY RÉSZLET KIFIZETÉSE
|
||||||
*/
|
*/
|
||||||
public function actionCancel($id) {
|
public function actionCancel($id,$flag) {
|
||||||
$contract = $this->findModel ( $id );
|
$contract = $this->findModel ( $id );
|
||||||
|
|
||||||
|
if ( $flag != Contract::$FLAG_CANCELED && $flag != Contract::$FLAG_CANCELED_2){
|
||||||
|
\Yii::error("A felmondási státusz nem található! ($flag)");
|
||||||
|
throw new NotFoundHttpException("Az oldal nem található!");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$customer = $contract->customer;
|
$customer = $contract->customer;
|
||||||
$card = $customer->card;
|
$card = $customer->card;
|
||||||
|
|
||||||
@ -209,7 +216,7 @@ class ContractController extends Controller {
|
|||||||
$transaction = $connection->beginTransaction ();
|
$transaction = $connection->beginTransaction ();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$contract->flag = Contract::$FLAG_CANCELED;
|
$contract->flag = $flag;
|
||||||
$contract->save ();
|
$contract->save ();
|
||||||
$requests = $contract->requests;
|
$requests = $contract->requests;
|
||||||
$buntetes = 0;
|
$buntetes = 0;
|
||||||
|
|||||||
@ -157,7 +157,7 @@ class ContractForm extends Model {
|
|||||||
}else{
|
}else{
|
||||||
$contracts = Contract::find()
|
$contracts = Contract::find()
|
||||||
->andWhere( ['>' ,'contract.expired_at', date('Y-m-d')])
|
->andWhere( ['>' ,'contract.expired_at', date('Y-m-d')])
|
||||||
->andWhere(['not in' ,'contract.flag',[Contract::$FLAG_DELETED]])
|
->andWhere(['not in' ,'contract.flag', Contract::getFlagsDoesNotProhibitNewContract() ])
|
||||||
->andWhere(['contract.id_customer' => $this->customer->id_customer])->all();
|
->andWhere(['contract.id_customer' => $this->customer->id_customer])->all();
|
||||||
if ( count($contracts) > 0 ){
|
if ( count($contracts) > 0 ){
|
||||||
$this->addError( $attribute , "Már van érvényes vagy lemondott szerződés az adott időszakban");
|
$this->addError( $attribute , "Már van érvényes vagy lemondott szerződés az adott időszakban");
|
||||||
|
|||||||
@ -36,6 +36,10 @@ echo Html::a( "Új szerződés",['contract/make' , 'id' => $searchModel->custom
|
|||||||
'attribute' => 'id_user',
|
'attribute' => 'id_user',
|
||||||
'value' => 'userName'
|
'value' => 'userName'
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'attribute' => 'flag',
|
||||||
|
'value' => "flagName"
|
||||||
|
],
|
||||||
// 'part_paid',
|
// 'part_paid',
|
||||||
// 'part_count',
|
// 'part_count',
|
||||||
// 'part_required',
|
// 'part_required',
|
||||||
|
|||||||
@ -4,6 +4,7 @@ use yii\helpers\Html;
|
|||||||
use yii\widgets\DetailView;
|
use yii\widgets\DetailView;
|
||||||
use common\models\TicketInstallmentRequest;
|
use common\models\TicketInstallmentRequest;
|
||||||
use frontend\components\CustomerTabWidget;
|
use frontend\components\CustomerTabWidget;
|
||||||
|
use common\models\Contract;
|
||||||
|
|
||||||
/* @var $this yii\web\View */
|
/* @var $this yii\web\View */
|
||||||
/* @var $model common\models\Contract */
|
/* @var $model common\models\Contract */
|
||||||
@ -51,9 +52,17 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<?php
|
<?php
|
||||||
echo Html::a("Szerződés felbontása ",['contract/cancel' , 'id' => $model->id_contract], [ 'data-method' => 'post', 'class' => 'btn btn-danger']);
|
echo Html::a("Szerződés felbontása ",['contract/cancel' , 'id' => $model->id_contract, 'flag' => Contract::$FLAG_CANCELED], [ 'data-method' => 'post', 'class' => 'btn btn-danger']);
|
||||||
?>
|
?><br>
|
||||||
Szerződés felbontása esetén a már megkezdett hónapokra hónaponként 3000 Ft büntetést írunk fel a vásárló kosarába
|
Szerződés felbontása esetén a már megkezdett hónapokra hónaponként 3000 Ft büntetést írunk fel a vásárló kosarába.<br>
|
||||||
|
A vendég nem köthet új szerződést a felbontott szerződés eredet lejáratáig.
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12" style="margin-top: 10px;">
|
||||||
|
<?php
|
||||||
|
echo Html::a("Szerződés felbontása újrakötés lehetőségével",['contract/cancel' , 'id' => $model->id_contract , 'flag' => Contract::$FLAG_CANCELED_2], [ 'data-method' => 'post', 'class' => 'btn btn-danger']);
|
||||||
|
?><br>
|
||||||
|
Szerződés felbontása esetén a már megkezdett hónapokra hónaponként 3000 Ft büntetést írunk fel a vásárló kosarába.<br>
|
||||||
|
Ezen mód választásakor a vendégnek lehetősége lesz új szerződés kötésére a lemondott szerződés eredeti lejárati dátuma előtt!
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user