1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Integracao\ControlPay\Model; |
4
|
|
|
use Integracao\ControlPay\Helpers\SerializerHelper; |
5
|
|
|
|
6
|
|
|
/** |
7
|
|
|
* Class IntencaoVenda |
8
|
|
|
* @package Integracao\ControlPay\Model |
9
|
|
|
*/ |
10
|
|
|
class IntencaoVenda implements \JsonSerializable |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* @var integer |
14
|
|
|
*/ |
15
|
|
|
private $id; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @var Pessoa |
19
|
|
|
*/ |
20
|
|
|
private $pessoaVendedor; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var Pessoa |
24
|
|
|
*/ |
25
|
|
|
private $pessoaCliente; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var Pessoa |
29
|
|
|
*/ |
30
|
|
|
private $cliente; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var FormaPagamento |
34
|
|
|
*/ |
35
|
|
|
private $formaPagamento; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var Terminal |
39
|
|
|
*/ |
40
|
|
|
private $terminal; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var Pedido |
44
|
|
|
*/ |
45
|
|
|
private $pedido; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var Operador |
49
|
|
|
*/ |
50
|
|
|
private $operador; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @var ContaRecebimentoLancamento |
54
|
|
|
*/ |
55
|
|
|
private $contaRecebimentoLancamento; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var PagamentoRecorrenteLancamento |
59
|
|
|
*/ |
60
|
|
|
private $pagamentoRecorrenteLancamento; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @var IntencaoVendaStatus |
64
|
|
|
*/ |
65
|
|
|
private $intencaoVendaStatus; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @var string |
69
|
|
|
*/ |
70
|
|
|
private $referencia; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @var string |
74
|
|
|
*/ |
75
|
|
|
private $token; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @var \DateTime |
79
|
|
|
*/ |
80
|
|
|
private $data; |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @var string |
84
|
|
|
*/ |
85
|
|
|
private $hora; |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @var double |
89
|
|
|
*/ |
90
|
|
|
private $valorOriginal; |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @var double |
94
|
|
|
*/ |
95
|
|
|
private $valorAcrescimo; |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @var double |
99
|
|
|
*/ |
100
|
|
|
private $valorDesconto; |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @var double |
104
|
|
|
*/ |
105
|
|
|
private $valorFinal; |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @var string |
109
|
|
|
*/ |
110
|
|
|
private $valorOriginalFormat; |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @var string |
114
|
|
|
*/ |
115
|
|
|
private $valorDescontoFormat; |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @var string |
119
|
|
|
*/ |
120
|
|
|
private $valorAcrescimoFormat; |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @var string |
124
|
|
|
*/ |
125
|
|
|
private $valorFinalFormat; |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @var float |
129
|
|
|
*/ |
130
|
|
|
private $latitude; |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* @var float |
134
|
|
|
*/ |
135
|
|
|
private $longitude; |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* @var string |
139
|
|
|
*/ |
140
|
|
|
private $gate2allToken; |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* @var string |
144
|
|
|
*/ |
145
|
|
|
private $cpfCnpj; |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* @var string |
149
|
|
|
*/ |
150
|
|
|
private $obs; |
151
|
|
|
|
152
|
|
|
/** |
153
|
|
|
* @var integer |
154
|
|
|
*/ |
155
|
|
|
private $quantidade; |
156
|
|
|
|
157
|
|
|
/** |
158
|
|
|
* @var array |
159
|
|
|
*/ |
160
|
|
|
private $itemProdutos; |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* @var array |
164
|
|
|
*/ |
165
|
|
|
private $produtos; |
166
|
|
|
|
167
|
|
|
/** |
168
|
|
|
* @var array |
169
|
|
|
*/ |
170
|
|
|
private $pagamentosExterno; |
171
|
|
|
|
172
|
|
|
/** |
173
|
|
|
* @var Pessoa |
174
|
|
|
*/ |
175
|
|
|
private $vendedor; |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* IntencaoVenda constructor. |
179
|
|
|
*/ |
180
|
|
|
public function __construct() |
181
|
|
|
{ |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* @return mixed |
186
|
|
|
*/ |
187
|
|
|
public function getId() |
188
|
|
|
{ |
189
|
|
|
return $this->id; |
190
|
|
|
} |
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* @param mixed $id |
194
|
|
|
* @return IntencaoVenda |
195
|
|
|
*/ |
196
|
|
|
public function setId($id) |
197
|
|
|
{ |
198
|
|
|
$this->id = $id; |
199
|
|
|
return $this; |
200
|
|
|
} |
201
|
|
|
|
202
|
|
|
/** |
203
|
|
|
* @return Pessoa |
204
|
|
|
*/ |
205
|
|
|
public function getPessoaVendedor() |
206
|
|
|
{ |
207
|
|
|
return $this->pessoaVendedor; |
208
|
|
|
} |
209
|
|
|
|
210
|
|
|
/** |
211
|
|
|
* @param Pessoa $pessoaVendedor |
212
|
|
|
* @return IntencaoVenda |
213
|
|
|
*/ |
214
|
|
View Code Duplication |
public function setPessoaVendedor($pessoaVendedor) |
|
|
|
|
215
|
|
|
{ |
216
|
|
|
$this->pessoaVendedor = $pessoaVendedor; |
217
|
|
|
|
218
|
|
|
if(is_array($this->pessoaVendedor)) |
219
|
|
|
$this->pessoaVendedor = SerializerHelper::denormalize($this->pessoaVendedor, Pessoa::class); |
220
|
|
|
|
221
|
|
|
return $this; |
222
|
|
|
} |
223
|
|
|
|
224
|
|
|
/** |
225
|
|
|
* @return Pessoa |
226
|
|
|
*/ |
227
|
|
|
public function getPessoaCliente() |
228
|
|
|
{ |
229
|
|
|
return $this->pessoaCliente; |
230
|
|
|
} |
231
|
|
|
|
232
|
|
|
/** |
233
|
|
|
* @param Pessoa $pessoaCliente |
234
|
|
|
* @return IntencaoVenda |
235
|
|
|
*/ |
236
|
|
|
public function setPessoaCliente($pessoaCliente) |
237
|
|
|
{ |
238
|
|
|
$this->pessoaCliente = $pessoaCliente; |
239
|
|
|
|
240
|
|
|
if(is_array($this->pessoaCliente)) |
241
|
|
|
$this->pessoaCliente = SerializerHelper::denormalize($this->pessoaCliente, Pessoa::class); |
242
|
|
|
|
243
|
|
|
return $this; |
244
|
|
|
} |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* @return FormaPagamento |
248
|
|
|
*/ |
249
|
|
|
public function getFormaPagamento() |
250
|
|
|
{ |
251
|
|
|
return $this->formaPagamento; |
252
|
|
|
} |
253
|
|
|
|
254
|
|
|
/** |
255
|
|
|
* @param FormaPagamento $formaPagamento |
256
|
|
|
* @return IntencaoVenda |
257
|
|
|
*/ |
258
|
|
|
public function setFormaPagamento($formaPagamento) |
259
|
|
|
{ |
260
|
|
|
$this->formaPagamento = $formaPagamento; |
261
|
|
|
|
262
|
|
|
if(is_array($this->formaPagamento)) |
263
|
|
|
$this->formaPagamento = SerializerHelper::denormalize($this->formaPagamento, FormaPagamento::class); |
264
|
|
|
|
265
|
|
|
return $this; |
266
|
|
|
} |
267
|
|
|
|
268
|
|
|
/** |
269
|
|
|
* @return Terminal |
270
|
|
|
*/ |
271
|
|
|
public function getTerminal() |
272
|
|
|
{ |
273
|
|
|
return $this->terminal; |
274
|
|
|
} |
275
|
|
|
|
276
|
|
|
/** |
277
|
|
|
* @param Terminal $terminal |
278
|
|
|
* @return IntencaoVenda |
279
|
|
|
*/ |
280
|
|
|
public function setTerminal($terminal) |
281
|
|
|
{ |
282
|
|
|
$this->terminal = $terminal; |
283
|
|
|
|
284
|
|
|
if(is_array($this->terminal)) |
285
|
|
|
$this->terminal = SerializerHelper::denormalize($this->terminal, Terminal::class); |
286
|
|
|
|
287
|
|
|
return $this; |
288
|
|
|
} |
289
|
|
|
|
290
|
|
|
/** |
291
|
|
|
* @return Pedido |
292
|
|
|
*/ |
293
|
|
|
public function getPedido() |
294
|
|
|
{ |
295
|
|
|
return $this->pedido; |
296
|
|
|
} |
297
|
|
|
|
298
|
|
|
/** |
299
|
|
|
* @param Pedido $pedido |
300
|
|
|
* @return IntencaoVenda |
301
|
|
|
*/ |
302
|
|
|
public function setPedido($pedido) |
303
|
|
|
{ |
304
|
|
|
$this->pedido = $pedido; |
305
|
|
|
|
306
|
|
|
if(is_array($this->pedido)) |
307
|
|
|
$this->pedido = SerializerHelper::denormalize($this->pedido, Pedido::class); |
308
|
|
|
|
309
|
|
|
return $this; |
310
|
|
|
} |
311
|
|
|
|
312
|
|
|
/** |
313
|
|
|
* @return Operador |
314
|
|
|
*/ |
315
|
|
|
public function getOperador() |
316
|
|
|
{ |
317
|
|
|
return $this->operador; |
318
|
|
|
} |
319
|
|
|
|
320
|
|
|
/** |
321
|
|
|
* @param Operador $operador |
322
|
|
|
* @return IntencaoVenda |
323
|
|
|
*/ |
324
|
|
View Code Duplication |
public function setOperador($operador) |
|
|
|
|
325
|
|
|
{ |
326
|
|
|
$this->operador = $operador; |
327
|
|
|
|
328
|
|
|
if(is_array($this->operador)) |
329
|
|
|
$this->operador = SerializerHelper::denormalize($this->operador, Operador::class); |
330
|
|
|
|
331
|
|
|
return $this; |
332
|
|
|
} |
333
|
|
|
|
334
|
|
|
/** |
335
|
|
|
* @return ContaRecebimentoLancamento |
336
|
|
|
*/ |
337
|
|
|
public function getContaRecebimentoLancamento() |
338
|
|
|
{ |
339
|
|
|
return $this->contaRecebimentoLancamento; |
340
|
|
|
} |
341
|
|
|
|
342
|
|
|
/** |
343
|
|
|
* @param ContaRecebimentoLancamento $contaRecebimentoLancamento |
344
|
|
|
* @return IntencaoVenda |
345
|
|
|
*/ |
346
|
|
|
public function setContaRecebimentoLancamento($contaRecebimentoLancamento) |
347
|
|
|
{ |
348
|
|
|
$this->contaRecebimentoLancamento = $contaRecebimentoLancamento; |
349
|
|
|
|
350
|
|
|
if(is_array($this->contaRecebimentoLancamento)) |
351
|
|
|
$this->contaRecebimentoLancamento = SerializerHelper::denormalize($this->contaRecebimentoLancamento, ContaRecebimentoLancamento::class); |
352
|
|
|
|
353
|
|
|
return $this; |
354
|
|
|
} |
355
|
|
|
|
356
|
|
|
/** |
357
|
|
|
* @return PagamentoRecorrenteLancamento |
358
|
|
|
*/ |
359
|
|
|
public function getPagamentoRecorrenteLancamento() |
360
|
|
|
{ |
361
|
|
|
return $this->pagamentoRecorrenteLancamento; |
362
|
|
|
} |
363
|
|
|
|
364
|
|
|
/** |
365
|
|
|
* @param PagamentoRecorrenteLancamento $pagamentoRecorrenteLancamento |
366
|
|
|
* @return IntencaoVenda |
367
|
|
|
*/ |
368
|
|
|
public function setPagamentoRecorrenteLancamento($pagamentoRecorrenteLancamento) |
369
|
|
|
{ |
370
|
|
|
$this->pagamentoRecorrenteLancamento = $pagamentoRecorrenteLancamento; |
371
|
|
|
|
372
|
|
|
if(is_array($this->pagamentoRecorrenteLancamento)) |
373
|
|
|
$this->pagamentoRecorrenteLancamento = SerializerHelper::denormalize($this->pagamentoRecorrenteLancamento, PagamentoRecorrenteLancamento::class); |
374
|
|
|
|
375
|
|
|
return $this; |
376
|
|
|
} |
377
|
|
|
|
378
|
|
|
/** |
379
|
|
|
* @return IntencaoVendaStatus |
380
|
|
|
*/ |
381
|
|
|
public function getIntencaoVendaStatus() |
382
|
|
|
{ |
383
|
|
|
return $this->intencaoVendaStatus; |
384
|
|
|
} |
385
|
|
|
|
386
|
|
|
/** |
387
|
|
|
* @param IntencaoVendaStatus $intencaoVendaStatus |
388
|
|
|
* @return IntencaoVenda |
389
|
|
|
*/ |
390
|
|
|
public function setIntencaoVendaStatus($intencaoVendaStatus) |
391
|
|
|
{ |
392
|
|
|
$this->intencaoVendaStatus = $intencaoVendaStatus; |
393
|
|
|
|
394
|
|
|
if(is_array($this->intencaoVendaStatus)) |
395
|
|
|
$this->intencaoVendaStatus = SerializerHelper::denormalize($this->intencaoVendaStatus, IntencaoVendaStatus::class); |
396
|
|
|
|
397
|
|
|
return $this; |
398
|
|
|
} |
399
|
|
|
|
400
|
|
|
/** |
401
|
|
|
* @return string |
402
|
|
|
*/ |
403
|
|
|
public function getReferencia() |
404
|
|
|
{ |
405
|
|
|
return $this->referencia; |
406
|
|
|
} |
407
|
|
|
|
408
|
|
|
/** |
409
|
|
|
* @param string $referencia |
410
|
|
|
* @return IntencaoVenda |
411
|
|
|
*/ |
412
|
|
|
public function setReferencia($referencia) |
413
|
|
|
{ |
414
|
|
|
$this->referencia = $referencia; |
415
|
|
|
return $this; |
416
|
|
|
} |
417
|
|
|
|
418
|
|
|
/** |
419
|
|
|
* @return string |
420
|
|
|
*/ |
421
|
|
|
public function getToken() |
422
|
|
|
{ |
423
|
|
|
return $this->token; |
424
|
|
|
} |
425
|
|
|
|
426
|
|
|
/** |
427
|
|
|
* @param string $token |
428
|
|
|
* @return IntencaoVenda |
429
|
|
|
*/ |
430
|
|
|
public function setToken($token) |
431
|
|
|
{ |
432
|
|
|
$this->token = $token; |
433
|
|
|
return $this; |
434
|
|
|
} |
435
|
|
|
|
436
|
|
|
/** |
437
|
|
|
* @return \DateTime |
438
|
|
|
*/ |
439
|
|
|
public function getData() |
440
|
|
|
{ |
441
|
|
|
return $this->data; |
442
|
|
|
} |
443
|
|
|
|
444
|
|
|
/** |
445
|
|
|
* @param \DateTime $data |
446
|
|
|
* @return IntencaoVenda |
447
|
|
|
*/ |
448
|
|
|
public function setData($data) |
449
|
|
|
{ |
450
|
|
|
$this->data = \DateTime::createFromFormat('d/m/Y H:i:s.u', $data); |
|
|
|
|
451
|
|
|
|
452
|
|
|
if(!$this->data) |
453
|
|
|
$this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
|
|
|
454
|
|
|
|
455
|
|
|
return $this; |
456
|
|
|
} |
457
|
|
|
|
458
|
|
|
/** |
459
|
|
|
* @return float |
460
|
|
|
*/ |
461
|
|
|
public function getValorOriginal() |
462
|
|
|
{ |
463
|
|
|
return $this->valorOriginal; |
464
|
|
|
} |
465
|
|
|
|
466
|
|
|
/** |
467
|
|
|
* @param float $valorOriginal |
468
|
|
|
* @return IntencaoVenda |
469
|
|
|
*/ |
470
|
|
|
public function setValorOriginal($valorOriginal) |
471
|
|
|
{ |
472
|
|
|
$this->valorOriginal = $valorOriginal; |
473
|
|
|
return $this; |
474
|
|
|
} |
475
|
|
|
|
476
|
|
|
/** |
477
|
|
|
* @return float |
478
|
|
|
*/ |
479
|
|
|
public function getValorAcrescimo() |
480
|
|
|
{ |
481
|
|
|
return $this->valorAcrescimo; |
482
|
|
|
} |
483
|
|
|
|
484
|
|
|
/** |
485
|
|
|
* @param float $valorAcrescimo |
486
|
|
|
* @return IntencaoVenda |
487
|
|
|
*/ |
488
|
|
|
public function setValorAcrescimo($valorAcrescimo) |
489
|
|
|
{ |
490
|
|
|
$this->valorAcrescimo = $valorAcrescimo; |
491
|
|
|
return $this; |
492
|
|
|
} |
493
|
|
|
|
494
|
|
|
/** |
495
|
|
|
* @return float |
496
|
|
|
*/ |
497
|
|
|
public function getValorDesconto() |
498
|
|
|
{ |
499
|
|
|
return $this->valorDesconto; |
500
|
|
|
} |
501
|
|
|
|
502
|
|
|
/** |
503
|
|
|
* @param float $valorDesconto |
504
|
|
|
* @return IntencaoVenda |
505
|
|
|
*/ |
506
|
|
|
public function setValorDesconto($valorDesconto) |
507
|
|
|
{ |
508
|
|
|
$this->valorDesconto = $valorDesconto; |
509
|
|
|
return $this; |
510
|
|
|
} |
511
|
|
|
|
512
|
|
|
/** |
513
|
|
|
* @return float |
514
|
|
|
*/ |
515
|
|
|
public function getValorFinal() |
516
|
|
|
{ |
517
|
|
|
return $this->valorFinal; |
518
|
|
|
} |
519
|
|
|
|
520
|
|
|
/** |
521
|
|
|
* @param float $valorFinal |
522
|
|
|
* @return IntencaoVenda |
523
|
|
|
*/ |
524
|
|
|
public function setValorFinal($valorFinal) |
525
|
|
|
{ |
526
|
|
|
$this->valorFinal = $valorFinal; |
527
|
|
|
return $this; |
528
|
|
|
} |
529
|
|
|
|
530
|
|
|
/** |
531
|
|
|
* @return float |
532
|
|
|
*/ |
533
|
|
|
public function getLatitude() |
534
|
|
|
{ |
535
|
|
|
return $this->latitude; |
536
|
|
|
} |
537
|
|
|
|
538
|
|
|
/** |
539
|
|
|
* @param float $latitude |
540
|
|
|
* @return IntencaoVenda |
541
|
|
|
*/ |
542
|
|
|
public function setLatitude($latitude) |
543
|
|
|
{ |
544
|
|
|
$this->latitude = $latitude; |
545
|
|
|
return $this; |
546
|
|
|
} |
547
|
|
|
|
548
|
|
|
/** |
549
|
|
|
* @return float |
550
|
|
|
*/ |
551
|
|
|
public function getLongitude() |
552
|
|
|
{ |
553
|
|
|
return $this->longitude; |
554
|
|
|
} |
555
|
|
|
|
556
|
|
|
/** |
557
|
|
|
* @param float $longitude |
558
|
|
|
* @return IntencaoVenda |
559
|
|
|
*/ |
560
|
|
|
public function setLongitude($longitude) |
561
|
|
|
{ |
562
|
|
|
$this->longitude = $longitude; |
563
|
|
|
return $this; |
564
|
|
|
} |
565
|
|
|
|
566
|
|
|
/** |
567
|
|
|
* @return string |
568
|
|
|
*/ |
569
|
|
|
public function getGate2allToken() |
570
|
|
|
{ |
571
|
|
|
return $this->gate2allToken; |
572
|
|
|
} |
573
|
|
|
|
574
|
|
|
/** |
575
|
|
|
* @param string $gate2allToken |
576
|
|
|
* @return IntencaoVenda |
577
|
|
|
*/ |
578
|
|
|
public function setGate2allToken($gate2allToken) |
579
|
|
|
{ |
580
|
|
|
$this->gate2allToken = $gate2allToken; |
581
|
|
|
return $this; |
582
|
|
|
} |
583
|
|
|
|
584
|
|
|
/** |
585
|
|
|
* @return string |
586
|
|
|
*/ |
587
|
|
|
public function getCpfCnpj() |
588
|
|
|
{ |
589
|
|
|
return $this->cpfCnpj; |
590
|
|
|
} |
591
|
|
|
|
592
|
|
|
/** |
593
|
|
|
* @param string $cpfCnpj |
594
|
|
|
* @return IntencaoVenda |
595
|
|
|
*/ |
596
|
|
|
public function setCpfCnpj($cpfCnpj) |
597
|
|
|
{ |
598
|
|
|
$this->cpfCnpj = $cpfCnpj; |
599
|
|
|
return $this; |
600
|
|
|
} |
601
|
|
|
|
602
|
|
|
/** |
603
|
|
|
* @return string |
604
|
|
|
*/ |
605
|
|
|
public function getObs() |
606
|
|
|
{ |
607
|
|
|
return $this->obs; |
608
|
|
|
} |
609
|
|
|
|
610
|
|
|
/** |
611
|
|
|
* @param string $obs |
612
|
|
|
* @return IntencaoVenda |
613
|
|
|
*/ |
614
|
|
|
public function setObs($obs) |
615
|
|
|
{ |
616
|
|
|
$this->obs = $obs; |
617
|
|
|
return $this; |
618
|
|
|
} |
619
|
|
|
|
620
|
|
|
/** |
621
|
|
|
* @return array |
622
|
|
|
*/ |
623
|
|
|
public function getItemProdutos() |
624
|
|
|
{ |
625
|
|
|
return $this->itemProdutos; |
626
|
|
|
} |
627
|
|
|
|
628
|
|
|
/** |
629
|
|
|
* @param array $itemProdutos |
630
|
|
|
* @return IntencaoVenda |
631
|
|
|
*/ |
632
|
|
View Code Duplication |
public function setItemProdutos($itemProdutos) |
|
|
|
|
633
|
|
|
{ |
634
|
|
|
//$this->itemProdutos = $itemProdutos; |
|
|
|
|
635
|
|
|
|
636
|
|
|
if(is_array($itemProdutos)) |
637
|
|
|
foreach ($itemProdutos as $itemProduto) { |
638
|
|
|
$this->itemProdutos[] = SerializerHelper::denormalize( |
639
|
|
|
$itemProduto, ItemProduto::class); |
640
|
|
|
} |
641
|
|
|
|
642
|
|
|
return $this; |
643
|
|
|
} |
644
|
|
|
|
645
|
|
|
/** |
646
|
|
|
* @return array |
647
|
|
|
*/ |
648
|
|
|
public function getPagamentosExterno() |
649
|
|
|
{ |
650
|
|
|
return $this->pagamentosExterno; |
651
|
|
|
} |
652
|
|
|
|
653
|
|
|
/** |
654
|
|
|
* @param array $pagamentosExterno |
655
|
|
|
* @return IntencaoVenda |
656
|
|
|
*/ |
657
|
|
|
public function setPagamentosExterno($pagamentosExterno) |
658
|
|
|
{ |
659
|
|
|
if(is_array($pagamentosExterno)) |
660
|
|
|
foreach ($pagamentosExterno as $pagamentoExterno) { |
661
|
|
|
$this->pagamentosExterno[] = SerializerHelper::denormalize( |
662
|
|
|
$pagamentoExterno, PagamentoExterno::class); |
663
|
|
|
} |
664
|
|
|
|
665
|
|
|
return $this; |
666
|
|
|
} |
667
|
|
|
|
668
|
|
|
/** |
669
|
|
|
* @return array |
670
|
|
|
*/ |
671
|
|
|
public function getProdutos() |
672
|
|
|
{ |
673
|
|
|
return $this->produtos; |
674
|
|
|
} |
675
|
|
|
|
676
|
|
|
/** |
677
|
|
|
* @param array $produtos |
678
|
|
|
* @return IntencaoVenda |
679
|
|
|
*/ |
680
|
|
View Code Duplication |
public function setProdutos($produtos) |
|
|
|
|
681
|
|
|
{ |
682
|
|
|
|
683
|
|
|
if(is_array($produtos)) |
684
|
|
|
foreach ($produtos as $produto) { |
685
|
|
|
$this->produtos[] = SerializerHelper::denormalize( |
686
|
|
|
$produto, ItemProduto::class); |
687
|
|
|
} |
688
|
|
|
|
689
|
|
|
return $this; |
690
|
|
|
} |
691
|
|
|
|
692
|
|
|
/** |
693
|
|
|
* @return string |
694
|
|
|
*/ |
695
|
|
|
public function getHora() |
696
|
|
|
{ |
697
|
|
|
return $this->hora; |
698
|
|
|
} |
699
|
|
|
|
700
|
|
|
/** |
701
|
|
|
* @param string $hora |
702
|
|
|
* @return IntencaoVenda |
703
|
|
|
*/ |
704
|
|
|
public function setHora($hora) |
705
|
|
|
{ |
706
|
|
|
$this->hora = $hora; |
707
|
|
|
return $this; |
708
|
|
|
} |
709
|
|
|
|
710
|
|
|
/** |
711
|
|
|
* @return int |
712
|
|
|
*/ |
713
|
|
|
public function getQuantidade() |
714
|
|
|
{ |
715
|
|
|
return $this->quantidade; |
716
|
|
|
} |
717
|
|
|
|
718
|
|
|
/** |
719
|
|
|
* @param int $quantidade |
720
|
|
|
* @return IntencaoVenda |
721
|
|
|
*/ |
722
|
|
|
public function setQuantidade($quantidade) |
723
|
|
|
{ |
724
|
|
|
$this->quantidade = $quantidade; |
725
|
|
|
return $this; |
726
|
|
|
} |
727
|
|
|
|
728
|
|
|
/** |
729
|
|
|
* @return string |
730
|
|
|
*/ |
731
|
|
|
public function getValorOriginalFormat() |
732
|
|
|
{ |
733
|
|
|
return $this->valorOriginalFormat; |
734
|
|
|
} |
735
|
|
|
|
736
|
|
|
/** |
737
|
|
|
* @param string $valorOriginalFormat |
738
|
|
|
* @return IntencaoVenda |
739
|
|
|
*/ |
740
|
|
|
public function setValorOriginalFormat($valorOriginalFormat) |
741
|
|
|
{ |
742
|
|
|
$this->valorOriginalFormat = $valorOriginalFormat; |
743
|
|
|
return $this; |
744
|
|
|
} |
745
|
|
|
|
746
|
|
|
/** |
747
|
|
|
* @return string |
748
|
|
|
*/ |
749
|
|
|
public function getValorDescontoFormat() |
750
|
|
|
{ |
751
|
|
|
return $this->valorDescontoFormat; |
752
|
|
|
} |
753
|
|
|
|
754
|
|
|
/** |
755
|
|
|
* @param string $valorDescontoFormat |
756
|
|
|
* @return IntencaoVenda |
757
|
|
|
*/ |
758
|
|
|
public function setValorDescontoFormat($valorDescontoFormat) |
759
|
|
|
{ |
760
|
|
|
$this->valorDescontoFormat = $valorDescontoFormat; |
761
|
|
|
return $this; |
762
|
|
|
} |
763
|
|
|
|
764
|
|
|
/** |
765
|
|
|
* @return string |
766
|
|
|
*/ |
767
|
|
|
public function getValorAcrescimoFormat() |
768
|
|
|
{ |
769
|
|
|
return $this->valorAcrescimoFormat; |
770
|
|
|
} |
771
|
|
|
|
772
|
|
|
/** |
773
|
|
|
* @param string $valorAcrescimoFormat |
774
|
|
|
* @return IntencaoVenda |
775
|
|
|
*/ |
776
|
|
|
public function setValorAcrescimoFormat($valorAcrescimoFormat) |
777
|
|
|
{ |
778
|
|
|
$this->valorAcrescimoFormat = $valorAcrescimoFormat; |
779
|
|
|
return $this; |
780
|
|
|
} |
781
|
|
|
|
782
|
|
|
/** |
783
|
|
|
* @return string |
784
|
|
|
*/ |
785
|
|
|
public function getValorFinalFormat() |
786
|
|
|
{ |
787
|
|
|
return $this->valorFinalFormat; |
788
|
|
|
} |
789
|
|
|
|
790
|
|
|
/** |
791
|
|
|
* @param string $valorFinalFormat |
792
|
|
|
* @return IntencaoVenda |
793
|
|
|
*/ |
794
|
|
|
public function setValorFinalFormat($valorFinalFormat) |
795
|
|
|
{ |
796
|
|
|
$this->valorFinalFormat = $valorFinalFormat; |
797
|
|
|
return $this; |
798
|
|
|
} |
799
|
|
|
|
800
|
|
|
/** |
801
|
|
|
* @return Pessoa |
802
|
|
|
*/ |
803
|
|
|
public function getVendedor() |
804
|
|
|
{ |
805
|
|
|
return $this->vendedor; |
806
|
|
|
} |
807
|
|
|
|
808
|
|
|
/** |
809
|
|
|
* @param Pessoa $vendedor |
810
|
|
|
* @return IntencaoVenda |
811
|
|
|
*/ |
812
|
|
View Code Duplication |
public function setVendedor($vendedor) |
|
|
|
|
813
|
|
|
{ |
814
|
|
|
$this->vendedor = $vendedor; |
815
|
|
|
|
816
|
|
|
if(is_array($this->vendedor)) |
817
|
|
|
$this->vendedor = SerializerHelper::denormalize($this->pessoaVendedor, Pessoa::class); |
818
|
|
|
|
819
|
|
|
return $this; |
820
|
|
|
} |
821
|
|
|
|
822
|
|
|
/** |
823
|
|
|
* @return Pessoa |
824
|
|
|
*/ |
825
|
|
|
public function getCliente() |
826
|
|
|
{ |
827
|
|
|
return $this->cliente; |
828
|
|
|
} |
829
|
|
|
|
830
|
|
|
/** |
831
|
|
|
* @param Pessoa $cliente |
832
|
|
|
* @return IntencaoVenda |
833
|
|
|
*/ |
834
|
|
|
public function setCliente($cliente) |
835
|
|
|
{ |
836
|
|
|
$this->cliente = $cliente; |
837
|
|
|
return $this; |
838
|
|
|
} |
839
|
|
|
|
840
|
|
|
/** |
841
|
|
|
* @return array |
842
|
|
|
*/ |
843
|
|
|
function jsonSerialize() |
844
|
|
|
{ |
845
|
|
|
return [ |
846
|
|
|
'id' => $this->id, |
847
|
|
|
'pessoaVendedor' => $this->pessoaVendedor, |
848
|
|
|
'pessoaCliente' => $this->pessoaCliente, |
849
|
|
|
'itemProdutos' => $this->itemProdutos, |
850
|
|
|
'pagamentosExterno' => $this->pagamentosExterno, |
851
|
|
|
'produtos' => $this->produtos, |
852
|
|
|
'contaRecebimentoLancamento' => $this->contaRecebimentoLancamento, |
853
|
|
|
'cpfCnpj' => $this->cpfCnpj, |
854
|
|
|
'data' => $this->data, |
855
|
|
|
'formaPagamento' => $this->formaPagamento, |
856
|
|
|
'gate2allToken' => $this->gate2allToken, |
857
|
|
|
'referencia' => $this->referencia, |
858
|
|
|
'intencaoVendaStatus' => $this->intencaoVendaStatus, |
859
|
|
|
'longitude' => $this->longitude, |
860
|
|
|
'latitude' => $this->latitude, |
861
|
|
|
'obs' => $this->obs, |
862
|
|
|
'pedido' => $this->pedido, |
863
|
|
|
'quantidade' => $this->quantidade, |
864
|
|
|
'vendedor' => $this->vendedor, |
865
|
|
|
'terminal' => $this->terminal, |
866
|
|
|
'hora' => $this->hora, |
867
|
|
|
'cliente' => $this->cliente, |
868
|
|
|
'valorOriginal' => $this->valorOriginal, |
869
|
|
|
'valorOriginalFormat' => $this->valorOriginalFormat, |
870
|
|
|
'valorAcrescimo' => $this->valorAcrescimo, |
871
|
|
|
'valorAcrescimoFormat' => $this->valorAcrescimoFormat, |
872
|
|
|
'valorDesconto' => $this->valorDesconto, |
873
|
|
|
'valorDescontoFormat' => $this->valorDescontoFormat, |
874
|
|
|
'valorFinal' => $this->valorFinal, |
875
|
|
|
'valorFinalFormat' => $this->valorFinalFormat, |
876
|
|
|
]; |
877
|
|
|
} |
878
|
|
|
|
879
|
|
|
|
880
|
|
|
} |
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.