|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* Copyright (C) 2024 Rafael San José <[email protected]> |
|
4
|
|
|
* |
|
5
|
|
|
* This program is free software; you can redistribute it and/or modify |
|
6
|
|
|
* it under the terms of the GNU General Public License as published by |
|
7
|
|
|
* the Free Software Foundation; either version 3 of the License, or |
|
8
|
|
|
* any later version. |
|
9
|
|
|
* |
|
10
|
|
|
* This program is distributed in the hope that it will be useful, |
|
11
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13
|
|
|
* GNU General Public License for more details. |
|
14
|
|
|
* |
|
15
|
|
|
* You should have received a copy of the GNU General Public License |
|
16
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
17
|
|
|
*/ |
|
18
|
|
|
|
|
19
|
|
|
namespace Dolibarr\Code\Expedition\Model; |
|
20
|
|
|
|
|
21
|
|
|
use Dolibarr\Core\Base\Model; |
|
22
|
|
|
use Illuminate\Database\Eloquent\Collection; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* Class Expeditiondet |
|
26
|
|
|
* |
|
27
|
|
|
* @property int $rowid |
|
28
|
|
|
* @property int $fk_expedition |
|
29
|
|
|
* @property int|null $fk_element |
|
30
|
|
|
* @property int|null $fk_elementdet |
|
31
|
|
|
* @property string $element_type |
|
32
|
|
|
* @property int|null $fk_product |
|
33
|
|
|
* @property float|null $qty |
|
34
|
|
|
* @property int|null $fk_entrepot |
|
35
|
|
|
* @property int|null $rang |
|
36
|
|
|
* |
|
37
|
|
|
* @property Expedition $expedition |
|
38
|
|
|
* @property Collection|ExpeditiondetBatch[] $expeditiondet_batches |
|
39
|
|
|
*/ |
|
40
|
|
|
class Expeditiondet extends Model |
|
41
|
|
|
{ |
|
42
|
|
|
public $timestamps = false; |
|
43
|
|
|
protected $table = 'expeditiondet'; |
|
44
|
|
|
protected $casts = [ |
|
45
|
|
|
'fk_expedition' => 'int', |
|
46
|
|
|
'fk_element' => 'int', |
|
47
|
|
|
'fk_elementdet' => 'int', |
|
48
|
|
|
'fk_product' => 'int', |
|
49
|
|
|
'qty' => 'float', |
|
50
|
|
|
'fk_entrepot' => 'int', |
|
51
|
|
|
'rang' => 'int' |
|
52
|
|
|
]; |
|
53
|
|
|
|
|
54
|
|
|
protected $fillable = [ |
|
55
|
|
|
'fk_expedition', |
|
56
|
|
|
'fk_element', |
|
57
|
|
|
'fk_elementdet', |
|
58
|
|
|
'element_type', |
|
59
|
|
|
'fk_product', |
|
60
|
|
|
'qty', |
|
61
|
|
|
'fk_entrepot', |
|
62
|
|
|
'rang' |
|
63
|
|
|
]; |
|
64
|
|
|
|
|
65
|
|
|
public function expedition() |
|
66
|
|
|
{ |
|
67
|
|
|
return $this->belongsTo(Expedition::class, 'fk_expedition'); |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
public function expeditiondet_batches() |
|
71
|
|
|
{ |
|
72
|
|
|
return $this->hasMany(ExpeditiondetBatch::class, 'fk_expeditiondet'); |
|
73
|
|
|
} |
|
74
|
|
|
} |
|
75
|
|
|
|