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

BaseSale::getRelDocs()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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