Passed
Push — master ( 28effa...a0de38 )
by Giancarlos
04:32
created

BaseSale::setFechaEmision()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
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 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 34
    public function getTipoDoc()
142
    {
143 34
        return $this->tipoDoc;
144
    }
145
146
    /**
147
     * @param string $tipoDoc
148
     * @return BaseSale
149
     */
150 48
    public function setTipoDoc($tipoDoc)
151
    {
152 48
        $this->tipoDoc = $tipoDoc;
153 48
        return $this;
154
    }
155
156
    /**
157
     * @return string
158
     */
159 28
    public function getSerie()
160
    {
161 28
        return $this->serie;
162
    }
163
164
    /**
165
     * @param string $serie
166
     * @return BaseSale
167
     */
168 48
    public function setSerie($serie)
169
    {
170 48
        $this->serie = $serie;
171 48
        return $this;
172
    }
173
174
    /**
175
     * @return string
176
     */
177 28
    public function getCorrelativo()
178
    {
179 28
        return $this->correlativo;
180
    }
181
182
    /**
183
     * @param string $correlativo
184
     * @return BaseSale
185
     */
186 48
    public function setCorrelativo($correlativo)
187
    {
188 48
        $this->correlativo = $correlativo;
189 48
        return $this;
190
    }
191
192
    /**
193
     * @return \DateTime
194
     */
195 24
    public function getFechaEmision()
196
    {
197 24
        return $this->fechaEmision;
198
    }
199
200
    /**
201
     * @param \DateTime $fechaEmision
202
     * @return BaseSale
203
     */
204 48
    public function setFechaEmision($fechaEmision)
205
    {
206 48
        $this->fechaEmision = $fechaEmision;
207 48
        return $this;
208
    }
209
210
    /**
211
     * @return Client
212
     */
213 24
    public function getClient()
214
    {
215 24
        return $this->client;
216
    }
217
218
    /**
219
     * @param Client $client
220
     * @return BaseSale
221
     */
222 48
    public function setClient($client)
223
    {
224 48
        $this->client = $client;
225 48
        return $this;
226
    }
227
228
    /**
229
     * @return Company
230
     */
231 28
    public function getCompany()
232
    {
233 28
        return $this->company;
234
    }
235
236
    /**
237
     * @param Company $company
238
     * @return BaseSale
239
     */
240 48
    public function setCompany($company)
241
    {
242 48
        $this->company = $company;
243 48
        return $this;
244
    }
245
246
    /**
247
     * @return mixed
248
     */
249 24
    public function getTipoMoneda()
250
    {
251 24
        return $this->tipoMoneda;
252
    }
253
254
    /**
255
     * @param mixed $tipoMoneda
256
     * @return BaseSale
257
     */
258 48
    public function setTipoMoneda($tipoMoneda)
259
    {
260 48
        $this->tipoMoneda = $tipoMoneda;
261 48
        return $this;
262
    }
263
264
    /**
265
     * @return mixed
266
     */
267 24
    public function getSumOtrosCargos()
268
    {
269 24
        return $this->sumOtrosCargos;
270
    }
271
272
    /**
273
     * @param mixed $sumOtrosCargos
274
     * @return BaseSale
275
     */
276 12
    public function setSumOtrosCargos($sumOtrosCargos)
277
    {
278 12
        $this->sumOtrosCargos = $sumOtrosCargos;
279 12
        return $this;
280
    }
281
282
    /**
283
     * @return mixed
284
     */
285 24
    public function getMtoOperGravadas()
286
    {
287 24
        return $this->mtoOperGravadas;
288
    }
289
290
    /**
291
     * @param mixed $mtoOperGravadas
292
     * @return BaseSale
293
     */
294 48
    public function setMtoOperGravadas($mtoOperGravadas)
295
    {
296 48
        $this->mtoOperGravadas = $mtoOperGravadas;
297 48
        return $this;
298
    }
299
300
    /**
301
     * @return mixed
302
     */
303 24
    public function getMtoOperInafectas()
304
    {
305 24
        return $this->mtoOperInafectas;
306
    }
307
308
    /**
309
     * @param mixed $mtoOperInafectas
310
     * @return BaseSale
311
     */
312 48
    public function setMtoOperInafectas($mtoOperInafectas)
313
    {
314 48
        $this->mtoOperInafectas = $mtoOperInafectas;
315 48
        return $this;
316
    }
317
318
    /**
319
     * @return float
320
     */
321 24
    public function getMtoOperExoneradas()
322
    {
323 24
        return $this->mtoOperExoneradas;
324
    }
325
326
    /**
327
     * @param float $mtoOperExoneradas
328
     * @return BaseSale
329
     */
330 48
    public function setMtoOperExoneradas($mtoOperExoneradas)
331
    {
332 48
        $this->mtoOperExoneradas = $mtoOperExoneradas;
333 48
        return $this;
334
    }
335
336
    /**
337
     * @return mixed
338
     */
339 24
    public function getMtoIGV()
340
    {
341 24
        return $this->mtoIGV;
342
    }
343
344
    /**
345
     * @param mixed $mtoIGV
346
     * @return BaseSale
347
     */
348 48
    public function setMtoIGV($mtoIGV)
349
    {
350 48
        $this->mtoIGV = $mtoIGV;
351 48
        return $this;
352
    }
353
354
    /**
355
     * @return mixed
356
     */
357 24
    public function getMtoISC()
358
    {
359 24
        return $this->mtoISC;
360
    }
361
362
    /**
363
     * @param mixed $mtoISC
364
     * @return BaseSale
365
     */
366 12
    public function setMtoISC($mtoISC)
367
    {
368 12
        $this->mtoISC = $mtoISC;
369 12
        return $this;
370
    }
371
372
    /**
373
     * @return float
374
     */
375 24
    public function getMtoOtrosTributos()
376
    {
377 24
        return $this->mtoOtrosTributos;
378
    }
379
380
    /**
381
     * @param float $mtoOtrosTributos
382
     * @return BaseSale
383
     */
384 12
    public function setMtoOtrosTributos($mtoOtrosTributos)
385
    {
386 12
        $this->mtoOtrosTributos = $mtoOtrosTributos;
387 12
        return $this;
388
    }
389
390
    /**
391
     * @return float
392
     */
393 24
    public function getMtoImpVenta()
394
    {
395 24
        return $this->mtoImpVenta;
396
    }
397
398
    /**
399
     * @param float $mtoImpVenta
400
     * @return BaseSale
401
     */
402 48
    public function setMtoImpVenta($mtoImpVenta)
403
    {
404 48
        $this->mtoImpVenta = $mtoImpVenta;
405 48
        return $this;
406
    }
407
408
    /**
409
     * @return SaleDetail[]
410
     */
411 24
    public function getDetails()
412
    {
413 24
        return $this->details;
414
    }
415
416
    /**
417
     * @param SaleDetail[] $details
418
     * @return BaseSale
419
     */
420 48
    public function setDetails($details)
421
    {
422 48
        $this->details = $details;
423 48
        return $this;
424
    }
425
426
    /**
427
     * @return Legend[]
428
     */
429 24
    public function getLegends()
430
    {
431 24
        return $this->legends;
432
    }
433
434
    /**
435
     * @param Legend[] $legends
436
     * @return BaseSale
437
     */
438 48
    public function setLegends($legends)
439
    {
440 48
        $this->legends = $legends;
441 48
        return $this;
442
    }
443
444
    /**
445
     * @return Document[]
446
     */
447 24
    public function getRelDocs()
448
    {
449 24
        return $this->relDocs;
450
    }
451
452
    /**
453
     * @param Document[] $relDocs
454
     * @return BaseSale
455
     */
456 12
    public function setRelDocs($relDocs)
457
    {
458 12
        $this->relDocs = $relDocs;
459 12
        return $this;
460
    }
461
462
    /**
463
     * Get FileName without extension.
464
     *
465
     * @return string
466
     */
467 22 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 22
            $this->company->getRuc(),
471 22
            $this->getTipoDoc(),
472 22
            $this->getSerie(),
473 22
            $this->getCorrelativo(),
474 22
        ];
475
476 22
        return join('-', $parts);
477
    }
478
}