Passed
Branch master (a43e58)
by Giancarlos
04:04
created

Perception::setImpPercibido()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 5
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Administrador
5
 * Date: 08/08/2017
6
 * Time: 11:38 AM
7
 */
8
9
namespace Greenter\Model\Perception;
10
11
use Greenter\Model\Client\Client;
12
use Greenter\Model\Company\Company;
13
use Greenter\Xml\Validator\PerceptionValidator;
14
15
/**
16
 * Class Perception
17
 * @package Greenter\Model\Perception
18
 */
19 View Code Duplication
class Perception
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20
{
21
    use PerceptionValidator;
22
23
    /**
24
     * Serie del Documento (ejem: P001)
25
     *
26
     * @Assert\NotBlank()
27
     * @Assert\Length(max="4")
28
     * @var string
29
     */
30
    private $serie;
31
32
    /**
33
     * @Assert\NotBlank()
34
     * @Assert\Length(max="8")
35
     * @var string
36
     */
37
    private $correlativo;
38
39
    /**
40
     * @Assert\Date()
41
     * @var \DateTime
42
     */
43
    private $fechaEmision;
44
45
    /**
46
     * @Assert\NotBlank()
47
     * @Assert\Valid()
48
     * @var Company
49
     */
50
    private $company;
51
52
    /**
53
     * @Assert\NotBlank()
54
     * @Assert\Valid()
55
     * @var Client
56
     */
57
    private $proveedor;
58
59
    /**
60
     * @Assert\NotBlank()
61
     * @Assert\Length(min="2", max="2")
62
     * @var string
63
     */
64
    private $regimen;
65
66
    /**
67
     * @Assert\NotBlank()
68
     * @var float
69
     */
70
    private $tasa;
71
72
    /**
73
     * Importe total Percibido.
74
     *
75
     * @Assert\NotBlank()
76
     * @var float
77
     */
78
    private $impPercibido;
79
80
    /**
81
     * Importe total Cobrado.
82
     *
83
     * @Assert\NotBlank()
84
     * @var float
85
     */
86
    private $impCobrado;
87
88
    /**
89
     * @Assert\Length(max="250")
90
     * @var string
91
     */
92
    private $observacion;
93
94
    /**
95
     * Dato del Comprobante relacionado.
96
     *
97
     * @Assert\NotBlank()
98
     * @Assert\Valid()
99
     * @var PerceptionDetail[]
100
     */
101
    private $details;
102
103
    /**
104
     * @return string
105
     */
106 8
    public function getSerie()
107
    {
108 8
        return $this->serie;
109
    }
110
111
    /**
112
     * @param string $serie
113
     * @return Perception
114
     */
115 14
    public function setSerie($serie)
116
    {
117 14
        $this->serie = $serie;
118 14
        return $this;
119
    }
120
121
    /**
122
     * @return string
123
     */
124 8
    public function getCorrelativo()
125
    {
126 8
        return $this->correlativo;
127
    }
128
129
    /**
130
     * @param string $correlativo
131
     * @return Perception
132
     */
133 14
    public function setCorrelativo($correlativo)
134
    {
135 14
        $this->correlativo = $correlativo;
136 14
        return $this;
137
    }
138
139
    /**
140
     * @return \DateTime
141
     */
142 6
    public function getFechaEmision()
143
    {
144 6
        return $this->fechaEmision;
145
    }
146
147
    /**
148
     * @param \DateTime $fechaEmision
149
     * @return Perception
150
     */
151 14
    public function setFechaEmision($fechaEmision)
152
    {
153 14
        $this->fechaEmision = $fechaEmision;
154 14
        return $this;
155
    }
156
157
    /**
158
     * @return Company
159
     */
160 8
    public function getCompany()
161
    {
162 8
        return $this->company;
163
    }
164
165
    /**
166
     * @param Company $company
167
     * @return Perception
168
     */
169 14
    public function setCompany($company)
170
    {
171 14
        $this->company = $company;
172 14
        return $this;
173
    }
174
175
    /**
176
     * @return Client
177
     */
178 6
    public function getProveedor()
179
    {
180 6
        return $this->proveedor;
181
    }
182
183
    /**
184
     * @param Client $proveedor
185
     * @return Perception
186
     */
187 14
    public function setProveedor($proveedor)
188
    {
189 14
        $this->proveedor = $proveedor;
190 14
        return $this;
191
    }
192
193
    /**
194
     * @return string
195
     */
196 6
    public function getRegimen()
197
    {
198 6
        return $this->regimen;
199
    }
200
201
    /**
202
     * @param string $regimen
203
     * @return Perception
204
     */
205 14
    public function setRegimen($regimen)
206
    {
207 14
        $this->regimen = $regimen;
208 14
        return $this;
209
    }
210
211
    /**
212
     * @return float
213
     */
214 6
    public function getTasa()
215
    {
216 6
        return $this->tasa;
217
    }
218
219
    /**
220
     * @param float $tasa
221
     * @return Perception
222
     */
223 14
    public function setTasa($tasa)
224
    {
225 14
        $this->tasa = $tasa;
226 14
        return $this;
227
    }
228
229
    /**
230
     * @return float
231
     */
232 6
    public function getImpPercibido()
233
    {
234 6
        return $this->impPercibido;
235
    }
236
237
    /**
238
     * @param float $impPercibido
239
     * @return Perception
240
     */
241 14
    public function setImpPercibido($impPercibido)
242
    {
243 14
        $this->impPercibido = $impPercibido;
244 14
        return $this;
245
    }
246
247
    /**
248
     * @return float
249
     */
250 6
    public function getImpCobrado()
251
    {
252 6
        return $this->impCobrado;
253
    }
254
255
    /**
256
     * @param float $impCobrado
257
     * @return Perception
258
     */
259 14
    public function setImpCobrado($impCobrado)
260
    {
261 14
        $this->impCobrado = $impCobrado;
262 14
        return $this;
263
    }
264
265
    /**
266
     * @return string
267
     */
268 6
    public function getObservacion()
269
    {
270 6
        return $this->observacion;
271
    }
272
273
    /**
274
     * @param string $observacion
275
     * @return Perception
276
     */
277 14
    public function setObservacion($observacion)
278
    {
279 14
        $this->observacion = $observacion;
280 14
        return $this;
281
    }
282
283
    /**
284
     * @return PerceptionDetail[]
285
     */
286 6
    public function getDetails()
287
    {
288 6
        return $this->details;
289
    }
290
291
    /**
292
     * @param PerceptionDetail[] $details
293
     * @return Perception
294
     */
295 14
    public function setDetails($details)
296
    {
297 14
        $this->details = $details;
298 14
        return $this;
299
    }
300
301
    /**
302
     * Get FileName without extension.
303
     *
304
     * @return string
305
     */
306 6
    public function getFileName()
307
    {
308
        $parts = [
309 6
            $this->company->getRuc(),
310 6
            '40',
311 6
            $this->getSerie(),
312 6
            $this->getCorrelativo(),
313 6
        ];
314
315 6
        return join('-', $parts);
316
    }
317
}