Completed
Push — master ( 1ed55c...1adee7 )
by Giancarlos
03:47
created

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