Completed
Push — master ( 0a5559...4dd4d6 )
by Giancarlos
04:06
created

Retention::setProveedor()   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 1
Bugs 0 Features 0
Metric Value
c 1
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: Administrador
5
 * Date: 08/08/2017
6
 * Time: 10:37 AM
7
 */
8
9
namespace Greenter\Model\Retention;
10
11
use Greenter\Model\Client\Client;
12
use Greenter\Xml\Validator\RetentionValidator;
13
use Symfony\Component\Validator\Constraints as Assert;
14
15
/**
16
 * Class Retention
17
 * @package Greenter\Model\Retention
18
 */
19
class Retention
20
{
21
    use RetentionValidator;
22
23
    /**
24
     * Serie del Documento (ejem: R001)
25
     *
26
     * @Assert\NotBlank()
27
     * @Assert\Length(max="4")
28
     * @var string
29
     */
30
    private $serie;
31
32
    /**
33
     * @Assert\NotBlank()
34
     * @Assert\Length(max="8")
35
     * @var string
36
     */
37
    private $correlativo;
38
39
    /**
40
     * @Assert\Date()
41
     * @var \DateTime
42
     */
43
    private $fechaEmision;
44
45
    /**
46
     * @Assert\NotBlank()
47
     * @Assert\Valid()
48
     * @var Client
49
     */
50
    private $proveedor;
51
52
    /**
53
     * @Assert\NotBlank()
54
     * @Assert\Length(min="2", max="2")
55
     * @var string
56
     */
57
    private $regimen;
58
59
    /**
60
     * @Assert\NotBlank()
61
     * @var float
62
     */
63
    private $tasa;
64
65
    /**
66
     * Importe total Retenido
67
     *
68
     * @Assert\NotBlank()
69
     * @var float
70
     */
71
    private $impRetenido;
72
73
    /**
74
     * Importe total Pagado
75
     *
76
     * @Assert\NotBlank()
77
     * @var float
78
     */
79
    private $impPagado;
80
81
    /**
82
     * @Assert\Length(max="250")
83
     * @var string
84
     */
85
    private $observacion;
86
87
    /**
88
     * Dato del Comprobante relacionado.
89
     *
90
     * @Assert\NotBlank()
91
     * @Assert\Valid()
92
     * @var RetentionDetail[]
93
     */
94
    private $details;
95
96
    /**
97
     * @return string
98
     */
99 6
    public function getSerie()
100
    {
101 6
        return $this->serie;
102
    }
103
104
    /**
105
     * @param string $serie
106
     * @return Retention
107
     */
108 12
    public function setSerie($serie)
109
    {
110 12
        $this->serie = $serie;
111 12
        return $this;
112
    }
113
114
    /**
115
     * @return string
116
     */
117 6
    public function getCorrelativo()
118
    {
119 6
        return $this->correlativo;
120
    }
121
122
    /**
123
     * @param string $correlativo
124
     * @return Retention
125
     */
126 12
    public function setCorrelativo($correlativo)
127
    {
128 12
        $this->correlativo = $correlativo;
129 12
        return $this;
130
    }
131
132
    /**
133
     * @return \DateTime
134
     */
135 4
    public function getFechaEmision()
136
    {
137 4
        return $this->fechaEmision;
138
    }
139
140
    /**
141
     * @param \DateTime $fechaEmision
142
     * @return Retention
143
     */
144 12
    public function setFechaEmision($fechaEmision)
145
    {
146 12
        $this->fechaEmision = $fechaEmision;
147 12
        return $this;
148
    }
149
150
    /**
151
     * @return Client
152
     */
153 4
    public function getProveedor()
154
    {
155 4
        return $this->proveedor;
156
    }
157
158
    /**
159
     * @param Client $proveedor
160
     * @return Retention
161
     */
162 12
    public function setProveedor($proveedor)
163
    {
164 12
        $this->proveedor = $proveedor;
165 12
        return $this;
166
    }
167
168
    /**
169
     * @return string
170
     */
171 4
    public function getRegimen()
172
    {
173 4
        return $this->regimen;
174
    }
175
176
    /**
177
     * @param string $regimen
178
     * @return Retention
179
     */
180 12
    public function setRegimen($regimen)
181
    {
182 12
        $this->regimen = $regimen;
183 12
        return $this;
184
    }
185
186
    /**
187
     * @return float
188
     */
189 4
    public function getTasa()
190
    {
191 4
        return $this->tasa;
192
    }
193
194
    /**
195
     * @param float $tasa
196
     * @return Retention
197
     */
198 12
    public function setTasa($tasa)
199
    {
200 12
        $this->tasa = $tasa;
201 12
        return $this;
202
    }
203
204
    /**
205
     * @return float
206
     */
207 4
    public function getImpRetenido()
208
    {
209 4
        return $this->impRetenido;
210
    }
211
212
    /**
213
     * @param float $impRetenido
214
     * @return Retention
215
     */
216 12
    public function setImpRetenido($impRetenido)
217
    {
218 12
        $this->impRetenido = $impRetenido;
219 12
        return $this;
220
    }
221
222
    /**
223
     * @return float
224
     */
225 4
    public function getImpPagado()
226
    {
227 4
        return $this->impPagado;
228
    }
229
230
    /**
231
     * @param float $impPagado
232
     * @return Retention
233
     */
234 12
    public function setImpPagado($impPagado)
235
    {
236 12
        $this->impPagado = $impPagado;
237 12
        return $this;
238
    }
239
240
    /**
241
     * @return string
242
     */
243 4
    public function getObservacion()
244
    {
245 4
        return $this->observacion;
246
    }
247
248
    /**
249
     * @param string $observacion
250
     * @return Retention
251
     */
252 12
    public function setObservacion($observacion)
253
    {
254 12
        $this->observacion = $observacion;
255 12
        return $this;
256
    }
257
258
    /**
259
     * @return RetentionDetail[]
260
     */
261 4
    public function getDetails()
262
    {
263 4
        return $this->details;
264
    }
265
266
    /**
267
     * @param RetentionDetail[] $details
268
     * @return Retention
269
     */
270 12
    public function setDetails($details)
271
    {
272 12
        $this->details = $details;
273 12
        return $this;
274
    }
275
276
    /**
277
     * Get FileName without extension.
278
     *
279
     * @param string $ruc Ruc de la Empresa.
280
     * @return string
281
     */
282 4
    public function getFileName($ruc)
283
    {
284
        $parts = [
285 4
            $ruc,
286 4
            '20',
287 4
            $this->getSerie(),
288 4
            $this->getCorrelativo(),
289 4
        ];
290
291 4
        return join('-', $parts);
292
    }
293
}