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

BaseSale::getFileName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 11
Ratio 100 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 11
loc 11
ccs 7
cts 7
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Giansalex
5
 * Date: 17/07/2017
6
 * Time: 23:26
7
 */
8
9
namespace Greenter\Model\Sale;
10
use Greenter\Model\Client\Client;
11
use Greenter\Model\Company\Company;
12
use Symfony\Component\Validator\Constraints as Assert;
13
14
/**
15
 * Class BaseSale
16
 * @package Greenter\Model\Sale
17
 */
18
class BaseSale
19
{
20
    /**
21
     * @Assert\NotBlank()
22
     * @Assert\Length(max="2")
23
     * @var string
24
     */
25
    protected $tipoDoc;
26
27
    /**
28
     * @Assert\NotBlank()
29
     * @Assert\Length(max="4")
30
     * @var string
31
     */
32
    protected $serie;
33
34
    /**
35
     * @Assert\NotBlank()
36
     * @Assert\Length(max="8")
37
     * @var string
38
     */
39
    protected $correlativo;
40
41
    /**
42
     * @Assert\NotBlank()
43
     * @Assert\Date()
44
     * @var \DateTime
45
     */
46
    protected $fechaEmision;
47
48
    /**
49
     * @Assert\NotBlank()
50
     * @Assert\Valid()
51
     * @var Company
52
     */
53
    protected $company;
54
55
    /**
56
     * @Assert\NotBlank()
57
     * @Assert\Valid()
58
     * @var Client
59
     */
60
    protected $client;
61
62
    /**
63
     * @Assert\NotBlank()
64
     * @Assert\Length(max="3")
65
     * @var string
66
     */
67
    protected $tipoMoneda;
68
69
    /**
70
     * @var float
71
     */
72
    protected $sumOtrosCargos;
73
74
    /**
75
     * @Assert\NotBlank()
76
     * @Assert\Type("numeric")
77
     * @var float
78
     */
79
    protected $mtoOperGravadas;
80
81
    /**
82
     * @Assert\NotBlank()
83
     * @Assert\Type("numeric")
84
     * @var float
85
     */
86
    protected $mtoOperInafectas;
87
88
    /**
89
     * @Assert\NotBlank()
90
     * @Assert\Type("numeric")
91
     * @var float
92
     */
93
    protected $mtoOperExoneradas;
94
95
    /**
96
     * @var float
97
     */
98
    protected $mtoIGV;
99
100
    /**
101
     * @var float
102
     */
103
    protected $mtoISC;
104
105
    /**
106
     * @var float
107
     */
108
    protected $mtoOtrosTributos;
109
110
    /**
111
     * Importe total de la venta, cesión en uso o del servicio prestado.
112
     *
113
     * @Assert\NotBlank()
114
     * @Assert\Type("numeric")
115
     * @var float
116
     */
117
    protected $mtoImpVenta;
118
119
    /**
120
     * @Assert\Valid()
121
     * @var SaleDetail[]
122
     */
123
    protected $details;
124
125
    /**
126
     * @Assert\Valid()
127
     * @var Legend[]
128
     */
129
    protected $legends;
130
131
    /**
132
     * @Assert\Valid()
133
     * @var Document[]
134
     */
135
    protected $relDocs;
136
137
    /**
138
     * @return string
139
     */
140 28
    public function getTipoDoc()
141
    {
142 28
        return $this->tipoDoc;
143
    }
144
145
    /**
146
     * @param string $tipoDoc
147
     * @return BaseSale
148
     */
149 48
    public function setTipoDoc($tipoDoc)
150
    {
151 48
        $this->tipoDoc = $tipoDoc;
152 48
        return $this;
153
    }
154
155
    /**
156
     * @return string
157
     */
158 28
    public function getSerie()
159
    {
160 28
        return $this->serie;
161
    }
162
163
    /**
164
     * @param string $serie
165
     * @return BaseSale
166
     */
167 48
    public function setSerie($serie)
168
    {
169 48
        $this->serie = $serie;
170 48
        return $this;
171
    }
172
173
    /**
174
     * @return string
175
     */
176 28
    public function getCorrelativo()
177
    {
178 28
        return $this->correlativo;
179
    }
180
181
    /**
182
     * @param string $correlativo
183
     * @return BaseSale
184
     */
185 48
    public function setCorrelativo($correlativo)
186
    {
187 48
        $this->correlativo = $correlativo;
188 48
        return $this;
189
    }
190
191
    /**
192
     * @return \DateTime
193
     */
194 24
    public function getFechaEmision()
195
    {
196 24
        return $this->fechaEmision;
197
    }
198
199
    /**
200
     * @param \DateTime $fechaEmision
201
     * @return BaseSale
202
     */
203 48
    public function setFechaEmision($fechaEmision)
204
    {
205 48
        $this->fechaEmision = $fechaEmision;
206 48
        return $this;
207
    }
208
209
    /**
210
     * @return Client
211
     */
212 24
    public function getClient()
213
    {
214 24
        return $this->client;
215
    }
216
217
    /**
218
     * @param Client $client
219
     * @return BaseSale
220
     */
221 48
    public function setClient($client)
222
    {
223 48
        $this->client = $client;
224 48
        return $this;
225
    }
226
227
    /**
228
     * @return Company
229
     */
230 28
    public function getCompany()
231
    {
232 28
        return $this->company;
233
    }
234
235
    /**
236
     * @param Company $company
237
     * @return BaseSale
238
     */
239 48
    public function setCompany($company)
240
    {
241 48
        $this->company = $company;
242 48
        return $this;
243
    }
244
245
    /**
246
     * @return mixed
247
     */
248 24
    public function getTipoMoneda()
249
    {
250 24
        return $this->tipoMoneda;
251
    }
252
253
    /**
254
     * @param mixed $tipoMoneda
255
     * @return BaseSale
256
     */
257 48
    public function setTipoMoneda($tipoMoneda)
258
    {
259 48
        $this->tipoMoneda = $tipoMoneda;
260 48
        return $this;
261
    }
262
263
    /**
264
     * @return mixed
265
     */
266 24
    public function getSumOtrosCargos()
267
    {
268 24
        return $this->sumOtrosCargos;
269
    }
270
271
    /**
272
     * @param mixed $sumOtrosCargos
273
     * @return BaseSale
274
     */
275 12
    public function setSumOtrosCargos($sumOtrosCargos)
276
    {
277 12
        $this->sumOtrosCargos = $sumOtrosCargos;
278 12
        return $this;
279
    }
280
281
    /**
282
     * @return mixed
283
     */
284 24
    public function getMtoOperGravadas()
285
    {
286 24
        return $this->mtoOperGravadas;
287
    }
288
289
    /**
290
     * @param mixed $mtoOperGravadas
291
     * @return BaseSale
292
     */
293 48
    public function setMtoOperGravadas($mtoOperGravadas)
294
    {
295 48
        $this->mtoOperGravadas = $mtoOperGravadas;
296 48
        return $this;
297
    }
298
299
    /**
300
     * @return mixed
301
     */
302 24
    public function getMtoOperInafectas()
303
    {
304 24
        return $this->mtoOperInafectas;
305
    }
306
307
    /**
308
     * @param mixed $mtoOperInafectas
309
     * @return BaseSale
310
     */
311 48
    public function setMtoOperInafectas($mtoOperInafectas)
312
    {
313 48
        $this->mtoOperInafectas = $mtoOperInafectas;
314 48
        return $this;
315
    }
316
317
    /**
318
     * @return float
319
     */
320 24
    public function getMtoOperExoneradas()
321
    {
322 24
        return $this->mtoOperExoneradas;
323
    }
324
325
    /**
326
     * @param float $mtoOperExoneradas
327
     * @return BaseSale
328
     */
329 48
    public function setMtoOperExoneradas($mtoOperExoneradas)
330
    {
331 48
        $this->mtoOperExoneradas = $mtoOperExoneradas;
332 48
        return $this;
333
    }
334
335
    /**
336
     * @return mixed
337
     */
338 24
    public function getMtoIGV()
339
    {
340 24
        return $this->mtoIGV;
341
    }
342
343
    /**
344
     * @param mixed $mtoIGV
345
     * @return BaseSale
346
     */
347 48
    public function setMtoIGV($mtoIGV)
348
    {
349 48
        $this->mtoIGV = $mtoIGV;
350 48
        return $this;
351
    }
352
353
    /**
354
     * @return mixed
355
     */
356 24
    public function getMtoISC()
357
    {
358 24
        return $this->mtoISC;
359
    }
360
361
    /**
362
     * @param mixed $mtoISC
363
     * @return BaseSale
364
     */
365 12
    public function setMtoISC($mtoISC)
366
    {
367 12
        $this->mtoISC = $mtoISC;
368 12
        return $this;
369
    }
370
371
    /**
372
     * @return float
373
     */
374 24
    public function getMtoOtrosTributos()
375
    {
376 24
        return $this->mtoOtrosTributos;
377
    }
378
379
    /**
380
     * @param float $mtoOtrosTributos
381
     * @return BaseSale
382
     */
383 12
    public function setMtoOtrosTributos($mtoOtrosTributos)
384
    {
385 12
        $this->mtoOtrosTributos = $mtoOtrosTributos;
386 12
        return $this;
387
    }
388
389
    /**
390
     * @return float
391
     */
392 24
    public function getMtoImpVenta()
393
    {
394 24
        return $this->mtoImpVenta;
395
    }
396
397
    /**
398
     * @param float $mtoImpVenta
399
     * @return BaseSale
400
     */
401 48
    public function setMtoImpVenta($mtoImpVenta)
402
    {
403 48
        $this->mtoImpVenta = $mtoImpVenta;
404 48
        return $this;
405
    }
406
407
    /**
408
     * @return SaleDetail[]
409
     */
410 24
    public function getDetails()
411
    {
412 24
        return $this->details;
413
    }
414
415
    /**
416
     * @param SaleDetail[] $details
417
     * @return BaseSale
418
     */
419 48
    public function setDetails($details)
420
    {
421 48
        $this->details = $details;
422 48
        return $this;
423
    }
424
425
    /**
426
     * @return Legend[]
427
     */
428 24
    public function getLegends()
429
    {
430 24
        return $this->legends;
431
    }
432
433
    /**
434
     * @param Legend[] $legends
435
     * @return BaseSale
436
     */
437 48
    public function setLegends($legends)
438
    {
439 48
        $this->legends = $legends;
440 48
        return $this;
441
    }
442
443
    /**
444
     * @return Document[]
445
     */
446 24
    public function getRelDocs()
447
    {
448 24
        return $this->relDocs;
449
    }
450
451
    /**
452
     * @param Document[] $relDocs
453
     * @return BaseSale
454
     */
455 12
    public function setRelDocs($relDocs)
456
    {
457 12
        $this->relDocs = $relDocs;
458 12
        return $this;
459
    }
460
461
    /**
462
     * Get FileName without extension.
463
     *
464
     * @return string
465
     */
466 22 View Code Duplication
    public function getFileName()
0 ignored issues
show
Duplication introduced by
This method 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...
467
    {
468
        $parts = [
469 22
            $this->company->getRuc(),
470 22
            $this->getTipoDoc(),
471 22
            $this->getSerie(),
472 22
            $this->getCorrelativo(),
473 22
        ];
474
475 22
        return join('-', $parts);
476
    }
477
}