Passed
Push — MODEL_LIB_240928 ( 143dd3...d1103d )
by Rafael
57:04 queued 21s
created

FactureFournDetRec::c_unit()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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\FactureFournisseur\Model;
20
21
use Dolibarr\Core\Base\Model;
22
use Dolibarr\Core\Model\CUnit;
23
24
/**
25
 * Class FactureFournDetRec
26
 *
27
 * @property int $rowid
28
 * @property int $fk_facture_fourn
29
 * @property int|null $fk_parent_line
30
 * @property int|null $fk_product
31
 * @property string|null $ref
32
 * @property string|null $label
33
 * @property string|null $description
34
 * @property float|null $pu_ht
35
 * @property float|null $pu_ttc
36
 * @property float|null $qty
37
 * @property float|null $remise_percent
38
 * @property int|null $fk_remise_except
39
 * @property string|null $vat_src_code
40
 * @property float|null $tva_tx
41
 * @property float|null $localtax1_tx
42
 * @property string|null $localtax1_type
43
 * @property float|null $localtax2_tx
44
 * @property string|null $localtax2_type
45
 * @property float|null $total_ht
46
 * @property float|null $total_tva
47
 * @property float|null $total_localtax1
48
 * @property float|null $total_localtax2
49
 * @property float|null $total_ttc
50
 * @property int|null $product_type
51
 * @property int|null $date_start
52
 * @property int|null $date_end
53
 * @property int|null $info_bits
54
 * @property int|null $special_code
55
 * @property int|null $rang
56
 * @property int|null $fk_unit
57
 * @property string|null $import_key
58
 * @property int|null $fk_user_author
59
 * @property int|null $fk_user_modif
60
 * @property int|null $fk_multicurrency
61
 * @property string|null $multicurrency_code
62
 * @property float|null $multicurrency_subprice
63
 * @property float|null $multicurrency_total_ht
64
 * @property float|null $multicurrency_total_tva
65
 * @property float|null $multicurrency_total_ttc
66
 *
67
 * @property CUnit|null $c_unit
68
 */
69
class FactureFournDetRec extends Model
70
{
71
    public $timestamps = false;
72
    protected $table = 'facture_fourn_det_rec';
73
    protected $casts = [
74
        'fk_facture_fourn' => 'int',
75
        'fk_parent_line' => 'int',
76
        'fk_product' => 'int',
77
        'pu_ht' => 'float',
78
        'pu_ttc' => 'float',
79
        'qty' => 'float',
80
        'remise_percent' => 'float',
81
        'fk_remise_except' => 'int',
82
        'tva_tx' => 'float',
83
        'localtax1_tx' => 'float',
84
        'localtax2_tx' => 'float',
85
        'total_ht' => 'float',
86
        'total_tva' => 'float',
87
        'total_localtax1' => 'float',
88
        'total_localtax2' => 'float',
89
        'total_ttc' => 'float',
90
        'product_type' => 'int',
91
        'date_start' => 'int',
92
        'date_end' => 'int',
93
        'info_bits' => 'int',
94
        'special_code' => 'int',
95
        'rang' => 'int',
96
        'fk_unit' => 'int',
97
        'fk_user_author' => 'int',
98
        'fk_user_modif' => 'int',
99
        'fk_multicurrency' => 'int',
100
        'multicurrency_subprice' => 'float',
101
        'multicurrency_total_ht' => 'float',
102
        'multicurrency_total_tva' => 'float',
103
        'multicurrency_total_ttc' => 'float'
104
    ];
105
106
    protected $fillable = [
107
        'fk_facture_fourn',
108
        'fk_parent_line',
109
        'fk_product',
110
        'ref',
111
        'label',
112
        'description',
113
        'pu_ht',
114
        'pu_ttc',
115
        'qty',
116
        'remise_percent',
117
        'fk_remise_except',
118
        'vat_src_code',
119
        'tva_tx',
120
        'localtax1_tx',
121
        'localtax1_type',
122
        'localtax2_tx',
123
        'localtax2_type',
124
        'total_ht',
125
        'total_tva',
126
        'total_localtax1',
127
        'total_localtax2',
128
        'total_ttc',
129
        'product_type',
130
        'date_start',
131
        'date_end',
132
        'info_bits',
133
        'special_code',
134
        'rang',
135
        'fk_unit',
136
        'import_key',
137
        'fk_user_author',
138
        'fk_user_modif',
139
        'fk_multicurrency',
140
        'multicurrency_code',
141
        'multicurrency_subprice',
142
        'multicurrency_total_ht',
143
        'multicurrency_total_tva',
144
        'multicurrency_total_ttc'
145
    ];
146
147
    public function c_unit()
148
    {
149
        return $this->belongsTo(CUnit::class, 'fk_unit');
150
    }
151
}
152