Passed
Pull Request — master (#196)
by Eduardo
02:23
created

Parser::naEntity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace NFePHP\NFe\Factories;
4
5
/**
6
 * Classe de conversão do TXT para XML
7
 *
8
 * @category  API
9
 * @package   NFePHP\NFe
10
 * @copyright NFePHP Copyright (c) 2008-2017
11
 * @license   http://www.gnu.org/licenses/lgpl.txt LGPLv3+
12
 * @license   https://opensource.org/licenses/MIT MIT
13
 * @license   http://www.gnu.org/licenses/gpl.txt GPLv3+
14
 * @author    Roberto L. Machado <linux.rlm at gmail dot com>
15
 * @link      http://github.com/nfephp-org/sped-nfe for the canonical source repository
16
 */
17
18
use NFePHP\Common\Strings;
19
use NFePHP\NFe\Make;
20
use stdClass;
21
22
class Parser
23
{
24
    /**
25
     * @var array
26
     */
27
    protected $structure;
28
    /**
29
     * @var Make
30
     */
31
    protected $make;
32
    /**
33
     * @var int
34
     */
35
    protected $item = 0;
36
    /**
37
     * @var int
38
     */
39
    protected $nDI = 0;
40
    /**
41
     * @var int
42
     */
43
    protected $volId = -1;
44
    /**
45
     * @var stdClass
46
     */
47
    protected $stdNFP;
48
    /**
49
     * @var stdClass
50
     */
51
    protected $stdEmit;
52
    /**
53
     * @var stdClass
54
     */
55
    protected $stdDest;
56
    /**
57
     * @var stdClass
58
     */
59
    protected $stdRetirada;
60
    /**
61
     * @var stdClass
62
     */
63
    protected $stdEntrega;
64
    /**
65
     * @var stdClass
66
     */
67
    protected $stdComb;
68
    /**
69
     * @var stdClass
70
     */
71
    protected $stdIPI;
72
    /**
73
     * @var stdClass
74
     */
75
    protected $stdPIS;
76
    /**
77
     * @var stdClass
78
     */
79
    protected $stdPISST;
80
    /**
81
     * @var stdClass
82
     */
83
    protected $stdII;
84
    /**
85
     * @var stdClass
86
     */
87
    protected $stdCOFINS;
88
    /**
89
     * @var stdClass
90
     */
91
    protected $stdCOFINSST;
92
    /**
93
     * @var stdClass
94
     */
95
    protected $stdTransporta;
96
    /**
97
     * @var
98
     */
99
    private $limparString = false;
100
101
    /**
102
     * Configure environment to correct NFe layout
103
     * @param string $version
104
     */
105
    public function __construct($version = '3.10')
106
    {
107
        $ver = str_replace('.', '', $version);
108
        $path = realpath(__DIR__."/../../storage/txtstructure$ver.json");
109
        $this->structure = json_decode(file_get_contents($path), true);
0 ignored issues
show
Documentation Bug introduced by
It seems like json_decode(file_get_contents($path), true) of type * is incompatible with the declared type array of property $structure.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
110
        $this->make = new Make();
111
    }
112
113
    /**
114
     *
115
     * @param array $nota
116
     * @return string
117
     */
118
    public function toXml($nota)
119
    {
120
        $this->array2xml($nota);
121
        //monta a tag combustíveis se existir
122
        if (!empty($this->stdComb)) {
123
            $this->make->tagcomb($this->stdComb);
124
        }
125
        if ($this->make->monta()) {
126
            return $this->make->getXML();
127
        }
128
        return null;
129
    }
130
131
    /**
132
     * Converte uma Nota Fiscal em um array de txt em um xml
133
     *
134
     * @param $nota
135
     *
136
     * @return void
137
     */
138
    protected function array2xml($nota)
139
    {
140
        foreach ($nota as $lin) {
141
            $fields = explode('|', $lin);
142
            if (empty($fields)) {
143
                continue;
144
            }
145
            $metodo = strtolower(str_replace(' ', '', $fields[0])).'Entity';
146
            if (!method_exists(__CLASS__, $metodo)) {
147
                $msg = "O txt tem um metodo não definido!! $lin";
148
                throw new \RuntimeException($msg);
149
            }
150
            $struct = $this->structure[strtoupper($fields[0])];
151
            $std = $this->fieldsToStd($fields, $struct);
152
            $this->$metodo($std);
153
        }
154
    }
155
156
    /**
157
     * Creates stdClass for tag fields
158
     * @param array $dfls
159
     * @param string $struct
160
     * @return stdClass
161
     */
162
    protected static function fieldsToStd($dfls, $struct)
163
    {
164
        $sfls = explode('|', $struct);
165
        $len = count($sfls)-1;
166
        $std = new \stdClass();
167
        for ($i = 1; $i < $len; $i++) {
168
            $name = $sfls[$i];
169
            $data = $dfls[$i];
170
            if (!empty($name)) {
171
                $std->$name = $data;
172
            }
173
        }
174
        return $std;
175
    }
176
177
    /**
178
     * Clear the string of unwanted characters
179
     * Will remove all duplicated spaces and if wanted
180
     * replace all accented characters by their originals
181
     * and all the special ones
182
     *
183
     * @param $std
184
     *
185
     * @return array
186
     */
187
    protected function clearFieldsString($std)
188
    {
189
        $n = [];
190
        foreach ($std as $field) {
191
            if ($this->limparString) {
192
                $field = Strings::replaceSpecialsChars($field);
193
            }
194
            $n[] = $field;
195
        }
196
        if (empty($n[count($n)-1])) {
197
            unset($n[count($n)-1]);
198
        }
199
        return $n;
200
    }
201
202
    /**
203
     * Cria a tag infNFe [A]
204
     * A|versao|Id|pk_nItem|
205
     * @param stdClass $std
206
     */
207
    protected function aEntity($std)
208
    {
209
        $this->make->taginfNFe($std);
210
    }
211
212
    /**
213
     * Cria a tag ide [B]
214
     * B|cUF|cNF|natOp|indPag|mod|serie|nNF|dhEmi|dhSaiEnt|tpNF|idDest|cMunFG
215
     *  |tpImp|tpEmis|cDV|tp Amb|finNFe|indFinal|indPres|procEmi|verProc|dhCont|xJust|
216
     * NOTA: Ajustado para NT2016_002_v1.30
217
     * B|cUF|cNF|natOp|mod|serie|nNF|dhEmi|dhSaiEnt|tpNF|idDest|cMunFG|tpImp
218
     *  |tpEmis|cDV|tpAmb|finNFe|indFinal|indPres|procEmi|verProc|dhCont|xJust|
219
     * @param stdClass $std
220
     */
221
    protected function bEntity($std)
222
    {
223
        $this->make->tagide($std);
224
    }
225
226
    /**
227
     * Cria a tag nfref [BA]
228
     * BA|
229
     * @param stdClass $std
230
     */
231
    protected function baEntity($std)
0 ignored issues
show
Unused Code introduced by
The parameter $std is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
232
    {
233
        //fake não faz nada
234
    }
235
236
    /**
237
     * Cria a tag refNFe [BA02]
238
     * BA02|refNFe|
239
     * @param stdClass $std
240
     */
241
    protected function ba02Entity($std)
242
    {
243
        $this->make->tagrefNFe($std);
244
    }
245
246
    /**
247
     * Cria a tag refNF [BA03]
248
     * BA03|cUF|AAMM|CNPJ|mod|serie|nNF|
249
     * @param stdClass $std
250
     */
251
    protected function ba03Entity($std)
252
    {
253
        $this->make->tagrefNF($std);
254
    }
255
256
    /**
257
     * Carrega a tag refNFP [BA10]
258
     * BA10|cUF|AAMM|IE|mod|serie|nNF|
259
     * @param stdClass $std
260
     */
261
    protected function ba10Entity($std)
262
    {
263
        $this->stdNFP = $std;
264
        $this->stdNFP->CNPJ = null;
265
        $this->stdNFP->CPF = null;
266
    }
267
268
    /**
269
     * CNPJ para a tag refNFP [BA13], pertence a BA10
270
     * BA13|CNPJ|
271
     * @param stdClass $std
272
     */
273
    protected function ba13Entity($std)
274
    {
275
        $this->stdNFP->CNPJ = $std->CNPJ;
276
        $this->buildBA10Entity();
277
        $this->stdNFP = null;
278
    }
279
280
    /**
281
     * CPF para a tag refNFP [BA14], pertence a BA10
282
     * BA14|CPF|
283
     * @param stdClass $std
284
     */
285
    protected function ba14Entity($std)
286
    {
287
        $this->stdNFP->CPF = $std->CPF;
288
        $this->buildBA10Entity();
289
        $this->stdNFP = null;
290
    }
291
292
    /**
293
     * Cria a tag refNFP [BA10]
294
     */
295
    protected function buildBA10Entity()
296
    {
297
        $this->make->tagrefNFP($this->stdNFP);
298
    }
299
300
    /**
301
     * Cria a tag refCTe [BA19]
302
     * B19|refCTe|
303
     * @param stdClass $std
304
     */
305
    protected function ba19Entity($std)
306
    {
307
        $this->make->tagrefCTe($std);
308
    }
309
310
    /**
311
     * Cria a tag refECF [BA20]
312
     * BA20|mod|nECF|nCOO|
313
     * @param stdClass $std
314
     */
315
    protected function ba20Entity($std)
316
    {
317
        $this->make->tagrefECF($std);
318
    }
319
320
    /**
321
     * Carrega a tag emit [C]
322
     * C|XNome|XFant|IE|IEST|IM|CNAE|CRT|
323
     * @param stdClass $std
324
     */
325
    protected function cEntity($std)
326
    {
327
        $this->stdEmit = $std;
328
        $this->stdEmit->CNPJ = null;
329
        $this->stdEmit->CPF = null;
330
    }
331
332
    /**
333
     * CNPJ da tag emit [C02], pertence a C
334
     * C02|CNPJ|
335
     * @param stdClass $std
336
     */
337
    protected function c02Entity($std)
338
    {
339
        $this->stdEmit->CNPJ = $std->CNPJ;
340
        $this->buildCEntity();
341
        $this->stdEmit = null;
342
    }
343
344
    /**
345
     * CPF da tag emit [C02a], pertence a C
346
     * C02a|CPF|
347
     * @param stdClass $std
348
     */
349
    protected function c02aEntity($std)
350
    {
351
        $this->stdEmit->CPF = $std->CPF;
352
        $this->buildCEntity();
353
        $this->stdEmit = null;
354
    }
355
356
    /**
357
     * Cria a tag emit [C]
358
     */
359
    protected function buildCEntity()
360
    {
361
        $this->make->tagemit($this->stdEmit);
362
    }
363
364
    /**
365
     * Cria a tag enderEmit [C05]
366
     * C05|xLgr|nro|xCpl|xBairro|cMun|xMun|UF|CEP|cPais|xPais|fone|
367
     * @param stdClass $std
368
     */
369
    protected function c05Entity($std)
370
    {
371
        $this->make->tagenderEmit($std);
372
    }
373
374
    /**
375
     * Carrega a tag dest [E]
376
     * E|xNome|indIEDest|IE|ISUF|IM|email|
377
     * @param stdClass $std
378
     */
379
    protected function eEntity($std)
380
    {
381
        $this->stdDest = $std;
382
        $this->stdDest->CNPJ = null;
383
        $this->stdDest->CPF = null;
384
        $this->stdDest->idEstrangeiro = null;
385
    }
386
387
    /**
388
     * CNPJ para a tag dest [E02], pertene a E
389
     * E02|CNPJ|
390
     * @param stdClass $std
391
     */
392
    protected function e02Entity($std)
393
    {
394
        $this->stdDest->CNPJ = $std->CNPJ;
395
        $this->buildEEntity();
396
        $this->stdDest = null;
397
    }
398
399
    /**
400
     * CPF para a tag dest [E03], pertene a E
401
     * E03|CPF|
402
     * @param stdClass $std
403
     */
404
    protected function e03Entity($std)
405
    {
406
        $this->stdDest->CPF = $std->CPF;
407
        $this->buildEEntity();
408
        $this->stdDest = null;
409
    }
410
411
    /**
412
     * idEstrangeiro para a tag dest [E03a], pertene a E
413
     * E03a|idEstrangeiro|
414
     * @param stdClass $std
415
     */
416
    protected function e03aEntity($std)
417
    {
418
        $this->stdDest->idEstrangeiro = $std->idEstrangeiro;
419
        $this->buildEEntity();
420
        $this->stdDest = null;
421
    }
422
423
    /**
424
     * Cria a tag dest [E]
425
     */
426
    protected function buildEEntity()
427
    {
428
        $this->make->tagdest($this->stdDest);
429
    }
430
431
    /**
432
     * Cria a tag enderDest [E05]
433
     * E05|xLgr|nro|xCpl|xBairro|cMun|xMun|UF|CEP|cPais|xPais|fone|
434
     * @param stdClass $std
435
     */
436
    protected function e05Entity($std)
437
    {
438
        $this->make->tagenderDest($std);
439
    }
440
441
    /**
442
     * Carrega a tag retirada [F]
443
     * F|xLgr|nro|xCpl|xBairro|cMun|xMun|UF|
444
     * @param stdClass $std
445
     */
446
    protected function fEntity($std)
447
    {
448
        $this->stdRetirada = $std;
449
        $this->stdRetirada->CNPJ = null;
450
        $this->stdRetirada->CPF = null;
451
    }
452
453
    /**
454
     * CNPJ para a tag retirada [F02], pertence a F
455
     * F02|CNPJ|
456
     * @param stdClass $std
457
     */
458
    protected function f02Entity($std)
459
    {
460
        $this->stdRetirada->CNPJ = $std->CNPJ;
461
        $this->buildFEntity();
462
        $this->stdRetirada = null;
463
    }
464
465
    /**
466
     * CPF para a tag retirada [F02a], pertence a F
467
     * F02a|CPF|
468
     * @param stdClass $std
469
     */
470
    protected function f02aEntity($std)
471
    {
472
        $this->stdRetirada->CPF = $std->CPF;
473
        $this->buildFEntity();
474
        $this->stdRetirada = null;
475
    }
476
477
    /**
478
     * Cria a tag retirada [F]
479
     */
480
    protected function buildFEntity()
481
    {
482
        $this->make->tagretirada($this->stdRetirada);
483
    }
484
485
    /**
486
     * Carrega e cria a tag entrega [G]
487
     * G|xLgr|nro|xCpl|xBairro|cMun|xMun|UF|
488
     * @param stdClass $std
489
     */
490
    protected function gEntity($std)
491
    {
492
        $this->stdEntrega = $std;
493
        $this->stdEntrega->CNPJ = null;
494
        $this->stdEntrega->CPF = null;
495
    }
496
497
    /**
498
     * CNPJ para a tag entrega [G02], pertence a G
499
     * G02|CNPJ|
500
     * @param stdClass $std
501
     */
502
    protected function g02Entity($std)
503
    {
504
        $this->stdEntrega->CNPJ = $std->CNPJ;
505
        $this->buildGEntity();
506
        $this->stdEntrega = null;
507
    }
508
509
    /**
510
     * CPF para a tag entrega [G02a], pertence a G
511
     * G02a|CPF|
512
     * @param stdClass $std
513
     */
514
    protected function g02aEntity($std)
515
    {
516
        $this->stdEntrega->CPF = $std->CPFJ;
517
        $this->buildGEntity();
518
        $this->stdEntrega = null;
519
    }
520
521
    /**
522
     * Cria a tag entrega [G]
523
     */
524
    protected function buildGEntity()
525
    {
526
        $this->make->tagentrega($this->stdEntrega);
527
    }
528
529
    /**
530
     * Cria a tag autXML [GA]
531
     * GA|
532
     * @param stdClass $std
533
     */
534
    protected function gaEntity($std)
0 ignored issues
show
Unused Code introduced by
The parameter $std is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
535
    {
536
        //fake não faz nada
537
    }
538
539
    /**
540
     * Cria a tag autXML com CNPJ [GA02], pertence a GA
541
     * GA02|CNPJ|
542
     * @param stdClass $std
543
     */
544
    protected function ga02Entity($std)
545
    {
546
        $this->make->tagautXML($std);
0 ignored issues
show
Documentation introduced by
$std is of type object<stdClass>, but the function expects a object<NFePHP\NFe\stdclass>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
547
    }
548
549
    /**
550
     * Cria a tag autXML com CPF [GA03], pertence a GA
551
     * GA03|CPF|
552
     * @param stdClass $std
553
     */
554
    protected function ga03Entity($std)
555
    {
556
        $this->make->tagautXML($std);
0 ignored issues
show
Documentation introduced by
$std is of type object<stdClass>, but the function expects a object<NFePHP\NFe\stdclass>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
557
    }
558
559
    /**
560
     * Cria a tag det/infAdProd [H]
561
     * H|item|infAdProd|
562
     * @param stdClass $std
563
     */
564
    protected function hEntity($std)
565
    {
566
        if (!empty($std->infAdProd)) {
567
            $this->make->taginfAdProd($std);
568
        }
569
        $this->item = (integer) $std->item;
570
    }
571
572
    /**
573
     * Cria a tag prod [I]
574
     * I|cProd|cEAN|xProd|NCM|EXTIPI|CFOP|uCom|qCom|vUnCom|vProd|cEANTrib|uTrib|qTrib|vUnTrib|vFrete|vSeg|vDesc|vOutro|indTot|xPed|nItemPed|nFCI|
575
     *
576
     * NOTA: Ajustado para NT2016_002_v1.30
577
     * I|cProd|cEAN|xProd|NCM|cBenf|EXTIPI|CFOP|uCom|qCom|vUnCom|vProd|cEANTrib|uTrib|qTrib|vUnTrib|vFrete|vSeg|vDesc|vOutro|indTot|xPed|nItemPed|nFCI|
578
     * @param stdClass $std
579
     */
580
    protected function iEntity($std)
581
    {
582
        $std->item = $this->item;
583
        $this->make->tagprod($std);
584
    }
585
586
    /**
587
     * Cria a tag NVE [I05A]
588
     * I05A|NVE|
589
     * @param stdClass $std
590
     */
591
    protected function i05aEntity($std)
592
    {
593
        $std->item = $this->item;
594
        $this->make->tagNVE($std);
595
    }
596
597
    /**
598
     * Cria a tag CEST [I05C]
599
     * I05C|CEST|
600
     * NOTA: Ajustado para NT2016_002_v1.30
601
     * I05C|CEST|indEscala|CNPJFab|
602
     * @param stdClass $std
603
     */
604
    protected function i05cEntity($std)
605
    {
606
        $std->item = $this->item;
607
        $this->make->tagCEST($std);
608
    }
609
610
    /**
611
     * Cria a tag DI [I18]
612
     * I18|nDI|dDI|xLocDesemb|UFDesemb|dDesemb|tpViaTransp|vAFRMM|tpIntermedio|CNPJ|UFTerceiro|cExportador|
613
     * @param stdClass $std
614
     */
615
    protected function i18Entity($std)
616
    {
617
        $std->item = $this->item;
618
        $this->make->tagDI($std);
619
        $this->nDI = $std->nDI;
620
    }
621
622
    /**
623
     * Cria a tag adi [I25], pertence a I18
624
     * I25|nAdicao|nSeqAdicC|cFabricante|vDescDI|nDraw|
625
     * @param stdClass $std
626
     */
627
    protected function i25Entity($std)
628
    {
629
        $std->item = $this->item;
630
        $std->nDI = $this->nDI;
631
        $this->make->tagadi($std);
632
    }
633
634
    /**
635
     * Carrega e cria a tag detExport [I50]
636
     * I50|nDraw|
637
     * @param stdClass $std
638
     */
639
    protected function i50Entity($std)
640
    {
641
        $std->item = $this->item;
642
        $std->nRE = null;
643
        $std->chNFe = null;
644
        $std->qExport = null;
645
        $this->make->tagdetExport($std);
646
    }
647
648
    /**
649
     * Carrega e cria a tag detExport/exportInd [I52]
650
     * I52|nRE|chNFe|qExport|
651
     * @param stdClass $std
652
     */
653
    protected function i52Entity($std)
654
    {
655
        $std->item = $this->item;
656
        $std->nDraw = null;
657
        $this->make->tagdetExportInd($std);
658
    }
659
660
    /**
661
     * Cria a tag RASTRO [I80]
662
     * NOTA: Ajustado para NT2016_002_v1.30
663
     * I80|nLote|qLote|dFab|dVal|cAgreg|
664
     * @param stdClass $std
665
     */
666
    protected function i80Entity($std)
667
    {
668
        $std->item = $this->item;
669
        $this->make->tagRastro($std);
670
    }
671
672
    /**
673
     * Cria a tag veicProd [JA]
674
     * JA|tpOp|chassi|cCor|xCor|pot|cilin|pesoL|pesoB|nSerie|tpComb|nMotor|CMT|dist|anoMod|anoFab|tpPint|tpVeic|espVeic|VIN|condVeic|cMod|cCorDENATRAN|lota|tpRest|
675
     * @param stdClass $std
676
     */
677
    protected function jaEntity($std)
678
    {
679
        $std->item = $this->item;
680
        $this->make->tagveicProd($std);
681
    }
682
683
    /**
684
     * Cria a tag med [K]
685
     * K|nLote|qLote|dFab|dVal|vPMC|
686
     * NOTA: Ajustado para NT2016_002_v1.30
687
     * K|cProdANVISA|vPMC|
688
     * @param stdClass $std
689
     */
690
    protected function kEntity($std)
691
    {
692
        $std->item = $this->item;
693
        $std->nLote = !empty($std->nLote) ? $std->nLote : null;
694
        $std->qLote = !empty($std->qLote) ? $std->qLote : null;
695
        $std->dFab = !empty($std->dFab) ? $std->dFab : null;
696
        $std->dVal = !empty($std->dVal) ? $std->dVal : null;
697
        $std->cProdANVISA = !empty($std->cProdANVISA) ? $std->cProdANVISA : null;
698
        $this->make->tagmed($std);
699
    }
700
701
    /**
702
     * Cria a tag arma [L]
703
     * L|tpArma|nSerie|nCano|descr|
704
     * @param stdClass $std
705
     */
706
    protected function lEntity($std)
707
    {
708
        $std->item = $this->item;
709
        $this->make->tagarma($std);
710
    }
711
712
    /**
713
     * Carrega e cria a tag comb [LA]
714
     * LA|cProdANP|pMixGN|CODIF|qTemp|UFCons|
715
     *
716
     * NOTA: Ajustado para NT2016_002_v1.30
717
     * LA|cProdANP|descANP|pGLP|pGNn|pGNi|vPart|CODIF|qTemp|UFCons|
718
     * @param stdClass $std
719
     */
720
    protected function laEntity($std)
721
    {
722
        $this->stdComb = $std;
723
        //como o campo abaixo é opcional não é possivel saber de antemão
724
        //se o mesmo existe ou não então
725
        //invocar na montagem final buildLAEntity()
726
    }
727
728
    /**
729
     * Carrega e cria a tag comb [LA07]
730
     * LA07|qBCProd|vAliqProd|vCIDE|
731
     * @param stdClass $std
732
     */
733
    protected function la07Entity($std)
734
    {
735
        $this->stdComb->qBCProd = $std->qBCProd;
736
        $this->stdComb->vAliqProd = $std->vAliqProd;
737
        $this->stdComb->vCIDE = $std->vCIDE;
738
        //como este campo é opcional, pode ser que não exista então
739
        //invocar na montagem final buildLAEntity()
740
    }
741
742
    /**
743
     * Carrega e cria a tag encerrante [LA11]
744
     * LA11|nBico|nBomba|nTanque|vEncIni|vEncFin|
745
     * @param stdClass $std
746
     */
747
    protected function la11Entity($std)
748
    {
749
        $std->item = $this->item;
750
        $this->make->tagencerrante($std);
751
    }
752
753
    /**
754
     * Cria a tag comb [LA]
755
     * @param stdClass $std
756
     */
757
    protected function buildLAEntity($std)
758
    {
759
        $std->item = $this->item;
760
        $this->make->tagcomb($this->stdComb);
761
    }
762
763
    /**
764
     * Cria a tag RECOPI [LB]
765
     * LB|nRECOPI|
766
     * @param stdClass $std
767
     */
768
    protected function lbEntity($std)
769
    {
770
        $std->item = $this->item;
771
        $this->make->tagRECOPI($std);
772
    }
773
774
    /**
775
     * Cria a tag imposto [M]
776
     * M|vTotTrib|
777
     * @param stdClass $std
778
     */
779
    protected function mEntity($std)
780
    {
781
        $std->item = $this->item;
782
        $this->make->tagimposto($std);
783
    }
784
785
    /**
786
     * Carrega a tag ICMS [N]
787
     * N|
788
     * @param stdClass $std
789
     */
790
    protected function nEntity($std)
0 ignored issues
show
Unused Code introduced by
The parameter $std is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
791
    {
792
        //fake não faz nada
793
    }
794
795
    /**
796
     * Carrega e cria a tag ICMS [N02]
797
     * N02|orig|CST|modBC|vBC|pICMS|vICMS|
798
     *
799
     * NOTA: Ajustado para NT2016_002_v1.30
800
     * N02|orig|CST|modBC|vBC|pICMS|vICMS|pFCP|vFCP|
801
     * @param stdClass $std
802
     */
803
    protected function n02Entity($std)
804
    {
805
        $this->buildNEntity($std);
806
    }
807
808
    /**
809
     * Carrega e cria a tag ICMS [N03]
810
     * N03|orig|CST|modBC|vBC|pICMS|vICMS|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|
811
     *
812
     * NOTA: Ajustado para NT2016_002_v1.30
813
     * N03|orig|CST|modBC|vBC|pICMS|vICMS|vBCFCP|pFCP|vFCP|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|vBCFCPST|pFCPST|vFCPST|
814
     * @param stdClass $std
815
     */
816
    protected function n03Entity($std)
817
    {
818
        $this->buildNEntity($std);
819
    }
820
821
    /**
822
     * Carrega e cria a tag ICMS [N04]
823
     * N04|orig|CST|modBC|pRedBC|vBC|pICMS|vICMS|vICMSDeson|motDesICMS|
824
     *
825
     * NOTA: Ajustado para NT2016_002_v1.30
826
     * N04|orig|CST|modBC|pRedBC|vBC|pICMS|vICMS|BCFCP|pFCP|vFCP|vICMSDeson|motDesICMS|
827
     * @param stdClass $std
828
     */
829
    protected function n04Entity($std)
830
    {
831
        $this->buildNEntity($std);
832
    }
833
834
    /**
835
     * Carrega e cria a tag ICMS [N05]
836
     * N05|orig|CST|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|vICMSDeson|motDesICMS|
837
     *
838
     * NOTA: Ajustado para NT2016_002_v1.30
839
     * N05|orig|CST|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|vBCFCPST|pFCPST|vFCPST|vICMSDeson|motDesICMS|
840
     * @param stdClass $std
841
     */
842
    protected function n05Entity($std)
843
    {
844
        $this->buildNEntity($std);
845
    }
846
847
    /**
848
     * Carrega e cria a tag ICMS [N06]
849
     * N06|orig|CST|vICMSDeson|motDesICMS|
850
     * @param stdClass $std
851
     */
852
    protected function n06Entity($std)
853
    {
854
        $this->buildNEntity($std);
855
    }
856
857
    /**
858
     * Carrega e cria a tag ICMS [N07]
859
     * N07|orig|CST|modBC|pRedBC|vBC|pICMS|vICMSOp|pDif|vICMSDif|vICMS|
860
     *
861
     * NOTA: Ajustado para NT2016_002_v1.30
862
     * N07|orig|CST|modBC|pRedBC|vBC|pICMS|vICMSOp|pDif|vICMSDif|vICMS|vBCFCP|pFCP|vFCP|
863
     * @param stdClass $std
864
     */
865
    protected function n07Entity($std)
866
    {
867
        $this->buildNEntity($std);
868
    }
869
870
    /**
871
     * Carrega e cria a tag ICMS [N08]
872
     * N08|orig|CST|vBCSTRet|vICMSSTRet|
873
     *
874
     * NOTA: Ajustado para NT2016_002_v1.30
875
     * N08|orig|CST|vBCSTRet|pST|vICMSSTRet|vBCFCPSTRet|pFCPSTRet|vFCPSTRet|
876
     * @param stdClass $std
877
     */
878
    protected function n08Entity($std)
879
    {
880
        $this->buildNEntity($std);
881
    }
882
883
    /**
884
     * Carrega e cria a tag ICMS [N09]
885
     * N09|orig|CST|modBC|pRedBC|vBC|pICMS|vICMS|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|vICMSDeson|motDesICMS|
886
     *
887
     * NOTA: Ajustado para NT2016_002_v1.30
888
     * N09|orig|CST|modBC|pRedBC|vBC|pICMS|vICMS|vBCFCP|pFCP|vFCP|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|vBCFCPST|pFCPST|vFCPST|vICMSDeson|motDesICMS|
889
     * @param stdClass $std
890
     */
891
    protected function n09Entity($std)
892
    {
893
        $this->buildNEntity($std);
894
    }
895
896
    /**
897
     * Carrega e cria a tag ICMS [N10]
898
     * N10|orig|CST|modBC|vBC|pRedBC|pICMS|vICMS|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|vICMSDeson|motDesICMS|
899
     *
900
     * NOTA: Ajustado para NT2016_002_v1.30
901
     * N10|orig|CST|modBC|vBC|pRedBC|pICMS|vICMS|vBCFCP|pFCP|vFCP|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|vBCFCPST|pFCPST|vFCPST|vICMSDeson|motDesICMS|
902
     * @param stdClass $std
903
     */
904
    protected function n10Entity($std)
905
    {
906
        $this->buildNEntity($std);
907
    }
908
909
910
    /**
911
     * Cria a tag ICMS [N]
912
     * NOTA: Ajustado para NT2016_002_v1.30
913
     * @param \stdClass $std
914
     */
915
    protected function buildNEntity($std)
916
    {
917
        $std->item = $this->item;
918
        $this->make->tagICMS($std);
919
    }
920
921
    /**
922
     * Cria a tag ICMSPart [N10a]
923
     * N10a|orig|CST|modBC|vBC|pRedBC|pICMS|vICMS|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|pBCOp|UFST|
924
     * @param stdClass $std
925
     */
926
    protected function n10aEntity($std)
927
    {
928
        $std->item = $this->item;
929
        $this->make->tagICMSPart($std);
930
    }
931
932
    /**
933
     * Cria a tag ICMSST [N10b]
934
     * N10b|orig|CST|vBCSTRet|vICMSSTRet|vBCSTDest|vICMSSTDest|
935
     * @param stdClass $std
936
     */
937
    protected function n10bEntity($std)
938
    {
939
        $std->item = $this->item;
940
        $this->make->tagICMSST($std);
941
    }
942
943
    /**
944
     * Carrega e Cria a tag ICMSSN [N10c]
945
     * N10c|orig|CSOSN|pCredSN|vCredICMSSN|
946
     * @param stdClass $std
947
     */
948
    protected function n10cEntity($std)
949
    {
950
        $this->buildNSNEntity($std);
951
    }
952
953
    /**
954
     * Carrega e Cria a tag ICMSSN [N10d]
955
     * N10d|orig|CSOSN|
956
     * @param stdClass $std
957
     */
958
    protected function n10dEntity($std)
959
    {
960
        $this->buildNSNEntity($std);
961
    }
962
963
964
    /**
965
     * Carrega e Cria a tag ICMSSN [N10e]
966
     * N10e|orig|CSOSN|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|pCredSN|vCredICMSSN|
967
     *
968
     * NOTA: Ajustado para NT2016_002_v1.30
969
     * N10e|orig|CSOSN|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|vBCFCPST|pFCPST|vFCPST|pCredSN|vCredICMSSN|pCredSN|vCredICMSSN|
970
     * @param stdClass $std
971
     */
972
    protected function n10eEntity($std)
973
    {
974
        $this->buildNSNEntity($std);
975
    }
976
    /**
977
     * Carrega e Cria a tag ICMSSN [N10f]
978
     * N10f|orig|CSOSN|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|
979
     *
980
     * NOTA: Ajustado para NT2016_002_v1.30
981
     * N10f|orig|CSOSN|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|vBCFCPST|pFCPST|vFCPST|
982
     * @param stdClass $std
983
     */
984
    protected function n10fEntity($std)
985
    {
986
        $this->buildNSNEntity($std);
987
    }
988
989
    /**
990
     * Carrega e Cria a tag ICMSSN [N10g]
991
     * N10g|orig|CSOSN|vBCSTRet|vICMSSTRet|
992
     *
993
     * NOTA: Ajustado para NT2016_002_v1.30
994
     * N10g|orig|CSOSN|vBCSTRet|pST|vICMSSTRet|vBCFCPSTRet|pFCPSTRet|vFCPSTRet|
995
     * @param stdClass $std
996
     */
997
    protected function n10gEntity($std)
998
    {
999
        $this->buildNSNEntity($std);
1000
    }
1001
1002
    /**
1003
     * Carrega e Cria a tag ICMSSN [N10h]
1004
     * N10h|orig|CSOSN|modBC|vBC|pRedBC|pICMS|vICMS|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|pCredSN|vCredICMSSN|
1005
     *
1006
     * NOTA: Ajustado para NT2016_002_v1.30
1007
     * N10h|orig|CSOSN|modBC|vBC|pRedBC|pICMS|vICMS|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|vBCFCPST|pFCPST|vFCPST|pCredSN|vCredICMSSN|
1008
     * @param stdClass $std
1009
     */
1010
    protected function n10hEntity($std)
1011
    {
1012
        $this->buildNSNEntity($std);
1013
    }
1014
1015
    /**
1016
     * Nsn|orig|CSOSN|modBC|vBC|pRedBC|pICMS|vICMS|pCredSN|vCredICMSSN|modBCST|pMVAST|pRedBCST|vBCST|pICMSST|vICMSST|vBCSTRet|vICMSSTRet|vBCFCPST|pFCPST|vFCPST|
1017
     * @param \stdClass $std
1018
     */
1019
    protected function buildNSNEntity($std)
1020
    {
1021
        $std->item = $this->item;
1022
        $this->make->tagICMSSN($std);
1023
    }
1024
1025
    /**
1026
     * Carrega e Cria a tag ICMSUFDest [NA]
1027
     * NA|vBCUFDest|pFCPUFDest|pICMSUFDest|pICMSInter|pICMSInterPart|vFCPUFDest|vICMSUFDest|vICMSFRemet|
1028
     * @param stdClass $std
1029
     */
1030
    protected function naEntity($std)
1031
    {
1032
        $this->buildNAEntity($std);
1033
    }
1034
1035
    /**
1036
     * Cria a tag ICMSUFDest [NA]
1037
     * @param stdClass $std
1038
     */
1039
    protected function buildNAEntity($std)
1040
    {
1041
        $std->item = $this->item;
1042
        $this->make->tagICMSUFDest($std);
1043
    }
1044
1045
    /**
1046
     * Carrega a tag IPI [O]
1047
     * O|clEnq|CNPJProd|cSelo|qSelo|cEnq|
1048
     * @param stdClass $std
1049
     */
1050
    protected function oEntity($std)
1051
    {
1052
        $std->item = $this->item;
1053
        $this->stdIPI = $std;
1054
        $this->stdIPI->CST = null;
1055
        $this->stdIPI->vIPI = null;
1056
        $this->stdIPI->vBC = null;
1057
        $this->stdIPI->pIPI = null;
1058
        $this->stdIPI->qUnid = null;
1059
        $this->stdIPI->vUnid = null;
1060
    }
1061
1062
    /**
1063
     * Carrega e cria a tag IPI [O07]
1064
     * O07|CST|vIPI|
1065
     * @param stdClass $std
1066
     */
1067
    protected function o07Entity($std)
1068
    {
1069
        $this->stdIPI->CST = $std->CST;
1070
        $this->stdIPI->vIPI = $std->vIPI;
1071
    }
1072
1073
    /**
1074
     * Carrega e cria a tag IPI [O08]
1075
     * O08|CST|
1076
     * @param stdClass $std
1077
     */
1078
    protected function o08Entity($std)
1079
    {
1080
        $this->stdIPI->CST = $std->CST;
1081
        $this->buildOEntity();
1082
    }
1083
1084
    /**
1085
     * Carrega e cria a tag IPI [O10]
1086
     * O10|vBC|pIPI|
1087
     * @param stdClass $std
1088
     */
1089
    protected function o10Entity($std)
1090
    {
1091
        $this->stdIPI->vBC = $std->vBC;
1092
        $this->stdIPI->pIPI = $std->pIPI;
1093
        $this->buildOEntity();
1094
    }
1095
1096
    /**
1097
     * Carrega e cria a tag IPI [O11]
1098
     * O11|qUnid|vUnid|
1099
     * @param stdClass $std
1100
     */
1101
    protected function o11Entity($std)
1102
    {
1103
        $this->stdIPI->qUnid = $std->qUnid;
1104
        $this->stdIPI->vUnid = $std->vUnid;
1105
        $this->buildOEntity();
1106
    }
1107
1108
    /**
1109
     * Cria a tag IPI [O]
1110
     * Oxx|cst|clEnq|cnpjProd|cSelo|qSelo|cEnq|vBC|pIPI|qUnid|vUnid|vIPI|
1111
     */
1112
    protected function buildOEntity()
1113
    {
1114
        $this->make->tagIPI($this->stdIPI);
1115
    }
1116
1117
    /**
1118
     * Cria a tag II [P]
1119
     * P|vBC|vDespAdu|vII|vIOF|
1120
     * @param stdClass $std
1121
     */
1122
    protected function pEntity($std)
1123
    {
1124
        $std->item = $this->item;
1125
        $this->make->tagII($std);
1126
    }
1127
1128
    /**
1129
     * Carrega a tag PIS [Q]
1130
     * Q|
1131
     * @param stdClass $std
1132
     */
1133
    protected function qEntity($std)
1134
    {
1135
        //carrega numero do item
1136
        $std->item = $this->item;
1137
        $this->stdPIS = $std;
1138
        $this->stdPIS->vBC = null;
1139
        $this->stdPIS->pPIS = null;
1140
        $this->stdPIS->vPIS = null;
1141
        $this->stdPIS->qBCProd = null;
1142
        $this->stdPIS->vAliqProd = null;
1143
    }
1144
1145
    /**
1146
     * Carrega e cria a tag PIS [Q02]
1147
     * Q02|CST|vBC|pPIS|vPIS|
1148
     * @param stdClass $std
1149
     */
1150
    protected function q02Entity($std)
1151
    {
1152
        $this->stdPIS->CST = $std->CST;
1153
        $this->stdPIS->vBC = $std->vBC;
1154
        $this->stdPIS->pPIS = $std->pPIS;
1155
        $this->stdPIS->vPIS = $std->vPIS;
1156
        $this->buildQEntity();
1157
    }
1158
1159
    /**
1160
     * Carrega e cria a tag PIS [Q03]
1161
     * Q03|CST|qBCProd|vAliqProd|vPIS|
1162
     * @param stdClass $std
1163
     */
1164
    protected function q03Entity($std)
1165
    {
1166
        $this->stdPIS->CST = $std->CST;
1167
        $this->stdPIS->vPIS = $std->vPIS;
1168
        $this->stdPIS->qBCProd = $std->qBCProd;
1169
        $this->stdPIS->vAliqProd  = $std->vAliqProd;
1170
        $this->buildQEntity();
1171
    }
1172
1173
    /**
1174
     * Carrega e cria a tag PIS [Q04]
1175
     * Q04|CST|
1176
     * @param stdClass $std
1177
     */
1178
    protected function q04Entity($std)
1179
    {
1180
        $this->stdPIS->CST = $std->CST;
1181
        $this->buildQEntity();
1182
    }
1183
1184
    /**
1185
     * Carrega e cria a tag PIS [Q05]
1186
     * Q05|CST|vPIS|
1187
     * @param stdClass $std
1188
     */
1189
    protected function q05Entity($std)
1190
    {
1191
        $this->stdPIS->CST = $std->CST;
1192
        $this->stdPIS->vPIS = $std->vPIS;
1193
        $this->buildQEntity();
1194
    }
1195
1196
    /**
1197
     * Carrega e cria a tag PIS [Q07]
1198
     * Q07|vBC|pPIS|
1199
     * @param stdClass $std
1200
     */
1201
    protected function q07Entity($std)
1202
    {
1203
        $this->stdPIS->vBC = $std->vBC;
1204
        $this->stdPIS->pPIS = $std->pPIS;
1205
        $this->buildQEntity();
1206
    }
1207
1208
    /**
1209
     * Carrega e cria a tag PIS [Q10]
1210
     * Q10|qBCProd|vAliqProd|
1211
     * @param stdClass $std
1212
     */
1213
    protected function q10Entity($std)
1214
    {
1215
        $this->stdPIS->qBCProd = $std->qBCProd;
1216
        $this->stdPIS->vAliqProd  = $std->vAliqProd;
1217
        $this->buildQEntity();
1218
    }
1219
1220
    /**
1221
     * Cria a tag PIS [Q]
1222
     * Qxx|CST|vBC|pPIS|vPIS|qBCProd|vAliqProd|
1223
     */
1224
    protected function buildQEntity()
1225
    {
1226
        $this->make->tagPIS($this->stdPIS);
1227
    }
1228
1229
    /**
1230
     * Carrega tag PISST [R]
1231
     * R|vPIS|
1232
     * @param stdClass $std
1233
     */
1234
    protected function rEntity($std)
1235
    {
1236
        //carrega numero do item
1237
        $std->item = $this->item;
1238
        $this->stdPISST = $std;
1239
        $this->stdPISST->vBC = null;
1240
        $this->stdPISST->pPIS = null;
1241
        $this->stdPISST->vPIS = null;
1242
        $this->stdPISST->qBCProd = null;
1243
        $this->stdPISST->vAliqProd = null;
1244
    }
1245
1246
    /**
1247
     * Carrega e cria tag PISST [R02]
1248
     * R02|vBC|pPIS|
1249
     * @param stdClass $std
1250
     */
1251
    protected function r02Entity($std)
1252
    {
1253
        $this->stdPISST->vBC = $std->vBC;
1254
        $this->stdPISST->pPIS = $std->pPIS;
1255
        $this->buildREntity();
1256
    }
1257
1258
    /**
1259
     * Carrega e cria tag PISST [R04]
1260
     * R04|qBCProd|vAliqProd|vPIS|
1261
     * @param stdClass $std
1262
     */
1263
    protected function r04Entity($std)
1264
    {
1265
        $this->stdPISST->qBCProd = $std->qBCProd;
1266
        $this->stdPISST->vAliqProd = $std->vAliqProd;
1267
        $this->stdPISST->vPIS = $std->vPIS;
1268
        $this->buildREntity();
1269
    }
1270
1271
    /**
1272
     * Cria a tag PISST
1273
     * Rxx|vBC|pPIS|qBCProd|vAliqProd|vPIS|
1274
     */
1275
    protected function buildREntity()
1276
    {
1277
        $this->make->tagPISST($this->stdPISST);
1278
    }
1279
1280
    /**
1281
     * Carrega COFINS [S]
1282
     * S|
1283
     * @param stdClass $std
1284
     */
1285
    protected function sEntity($std)
1286
    {
1287
        //carrega numero do item
1288
        $std->item = $this->item;
1289
        $this->stdCOFINS = $std;
1290
        $this->stdCOFINS->vBC = null;
1291
        $this->stdCOFINS->pCOFINS = null;
1292
        $this->stdCOFINS->vCOFINS = null;
1293
        $this->stdCOFINS->qBCProd = null;
1294
        $this->stdCOFINS->vAliqProd = null;
1295
    }
1296
1297
    /**
1298
     * Carrega COFINS [S02]
1299
     * S02|CST|vBC|pCOFINS|vCOFINS|
1300
     * @param stdClass $std
1301
     */
1302
    protected function s02Entity($std)
1303
    {
1304
        $this->stdCOFINS->CST = $std->CST;
1305
        $this->stdCOFINS->vBC = $std->vBC;
1306
        $this->stdCOFINS->pCOFINS = $std->pCOFINS;
1307
        $this->stdCOFINS->vCOFINS = $std->vCOFINS;
1308
        $this->buildSEntity();
1309
    }
1310
1311
    /**
1312
     * Carrega COFINS [S03]
1313
     * S03|CST|qBCProd|vAliqProd|vCOFINS|
1314
     * @param stdClass $std
1315
     */
1316
    protected function s03Entity($std)
1317
    {
1318
        $this->stdCOFINS->CST = $std->CST;
1319
        $this->stdCOFINS->qBCProd = $std->qBCProd;
1320
        $this->stdCOFINS->vAliqProd = $std->vAliqProd;
1321
        $this->stdCOFINS->vCOFINS = $std->vCOFINS;
1322
        $this->buildSEntity();
1323
    }
1324
1325
    /**
1326
     * Carrega COFINS [S04]
1327
     * S04|CST|
1328
     * @param stdClass $std
1329
     */
1330
    protected function s04Entity($std)
1331
    {
1332
        $this->stdCOFINS->CST = $std->CST;
1333
        $this->buildSEntity();
1334
    }
1335
1336
    /**
1337
     * Carrega COFINS [S05]
1338
     * S05|CST|vCOFINS|
1339
     * @param stdClass $std
1340
     */
1341
    protected function s05Entity($std)
1342
    {
1343
        $this->stdCOFINS->CST = $std->CST;
1344
        $this->stdCOFINS->vCOFINS = $std->vCOFINS;
1345
    }
1346
1347
    /**
1348
     * Carrega e cria a tag COFINS [S07]
1349
     * S07|vBC|pCOFINS|
1350
     * @param stdClass $std
1351
     */
1352
    protected function s07Entity($std)
1353
    {
1354
        $this->stdCOFINS->vBC = $std->vBC;
1355
        $this->stdCOFINS->pCOFINS = $std->pCOFINS;
1356
        $this->buildSEntity();
1357
    }
1358
1359
    /**
1360
     * Carrega e cria a tag COFINS [S09]
1361
     * S09|qBCProd|vAliqProd|
1362
     * @param stdClass $std
1363
     */
1364
    protected function s09Entity($std)
1365
    {
1366
        $this->stdCOFINS->qBCProd = $std->qBCProd;
1367
        $this->stdCOFINS->vAliqProd = $std->vAliqProd;
1368
        $this->buildSEntity();
1369
    }
1370
1371
    /**
1372
     * Cria a tag COFINS
1373
     * Sxx|CST|vBC|pCOFINS|vCOFINS|qBCProd|vAliqProd|
1374
     */
1375
    protected function buildSEntity()
1376
    {
1377
        $this->make->tagCOFINS($this->stdCOFINS);
1378
    }
1379
1380
    /**
1381
     * COFINSST [T]
1382
     * T|vCOFINS|
1383
     * @param stdClass $std
1384
     */
1385
    protected function tEntity($std)
1386
    {
1387
        //carrega numero do item
1388
        $std->item = $this->item;
1389
        $this->stdCOFINSST = $std;
1390
        $this->stdCOFINSST->vBC = null;
1391
        $this->stdCOFINSST->pCOFINS = null;
1392
        $this->stdCOFINSST->vCOFINS = null;
1393
        $this->stdCOFINSST->qBCProd = null;
1394
        $this->stdCOFINSST->vAliqProd = null;
1395
    }
1396
1397
    /**
1398
     * Carrega e cria COFINSST [T02]
1399
     * T02|vBC|pCOFINS|
1400
     * @param stdClass $std
1401
     */
1402
    protected function t02Entity($std)
1403
    {
1404
        $this->stdCOFINSST->vBC = $std->vBC;
1405
        $this->stdCOFINSST->pCOFINS = $std->pCOFINS;
1406
        $this->buildTEntity();
1407
    }
1408
1409
    /**
1410
     * Carrega e cria COFINSST [T04]
1411
     * T04|qBCProd|vAliqProd|
1412
     * @param stdClass $std
1413
     */
1414
    protected function t04Entity($std)
1415
    {
1416
        $this->stdCOFINSST->qBCProd = $std->qBCProd;
1417
        $this->stdCOFINSST->vAliqProd = $std->vAliqProd;
1418
        $this->buildTEntity();
1419
    }
1420
1421
    /**
1422
     * Cria a tag COFINSST
1423
     * Txx|vBC|pCOFINS|qBCProd|vAliqProd|vCOFINS|
1424
     */
1425
    protected function buildTEntity()
1426
    {
1427
        $this->stdCOFINSST->item = $this->item;
1428
        $this->make->tagCOFINSST($this->stdCOFINSST);
1429
    }
1430
1431
    /**
1432
     * Cria a tag ISSQN [U]
1433
     * U|vBC|vAliq|vISSQN|cMunFG|cListServ|vDeducao|vOutro|vDescIncond
1434
     *  |vDescCond|vISSRet|indISS|cServico|cMun|cPais|nProcesso|indIncentivo|
1435
     * @param stdClass $std
1436
     */
1437
    protected function uEntity($std)
1438
    {
1439
        $std->item = $this->item;
1440
        $this->make->tagISSQN($std);
1441
    }
1442
1443
    /**
1444
     * Cria a tag tagimpostoDevol [UA]
1445
     * UA|pDevol|vIPIDevol|
1446
     * @param stdClass $std
1447
     */
1448
    protected function uaEntity($std)
1449
    {
1450
        $std->item = $this->item;
1451
        $this->make->tagimpostoDevol($std);
1452
    }
1453
1454
    /**
1455
     * Linha W [W]
1456
     * W|
1457
     * @param stdClass $std
1458
     */
1459
    protected function wEntity($std)
0 ignored issues
show
Unused Code introduced by
The parameter $std is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
1460
    {
1461
        //fake não faz nada
1462
    }
1463
1464
    /**
1465
     * Cria tag ICMSTot [W02]
1466
     * W02|vBC|vICMS|vICMSDeson|vBCST|vST|vProd|vFrete|vSeg|vDesc|vII|vIPI|vPIS|vCOFINS|vOutro|vNF|vTotTrib|
1467
     * NOTA: Ajustado para NT2016_002_v1.30
1468
     * W02|vBC|vICMS|vICMSDeson|vFCP|vBCST|vST|vFCPST|vFCPSTRet|vProd|vFrete|vSeg|vDesc|vII|vIPI|vIPIDevol|vPIS|vCOFINS|vOutro|vNF|vTotTrib|
1469
     * @param stdClass $std
1470
     */
1471
    protected function w02Entity($std)
1472
    {
1473
        $this->make->tagICMSTot($std);
1474
    }
1475
1476
1477
    /**
1478
     * Cria a tag ISSQNTot [W17]
1479
     * W17|vServ|vBC|vISS|vPIS|vCOFINS|dCompet|vDeducao|vOutro|vDescIncond
1480
     *    |vDescCond|vISSRet|cRegTrib|
1481
     * @param stdClass $std
1482
     */
1483
    protected function w17Entity($std)
1484
    {
1485
        $this->make->tagISSQNTot($std);
1486
    }
1487
1488
    /**
1489
     * Cria a tag retTrib [W23]
1490
     * W23|vRetPIS|vRetCOFINS|vRetCSLL|vBCIRRF|vIRRF|vBCRetPrev|vRetPrev|
1491
     * @param stdClass $std
1492
     */
1493
    protected function w23Entity($std)
1494
    {
1495
        $this->make->tagretTrib($std);
1496
    }
1497
1498
    /**
1499
     * Cria a tag transp [X]
1500
     * X|modFrete|
1501
     * @param stdClass $std
1502
     */
1503
    protected function xEntity($std)
1504
    {
1505
        $this->make->tagtransp($std);
1506
    }
1507
1508
    /**
1509
     * Carrega endereço tranpotadora [X03]
1510
     * X03|xNome|IE|xEnder|xMun|UF|
1511
     * @param stdClass $std
1512
     */
1513
    protected function x03Entity($std)
1514
    {
1515
        $this->stdTransporta = $std;
1516
    }
1517
1518
    /**
1519
     * Carrega e cria transp com CNPJ [X04]
1520
     * X04|CNPJ|
1521
     * @param stdClass $std
1522
     */
1523
    protected function x04Entity($std)
1524
    {
1525
        $this->stdTransporta->CNPJ = $std->CNPJ;
1526
        $this->stdTransporta->CPF = null;
1527
        $this->make->tagtransporta($this->stdTransporta);
1528
        $this->stdTransporta = null;
1529
    }
1530
1531
    /**
1532
     * Carrega e cria transp com CPF [X05]
1533
     * X05|CPF|
1534
     * @param stdClass $std
1535
     */
1536
    protected function x05Entity($std)
1537
    {
1538
        $this->stdTransporta->CPF = $std->CPF;
1539
        $this->stdTransporta->CNPJ = null;
1540
        $this->make->tagtransporta($this->stdTransporta);
1541
        $this->stdTransporta = null;
1542
    }
1543
1544
    /**
1545
     * Carrega impostos transportadora [X11]
1546
     * X11|vServ|vBCRet|pICMSRet|vICMSRet|CFOP|cMunFG|
1547
     * @param stdClass $std
1548
     */
1549
    protected function x11Entity($std)
1550
    {
1551
        $this->make->tagretTransp($std);
1552
    }
1553
1554
    /**
1555
     * Cria a tag veicTransp [X18]
1556
     * X18|placa|UF|RNTC|
1557
     * @param stdClass $std
1558
     */
1559
    protected function x18Entity($std)
1560
    {
1561
        $this->make->tagveicTransp($std);
1562
    }
1563
1564
    /**
1565
     * Cria a tag reboque [X22]
1566
     * X22|placa|UF|RNTC|vagao|balsa|
1567
     * @param stdClass $std
1568
     */
1569
    protected function x22Entity($std)
1570
    {
1571
        $this->make->tagreboque($std);
1572
    }
1573
1574
    /**
1575
     * Carrega volumes [X26]
1576
     * X26|qVol|esp|marca|nVol|pesoL|pesoB|
1577
     * @param stdClass $std
1578
     */
1579
    protected function x26Entity($std)
1580
    {
1581
        $this->volId += 1;
1582
        $std->item = $this->volId;
1583
        $this->make->tagvol($std);
1584
    }
1585
1586
    /**
1587
     * Carrega o lacre [X33]
1588
     * X33|nLacre|
1589
     * @param stdClass $std
1590
     */
1591
    protected function x33Entity($std)
1592
    {
1593
        $std->item = $this->volId;
1594
        $this->make->taglacres($std);
1595
    }
1596
1597
    /**
1598
     * Cria a tag vol
1599
     * @param stdClass $std
1600
     */
1601
    protected function buildVolEntity($std)
1602
    {
1603
        $this->make->tagvol($std);
1604
    }
1605
1606
    /**
1607
     * yEntity [Y]
1608
     * Y|
1609
     * NOTA: Ajustado para NT2016_002_v1.30
1610
     * Y|vTroco|
1611
     * @param stdClass $std
1612
     */
1613
    protected function yEntity($std)
1614
    {
1615
        $this->make->tagpag($std);
1616
    }
1617
1618
1619
    /**
1620
     * Cria as tags pag e card [YA]
1621
     * YA|tPag|vPag|CNPJ|tBand|cAut|tpIntegra|
1622
     * @param stdClass $std
1623
     */
1624
    protected function yaEntity($std)
1625
    {
1626
        $this->make->tagdetPag($std);
1627
    }
1628
1629
    /**
1630
     * Cria a tag fat [Y02]
1631
     * Y02|nFat|vOrig|vDesc|vLiq|
1632
     * @param stdClass $std
1633
     */
1634
    protected function y02Entity($std)
1635
    {
1636
        $this->make->tagfat($std);
1637
    }
1638
1639
    /**
1640
     * Cria a tag dup [Y07]
1641
     * Y07|nDup|dVenc|vDup|
1642
     * @param stdClass $std
1643
     */
1644
    protected function y07Entity($std)
1645
    {
1646
        $this->make->tagdup($std);
1647
    }
1648
1649
    /**
1650
     * Cria a a tag infAdic [Z]
1651
     * Z|infAdFisco|infCpl|
1652
     * @param stdClass $std
1653
     */
1654
    protected function zEntity($std)
1655
    {
1656
        $this->make->taginfAdic($std);
1657
    }
1658
1659
    /**
1660
     * Cria a tag obsCont [Z04]
1661
     * Z04|xCampo|xTexto|
1662
     * @param stdClass $std
1663
     */
1664
    protected function z04Entity($std)
1665
    {
1666
        $this->make->tagobsCont($std);
1667
    }
1668
1669
    /**
1670
     * Cria a tag obsFisco [Z07]
1671
     * Z07|xCampo|xTexto|
1672
     * @param stdClass $std
1673
     */
1674
    protected function z07Entity($std)
1675
    {
1676
        $this->make->tagobsFisco($std);
1677
    }
1678
1679
    /**
1680
     * Cria a tag procRef [Z10]
1681
     * Z10|nProc|indProc|
1682
     * @param stdClass $std
1683
     */
1684
    protected function z10Entity($std)
1685
    {
1686
        $this->make->tagprocRef($std);
1687
    }
1688
1689
    /**
1690
     * Cria a tag exporta [ZA]
1691
     * ZA|UFSaidaPais|xLocExporta|xLocDespacho|
1692
     * @param stdClass $std
1693
     */
1694
    protected function zaEntity($std)
1695
    {
1696
        $this->make->tagexporta($std);
1697
    }
1698
1699
    /**
1700
     * Cria a tag compra [ZB]
1701
     * ZB|xNEmp|xPed|xCont|
1702
     * @param stdClass $std
1703
     */
1704
    protected function zbEntity($std)
1705
    {
1706
        $this->make->tagcompra($std);
1707
    }
1708
1709
    /**
1710
     * Cria a tag cana [ZC]
1711
     * ZC|safra|ref|qTotMes|qTotAnt|qTotGer|vFor|vTotDed|vLiqFor|
1712
     * @param stdClass $std
1713
     */
1714
    protected function zcEntity($std)
1715
    {
1716
        $this->make->tagcana($std);
1717
    }
1718
1719
    /**
1720
     * Cria a tag forDia [ZC04]
1721
     * ZC04|dia|qtde|
1722
     * @param stdClass $std
1723
     */
1724
    protected function zc04Entity($std)
1725
    {
1726
        $this->make->tagforDia($std);
1727
    }
1728
1729
    /**
1730
     * Cria a tag deduc [ZC10]
1731
     * ZC10|xDed|vDed|
1732
     * @param stdClass $std
1733
     */
1734
    protected function zc10Entity($std)
1735
    {
1736
        $this->make->tagdeduc($std);
1737
    }
1738
1739
    /**
1740
     * Cria a tag infNFeSupl com o qrCode para impressão da DANFCE [ZX01]
1741
     * ZX01|qrcode|
1742
     * NOTA: Ajustado para NT2016_002_v1.20
1743
     * ZX01|qrcode|urlChave|
1744
     * @param stdClass $std
1745
     */
1746
    protected function zx01Entity($std)
1747
    {
1748
        $this->make->taginfNFeSupl($std);
1749
    }
1750
}
1751