forked from sangkil/sangkilbiz3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Warehouse.php
134 lines (120 loc) · 3 KB
/
Warehouse.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?php
namespace biz\master\models;
use Yii;
/**
* This is the model class for table "warehouse".
*
* @property integer $id_warehouse
* @property integer $id_branch
* @property string $cd_whse
* @property string $nm_whse
* @property string $create_at
* @property integer $create_by
* @property string $update_at
* @property integer $update_by
*
* @property ProductStock[] $productStocks
* @property Transfer[] $transferHdrs
* @property StockOpname[] $stockOpnames
* @property SalesDtl[] $salesDtls
* @property PurchaseDtl[] $purchaseDtls
* @property Branch $idBranch
* @property StockAdjustment[] $stockAdjustments
*/
class Warehouse extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%warehouse}}';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_branch', 'cd_whse', 'nm_whse'], 'required'],
[['id_branch'], 'integer'],
[['cd_whse'], 'string', 'max' => 4],
[['nm_whse'], 'string', 'max' => 32]
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id_warehouse' => 'Id Warehouse',
'id_branch' => 'Id Branch',
'cd_whse' => 'Cd Whse',
'nm_whse' => 'Nm Whse',
'create_at' => 'Create At',
'create_by' => 'Create By',
'update_at' => 'Update At',
'update_by' => 'Update By',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getProductStocks()
{
return $this->hasMany(ProductStock::className(), ['id_warehouse' => 'id_warehouse']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getTransfers()
{
return $this->hasMany(Transfer::className(), ['id_warehouse_dest' => 'id_warehouse']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getStockOpnames()
{
return $this->hasMany(StockOpname::className(), ['id_warehouse' => 'id_warehouse']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getSalesDtls()
{
return $this->hasMany(SalesDtl::className(), ['id_warehouse' => 'id_warehouse']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getPurchaseDtls()
{
return $this->hasMany(PurchaseDtl::className(), ['id_warehouse' => 'id_warehouse']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getIdBranch()
{
return $this->hasOne(Branch::className(), ['id_branch' => 'id_branch']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getStockAdjustments()
{
return $this->hasMany(StockAdjustment::className(), ['id_warehouse' => 'id_warehouse']);
}
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'BizTimestampBehavior',
'BizBlameableBehavior',
];
}
}