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

Despatch::getTipoDoc()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Giansalex
5
 * Date: 07/08/2017
6
 * Time: 21:42
7
 */
8
9
namespace Greenter\Model\Despatch;
10
11
use Greenter\Model\Client\Client;
12
use Greenter\Model\Company\Company;
13
use Greenter\Model\DocumentInterface;
14
use Greenter\Model\Sale\Document;
15
use Greenter\Xml\Validator\DespatchValidator;
16
use Symfony\Component\Validator\Constraints as Assert;
17
18
/**
19
 * Class Despatch
20
 * @package Greenter\Model\Despatch
21
 */
22
class Despatch implements DocumentInterface
23
{
24
    use DespatchValidator;
25
26
    /**
27
     * @Assert\NotBlank()
28
     * @Assert\Length(max="2")
29
     * @var string
30
     */
31
    private $tipoDoc;
32
33
    /**
34
     * Serie del Documento (ejem: T001)
35
     *
36
     * @Assert\NotBlank()
37
     * @Assert\Length(max="4")
38
     * @var string
39
     */
40
    private $serie;
41
42
    /**
43
     * @Assert\NotBlank()
44
     * @Assert\Length(max="8")
45
     * @var string
46
     */
47
    private $correlativo;
48
49
    /**
50
     * @Assert\Length(max="250")
51
     * @var string
52
     */
53
    private $observacion;
54
    /**
55
     * @Assert\Date()
56
     * @var \DateTime
57
     */
58
    private $fechaEmision;
59
60
    /**
61
     * @Assert\NotBlank()
62
     * @Assert\Valid()
63
     * @var Company
64
     */
65
    private $company;
66
67
    /**
68
     * @Assert\NotBlank()
69
     * @Assert\Valid()
70
     * @var Client
71
     */
72
    private $destinatario;
73
74
    /**
75
     * Datos del Establecimiento del tercero (cuando se ingrese)
76
     *
77
     * @Assert\Valid()
78
     * @var Client
79
     */
80
    private $tercero;
81
82
    /**
83
     * @Assert\NotBlank()
84
     * @Assert\Valid()
85
     * @var Shipment
86
     */
87
    private $envio;
88
89
    /**
90
     * @Assert\Valid()
91
     * @var Document
92
     */
93
    private $docBaja;
94
95
    /**
96
     * @Assert\Valid()
97
     * @var Document
98
     */
99
    private $relDoc;
100
101
    /**
102
     * @Assert\NotBlank()
103
     * @Assert\Valid()
104
     * @var DespatchDetail[]
105
     */
106
    private $details;
107
108
    /**
109
     * @return string
110
     */
111 2
    public function getTipoDoc()
112
    {
113 2
        return $this->tipoDoc;
114
    }
115
116
    /**
117
     * @param string $tipoDoc
118
     * @return Despatch
119
     */
120 2
    public function setTipoDoc($tipoDoc)
121
    {
122 2
        $this->tipoDoc = $tipoDoc;
123 2
        return $this;
124
    }
125
126
    /**
127
     * @return string
128
     */
129 2
    public function getSerie()
130
    {
131 2
        return $this->serie;
132
    }
133
134
    /**
135
     * @param string $serie
136
     * @return Despatch
137
     */
138 2
    public function setSerie($serie)
139
    {
140 2
        $this->serie = $serie;
141 2
        return $this;
142
    }
143
144
    /**
145
     * @return string
146
     */
147 2
    public function getCorrelativo()
148
    {
149 2
        return $this->correlativo;
150
    }
151
152
    /**
153
     * @param string $correlativo
154
     * @return Despatch
155
     */
156 2
    public function setCorrelativo($correlativo)
157
    {
158 2
        $this->correlativo = $correlativo;
159 2
        return $this;
160
    }
161
162
    /**
163
     * @return string
164
     */
165 2
    public function getObservacion()
166
    {
167 2
        return $this->observacion;
168
    }
169
170
    /**
171
     * @param string $observacion
172
     * @return Despatch
173
     */
174 2
    public function setObservacion($observacion)
175
    {
176 2
        $this->observacion = $observacion;
177 2
        return $this;
178
    }
179
180
    /**
181
     * @return \DateTime
182
     */
183 2
    public function getFechaEmision()
184
    {
185 2
        return $this->fechaEmision;
186
    }
187
188
    /**
189
     * @param \DateTime $fechaEmision
190
     * @return Despatch
191
     */
192 2
    public function setFechaEmision($fechaEmision)
193
    {
194 2
        $this->fechaEmision = $fechaEmision;
195 2
        return $this;
196
    }
197
198
    /**
199
     * @return Company
200
     */
201 2
    public function getCompany()
202
    {
203 2
        return $this->company;
204
    }
205
206
    /**
207
     * @param Company $company
208
     * @return Despatch
209
     */
210 2
    public function setCompany($company)
211
    {
212 2
        $this->company = $company;
213 2
        return $this;
214
    }
215
216
    /**
217
     * @return Client
218
     */
219 2
    public function getDestinatario()
220
    {
221 2
        return $this->destinatario;
222
    }
223
224
    /**
225
     * @param Client $destinatario
226
     * @return Despatch
227
     */
228 2
    public function setDestinatario($destinatario)
229
    {
230 2
        $this->destinatario = $destinatario;
231 2
        return $this;
232
    }
233
234
    /**
235
     * @return Client
236
     */
237 2
    public function getTercero()
238
    {
239 2
        return $this->tercero;
240
    }
241
242
    /**
243
     * @param Client $tercero
244
     * @return Despatch
245
     */
246 2
    public function setTercero($tercero)
247
    {
248 2
        $this->tercero = $tercero;
249 2
        return $this;
250
    }
251
252
    /**
253
     * @return Shipment
254
     */
255 2
    public function getEnvio()
256
    {
257 2
        return $this->envio;
258
    }
259
260
    /**
261
     * @param Shipment $envio
262
     * @return Despatch
263
     */
264 2
    public function setEnvio($envio)
265
    {
266 2
        $this->envio = $envio;
267 2
        return $this;
268
    }
269
270
    /**
271
     * @return Document
272
     */
273 2
    public function getDocBaja()
274
    {
275 2
        return $this->docBaja;
276
    }
277
278
    /**
279
     * @param Document $docBaja
280
     * @return Despatch
281
     */
282 2
    public function setDocBaja($docBaja)
283
    {
284 2
        $this->docBaja = $docBaja;
285 2
        return $this;
286
    }
287
288
    /**
289
     * @return Document
290
     */
291 2
    public function getRelDoc()
292
    {
293 2
        return $this->relDoc;
294
    }
295
296
    /**
297
     * @param Document $relDoc
298
     * @return Despatch
299
     */
300 2
    public function setRelDoc($relDoc)
301
    {
302 2
        $this->relDoc = $relDoc;
303 2
        return $this;
304
    }
305
306
    /**
307
     * @return DespatchDetail[]
308
     */
309 2
    public function getDetails()
310
    {
311 2
        return $this->details;
312
    }
313
314
    /**
315
     * @param DespatchDetail[] $details
316
     * @return Despatch
317
     */
318 2
    public function setDetails($details)
319
    {
320 2
        $this->details = $details;
321 2
        return $this;
322
    }
323
324
    /**
325
     * Get FileName without extension.
326
     *
327
     * @return string
328
     */
329 2 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...
330
    {
331
        $parts = [
332 2
            $this->company->getRuc(),
333 2
            $this->getTipoDoc(), // 09
334 2
            $this->getSerie(),
335 2
            $this->getCorrelativo(),
336 2
        ];
337
338 2
        return join('-', $parts);
339
    }
340
}