Completed
Push — master ( f4e7d7...63b99e )
by Giancarlos
06:02
created

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