Test Failed
Push — master ( 05d675...f4e7d7 )
by Giancarlos
04:02
created

Perception::getSerie()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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