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

FacturedetRec::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\Compta\Model;
20
21
use Dolibarr\Core\Base\Model;
22
use Dolibarr\Core\Model\CUnit;
23
24
/**
25
 * Class FacturedetRec
26
 *
27
 * @property int $rowid
28
 * @property int $fk_facture
29
 * @property int|null $fk_parent_line
30
 * @property int|null $fk_product
31
 * @property int|null $product_type
32
 * @property string|null $label
33
 * @property string|null $description
34
 * @property string|null $vat_src_code
35
 * @property float|null $tva_tx
36
 * @property float|null $localtax1_tx
37
 * @property string|null $localtax1_type
38
 * @property float|null $localtax2_tx
39
 * @property string|null $localtax2_type
40
 * @property float|null $qty
41
 * @property float|null $remise_percent
42
 * @property float|null $remise
43
 * @property float|null $subprice
44
 * @property float|null $price
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 $date_start_fill
51
 * @property int|null $date_end_fill
52
 * @property int|null $info_bits
53
 * @property float|null $buy_price_ht
54
 * @property int|null $fk_product_fournisseur_price
55
 * @property int|null $special_code
56
 * @property int|null $rang
57
 * @property int|null $fk_contract_line
58
 * @property int|null $fk_unit
59
 * @property string|null $import_key
60
 * @property int|null $fk_user_author
61
 * @property int|null $fk_user_modif
62
 * @property int|null $fk_multicurrency
63
 * @property string|null $multicurrency_code
64
 * @property float|null $multicurrency_subprice
65
 * @property float|null $multicurrency_total_ht
66
 * @property float|null $multicurrency_total_tva
67
 * @property float|null $multicurrency_total_ttc
68
 *
69
 * @property CUnit|null $c_unit
70
 */
71
class FacturedetRec extends Model
72
{
73
    public $timestamps = false;
74
    protected $table = 'facturedet_rec';
75
    protected $casts = [
76
        'fk_facture' => 'int',
77
        'fk_parent_line' => 'int',
78
        'fk_product' => 'int',
79
        'product_type' => 'int',
80
        'tva_tx' => 'float',
81
        'localtax1_tx' => 'float',
82
        'localtax2_tx' => 'float',
83
        'qty' => 'float',
84
        'remise_percent' => 'float',
85
        'remise' => 'float',
86
        'subprice' => 'float',
87
        'price' => 'float',
88
        'total_ht' => 'float',
89
        'total_tva' => 'float',
90
        'total_localtax1' => 'float',
91
        'total_localtax2' => 'float',
92
        'total_ttc' => 'float',
93
        'date_start_fill' => 'int',
94
        'date_end_fill' => 'int',
95
        'info_bits' => 'int',
96
        'buy_price_ht' => 'float',
97
        'fk_product_fournisseur_price' => 'int',
98
        'special_code' => 'int',
99
        'rang' => 'int',
100
        'fk_contract_line' => 'int',
101
        'fk_unit' => 'int',
102
        'fk_user_author' => 'int',
103
        'fk_user_modif' => 'int',
104
        'fk_multicurrency' => 'int',
105
        'multicurrency_subprice' => 'float',
106
        'multicurrency_total_ht' => 'float',
107
        'multicurrency_total_tva' => 'float',
108
        'multicurrency_total_ttc' => 'float'
109
    ];
110
111
    protected $fillable = [
112
        'fk_facture',
113
        'fk_parent_line',
114
        'fk_product',
115
        'product_type',
116
        'label',
117
        'description',
118
        'vat_src_code',
119
        'tva_tx',
120
        'localtax1_tx',
121
        'localtax1_type',
122
        'localtax2_tx',
123
        'localtax2_type',
124
        'qty',
125
        'remise_percent',
126
        'remise',
127
        'subprice',
128
        'price',
129
        'total_ht',
130
        'total_tva',
131
        'total_localtax1',
132
        'total_localtax2',
133
        'total_ttc',
134
        'date_start_fill',
135
        'date_end_fill',
136
        'info_bits',
137
        'buy_price_ht',
138
        'fk_product_fournisseur_price',
139
        'special_code',
140
        'rang',
141
        'fk_contract_line',
142
        'fk_unit',
143
        'import_key',
144
        'fk_user_author',
145
        'fk_user_modif',
146
        'fk_multicurrency',
147
        'multicurrency_code',
148
        'multicurrency_subprice',
149
        'multicurrency_total_ht',
150
        'multicurrency_total_tva',
151
        'multicurrency_total_ttc'
152
    ];
153
154
    public function c_unit()
155
    {
156
        return $this->belongsTo(CUnit::class, 'fk_unit');
157
    }
158
}
159