Completed
Push — master ( f4e7d7...63b99e )
by Giancarlos
06: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 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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\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 4
    public function getSerie()
108
    {
109 4
        return $this->serie;
110
    }
111
112
    /**
113
     * @param string $serie
114
     * @return Perception
115
     */
116 6
    public function setSerie($serie)
117
    {
118 6
        $this->serie = $serie;
119 6
        return $this;
120
    }
121
122
    /**
123
     * @return string
124
     */
125 4
    public function getCorrelativo()
126
    {
127 4
        return $this->correlativo;
128
    }
129
130
    /**
131
     * @param string $correlativo
132
     * @return Perception
133
     */
134 6
    public function setCorrelativo($correlativo)
135
    {
136 6
        $this->correlativo = $correlativo;
137 6
        return $this;
138
    }
139
140
    /**
141
     * @return \DateTime
142
     */
143 4
    public function getFechaEmision()
144
    {
145 4
        return $this->fechaEmision;
146
    }
147
148
    /**
149
     * @param \DateTime $fechaEmision
150
     * @return Perception
151
     */
152 6
    public function setFechaEmision($fechaEmision)
153
    {
154 6
        $this->fechaEmision = $fechaEmision;
155 6
        return $this;
156
    }
157
158
    /**
159
     * @return Company
160
     */
161 4
    public function getCompany()
162
    {
163 4
        return $this->company;
164
    }
165
166
    /**
167
     * @param Company $company
168
     * @return Perception
169
     */
170 6
    public function setCompany($company)
171
    {
172 6
        $this->company = $company;
173 6
        return $this;
174
    }
175
176
    /**
177
     * @return Client
178
     */
179 4
    public function getProveedor()
180
    {
181 4
        return $this->proveedor;
182
    }
183
184
    /**
185
     * @param Client $proveedor
186
     * @return Perception
187
     */
188 6
    public function setProveedor($proveedor)
189
    {
190 6
        $this->proveedor = $proveedor;
191 6
        return $this;
192
    }
193
194
    /**
195
     * @return string
196
     */
197 4
    public function getRegimen()
198
    {
199 4
        return $this->regimen;
200
    }
201
202
    /**
203
     * @param string $regimen
204
     * @return Perception
205
     */
206 6
    public function setRegimen($regimen)
207
    {
208 6
        $this->regimen = $regimen;
209 6
        return $this;
210
    }
211
212
    /**
213
     * @return float
214
     */
215 4
    public function getTasa()
216
    {
217 4
        return $this->tasa;
218
    }
219
220
    /**
221
     * @param float $tasa
222
     * @return Perception
223
     */
224 6
    public function setTasa($tasa)
225
    {
226 6
        $this->tasa = $tasa;
227 6
        return $this;
228
    }
229
230
    /**
231
     * @return float
232
     */
233 4
    public function getImpPercibido()
234
    {
235 4
        return $this->impPercibido;
236
    }
237
238
    /**
239
     * @param float $impPercibido
240
     * @return Perception
241
     */
242 6
    public function setImpPercibido($impPercibido)
243
    {
244 6
        $this->impPercibido = $impPercibido;
245 6
        return $this;
246
    }
247
248
    /**
249
     * @return float
250
     */
251 4
    public function getImpCobrado()
252
    {
253 4
        return $this->impCobrado;
254
    }
255
256
    /**
257
     * @param float $impCobrado
258
     * @return Perception
259
     */
260 6
    public function setImpCobrado($impCobrado)
261
    {
262 6
        $this->impCobrado = $impCobrado;
263 6
        return $this;
264
    }
265
266
    /**
267
     * @return string
268
     */
269 4
    public function getObservacion()
270
    {
271 4
        return $this->observacion;
272
    }
273
274
    /**
275
     * @param string $observacion
276
     * @return Perception
277
     */
278 6
    public function setObservacion($observacion)
279
    {
280 6
        $this->observacion = $observacion;
281 6
        return $this;
282
    }
283
284
    /**
285
     * @return PerceptionDetail[]
286
     */
287 4
    public function getDetails()
288
    {
289 4
        return $this->details;
290
    }
291
292
    /**
293
     * @param PerceptionDetail[] $details
294
     * @return Perception
295
     */
296 6
    public function setDetails($details)
297
    {
298 6
        $this->details = $details;
299 6
        return $this;
300
    }
301
302
    /**
303
     * Get FileName without extension.
304
     *
305
     * @return string
306
     */
307 4
    public function getName()
308
    {
309
        $parts = [
310 4
            $this->company->getRuc(),
311 4
            '40',
312 4
            $this->getSerie(),
313 4
            $this->getCorrelativo(),
314 4
        ];
315
316 4
        return join('-', $parts);
317
    }
318
}