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

Retention::setSerie()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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