Passed
Push — master ( 8cc5c3...c2f62f )
by Giancarlos
03:39
created

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