add transfer-moneymovement

This commit is contained in:
2015-10-19 17:22:50 +02:00
parent ab40f937a3
commit 71384b6453
12 changed files with 341 additions and 71 deletions

View File

@@ -5,6 +5,9 @@ namespace common\models;
use Yii;
use yii\base\Object;
use yii\helpers\ArrayHelper;
use yii\behaviors\TimestampBehavior;
use common\components\AccountAwareBehavior;
use common\components\UserAwareBehavior;
/**
* This is the model class for table "transfer".
@@ -25,18 +28,40 @@ use yii\helpers\ArrayHelper;
* @property string $comment
* @property string $created_at
* @property string $updated_at
* @property integer $direction
*/
class Transfer extends \yii\db\ActiveRecord
class Transfer extends \common\models\BaseFitnessActiveRecord
{
const TYPE_PRODUCT = 10;
const TYPE_TICKET = 20;
const TYPE_MONEY_MOVEMENT_OUT = 30; //MONEY OUT FROM ACCOUNT
const STATUS_NOT_PAID = 10;
const STATUS_PAID = 20;
const DIRECTION_IN = 10;// MONEY GOES OUT FROM ACCOUNT ( COMPANY LOST MONEY )
const DIRECTION_OUT = 20;//MONEY GOES IN TO THE ACCOUNT ( COMPANY EARN MONEY )
const DIRECTION_OUT = 10;// MONEY GOES OUT FROM ACCOUNT ( COMPANY LOST MONEY )
const DIRECTION_IN = 20;//MONEY GOES IN TO THE ACCOUNT ( COMPANY EARN MONEY )
/**
* @inheritdoc
*/
public function behaviors()
{
return ArrayHelper::merge( [
[
'class' => TimestampBehavior::className(),
'value' => function(){ return date('Y-m-d H:i:s' ); }
],
// [
// 'class' => AccountAwareBehavior::className(),
// ],
// [
// 'class' => UserAwareBehavior::className(),
// ],
], parent::behaviors());
}
/**
* @inheritdoc
@@ -318,4 +343,6 @@ class Transfer extends \yii\db\ActiveRecord
];
}
}