node-sped-nfe 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/LICENSE.md +188 -0
  2. package/dist/utils/eventos.d.ts +2 -1
  3. package/dist/utils/eventos.js +794 -105
  4. package/dist/utils/extras.d.ts +2 -0
  5. package/dist/utils/extras.js +58 -0
  6. package/dist/utils/make.d.ts +1 -1
  7. package/dist/utils/make.js +36 -12
  8. package/dist/utils/tools.d.ts +4 -2
  9. package/dist/utils/tools.js +77 -10
  10. package/docs/xml.md +81 -81
  11. package/exemplos/consulta.js +19 -0
  12. package/exemplos/nfe.js +4 -3
  13. package/exemplos/status.js +2 -1
  14. package/package.json +5 -2
  15. package/src/utils/eventos.ts +800 -106
  16. package/src/utils/extras.ts +59 -0
  17. package/src/utils/make.ts +63 -19
  18. package/src/utils/tools.ts +88 -11
  19. package/src/utils/schemas/consReciNFe_v4.00.xsd +0 -9
  20. package/src/utils/schemas/consSitNFe_v4.00.xsd +0 -9
  21. package/src/utils/schemas/consStatServ_v4.00.xsd +0 -9
  22. package/src/utils/schemas/enviNFe_v4.00.xsd +0 -9
  23. package/src/utils/schemas/inutNFe_v4.00.xsd +0 -9
  24. package/src/utils/schemas/leiauteConsSitNFe_v4.00.xsd +0 -502
  25. package/src/utils/schemas/leiauteConsStatServ_v4.00.xsd +0 -98
  26. package/src/utils/schemas/leiauteInutNFe_v4.00.xsd +0 -193
  27. package/src/utils/schemas/leiauteNFe_v4.00.xsd +0 -7412
  28. package/src/utils/schemas/nfe_v4.00.xsd +0 -9
  29. package/src/utils/schemas/procInutNFe_v4.00.xsd +0 -9
  30. package/src/utils/schemas/procNFe_v4.00.xsd +0 -9
  31. package/src/utils/schemas/retConsReciNFe_v4.00.xsd +0 -9
  32. package/src/utils/schemas/retConsSitNFe_v4.00.xsd +0 -9
  33. package/src/utils/schemas/retConsStatServ_v4.00.xsd +0 -9
  34. package/src/utils/schemas/retEnviNFe_v4.00.xsd +0 -9
  35. package/src/utils/schemas/retInutNFe_v4.00.xsd +0 -9
  36. package/src/utils/schemas/tiposBasico_v4.00.xsd +0 -598
  37. package/src/utils/schemas/xmldsig-core-schema_v1.01.xsd +0 -98
package/docs/xml.md CHANGED
@@ -83,7 +83,7 @@ nfe.taginfNFe(std);
83
83
 
84
84
  ```
85
85
 
86
- ### 🟢 function tagide(std)
86
+ ### 🟢 function tagIde(std)
87
87
  Node de identificação da NFe
88
88
 
89
89
  | Parâmetro | Tipo | Descrição |
@@ -119,11 +119,11 @@ std.verProc = '3.10.31';
119
119
  std.dhCont = null;
120
120
  std.xJust = null;
121
121
 
122
- nfe.tagide(std);
122
+ nfe.tagIde(std);
123
123
  ```
124
124
 
125
125
 
126
- ### 🔴 function tagrefNFe(std)
126
+ ### 🟢 function tagrefNFe(std)
127
127
  Node referente a NFe referenciada
128
128
 
129
129
  | Parâmetro | Tipo | Descrição |
@@ -137,7 +137,7 @@ std.refNFe = '35150271780456000160550010000253101000253101';
137
137
  nfe.tagrefNFe(std);
138
138
  ```
139
139
 
140
- ### 🔴 function tagrefNF(std)
140
+ ### 🟢 function tagrefNF(std)
141
141
  Node referente a Nota Fiscal referenciada modelo 1 ou 2
142
142
 
143
143
  | Parâmetro | Tipo | Descrição |
@@ -156,7 +156,7 @@ std.nNF = 587878;
156
156
  nfe.tagrefNF(std);
157
157
  ```
158
158
 
159
- ### 🔴 function tagrefNFP(std)
159
+ ### 🟢 function tagrefNFP(std)
160
160
  Node referente a Nota Fiscal referenciada de produtor rural
161
161
 
162
162
  | Parâmetro | Tipo | Descrição |
@@ -173,10 +173,11 @@ std.IE = 'ISENTO';
173
173
  std.mod = '04';
174
174
  std.serie = 0;
175
175
  std.nNF = 5578;
176
+ std.refCTe = '35150271780456000160550010000253101000253101'
176
177
 
177
178
  nfe.tagrefNFP(std);
178
179
  ```
179
- ### 🔴 function tagrefCTe(std)
180
+ ### 🟢 function tagrefCTe(std)
180
181
  Node referente aos CTe referenciados
181
182
 
182
183
  | Parâmetro | Tipo | Descrição |
@@ -189,7 +190,7 @@ std.refCTe = '35150268252816000146570010000016161002008472';
189
190
  nfe.tagrefCTe(std);
190
191
  ```
191
192
 
192
- ### 🔴 function tagrefECF(std)
193
+ ### 🟢 function tagrefECF(std)
193
194
  Node referente aos ECF referenciados
194
195
 
195
196
  | Parâmetro | Tipo | Descrição |
@@ -296,7 +297,7 @@ std.fone;
296
297
  nfe.tagenderDest(std);
297
298
  ```
298
299
 
299
- ### 🔴 function tagretirada(std)
300
+ ### 🟢 function tagretirada(std)
300
301
  > NOTA: Ajustado para NT 2018.005
301
302
  Node indicativo de local de retirada diferente do endereço do emitente
302
303
 
@@ -356,7 +357,7 @@ std.email = 'contato@beltrano.com.br';
356
357
  nfe.tagentrega(std);
357
358
  ```
358
359
 
359
- ### 🔴 function tagautXML(std)
360
+ ### 🟢 function tagautXML(std)
360
361
  Node de registro de pessoas autorizadas a acessar a NFe
361
362
 
362
363
  | Parâmetro | Tipo | Descrição |
@@ -365,7 +366,7 @@ Node de registro de pessoas autorizadas a acessar a NFe
365
366
  ```javascript
366
367
  let std = new Object();
367
368
  std.CNPJ = '12345678901234'; //indicar um CNPJ ou CPF
368
- std.CPF = null;
369
+ //std.CPF = null; //indicar um CNPJ ou CPF
369
370
  nfe.tagautXML(std);
370
371
  ```
371
372
 
@@ -377,7 +378,6 @@ Node de dados do produto/serviço
377
378
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
378
379
  ```javascript
379
380
  let std = new Object();
380
- std.item = 1; //item da NFe
381
381
  std.cProd;
382
382
  std.cEAN;
383
383
  std.cBarra;
@@ -404,7 +404,7 @@ std.xPed;
404
404
  std.nItemPed;
405
405
  std.nFCI;
406
406
 
407
- nfe.tagprod(std);
407
+ nfe.tagProd([std]);
408
408
  ```
409
409
 
410
410
  ### 🔴 function tagCreditoPresumidoProd(std): void
@@ -419,12 +419,12 @@ Node opcional com dados de Crédito Presumido, são permitidos até 4 registros
419
419
 
420
420
  ```javascript
421
421
  let std = new \Object();
422
- std.item = 1;
422
+ let indexProd = 1;
423
423
  std.cCredPresumido = '2222211234';
424
424
  std.pCredPresumido = '4';
425
425
  std.vCredPresumido = '4';
426
426
 
427
- $make.tagCreditoPresumidoProd(std);
427
+ $make.tagCreditoPresumidoProd(indexProd ,std);
428
428
  ```
429
429
 
430
430
  ### 🔴 function taginfAdProd(std)
@@ -435,14 +435,14 @@ Node de informações adicionais do produto
435
435
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
436
436
  ```javascript
437
437
  let std = new Object();
438
- std.item = 1; //item da NFe
438
+ let indexProd = 1; //item da NFe
439
439
 
440
440
  std.infAdProd = 'informacao adicional do item';
441
441
 
442
- nfe.taginfAdProd(std);
442
+ nfe.taginfAdProd(indexProd, std);
443
443
  ```
444
444
 
445
- ### 🔴 function tagNVE(std)
445
+ ### 🔴 function tagNVE(std) !! Pode ser declarado no tagProd({...NCM, NVE:[]})
446
446
  Node com a Nomenclatura de Valor Aduaneiro e Estatística do item da NFe
447
447
 
448
448
  | Parâmetro | Tipo | Descrição |
@@ -450,13 +450,13 @@ Node com a Nomenclatura de Valor Aduaneiro e Estatística do item da NFe
450
450
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
451
451
  ```javascript
452
452
  let std = new Object();
453
- std.item = 1; //item da NFe
453
+ let indexProd = 1; //item da NFe
454
454
  std.NVE = 'AA0001';
455
455
 
456
- nfe.tagNVE(std);
456
+ nfe.tagNVE(indexProd, std);
457
457
  ```
458
458
 
459
- ### 🔴 function tagCEST(std)
459
+ ### 🔴 function tagCEST(std) !! Pode ser declarado no tagProd({...NCM, CEST, indEscala, CNPJFab})
460
460
  Node de detalhamento do Especificador da Substituição Tributária do item da NFe
461
461
 
462
462
  | Parâmetro | Tipo | Descrição |
@@ -464,15 +464,15 @@ Node de detalhamento do Especificador da Substituição Tributária do item da N
464
464
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
465
465
  ```javascript
466
466
  let std = new Object();
467
- std.item = 1; //item da NFe
467
+ let indexProd = 1; //item da NFe
468
468
  std.CEST = '0200100';
469
469
  std.indEscala = 'N'; //incluido no layout 4.00
470
470
  std.CNPJFab = '12345678901234'; //incluido no layout 4.00
471
471
 
472
- nfe.tagCEST(std);
472
+ nfe.tagCEST(indexProd, std);
473
473
  ```
474
474
 
475
- ### 🔴 function tagRECOPI(std)
475
+ ### 🔴 function tagRECOPI(std) !! Pode ser declarado no tagProd({...NCM, nRECOPI})
476
476
  Node com o número do RECOPI
477
477
 
478
478
  | Parâmetro | Tipo | Descrição |
@@ -480,13 +480,13 @@ Node com o número do RECOPI
480
480
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
481
481
  ```javascript
482
482
  let std = new Object();
483
- std.item = 1; //item da NFe
483
+ let indexProd = 1; //item da NFe
484
484
  std.nRECOPI = '12345678901234567890';
485
485
 
486
- nfe.tagRECOPI(std);
486
+ nfe.tagRECOPI(indexProd, std);
487
487
  ```
488
488
 
489
- ### 🔴 function tagDI(std)
489
+ ### 🟢 function tagDI(std) !! Pode ser declarado no tagProd({..., DI:{...}})
490
490
  Node com informações da Declaração de Importação do item da NFe
491
491
 
492
492
  | Parâmetro | Tipo | Descrição |
@@ -494,7 +494,7 @@ Node com informações da Declaração de Importação do item da NFe
494
494
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
495
495
  ```javascript
496
496
  let std = new Object();
497
- std.item = 1; //item da NFe
497
+ let indexProd = 1; //item da NFe
498
498
  std.nDI;
499
499
  std.dDI;
500
500
  std.xLocDesemb;
@@ -508,10 +508,10 @@ std.CPF; //NT 2023.004 v1.00
508
508
  std.UFTerceiro;
509
509
  std.cExportador;
510
510
 
511
- nfe.tagDI(std);
511
+ nfe.tagDI(indexProd, std);
512
512
  ```
513
513
 
514
- ### 🔴 function tagadi(std)
514
+ ### 🟢 function tagadi(std) !! Pode ser declarado no tagProd({..., DI:{...,adi:{...}}})
515
515
  Node de Adições relativas as DI do item
516
516
 
517
517
  | Parâmetro | Tipo | Descrição |
@@ -519,7 +519,7 @@ Node de Adições relativas as DI do item
519
519
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
520
520
  ```javascript
521
521
  let std = new Object();
522
- std.item = 1; //item da NFe
522
+ let indexProd = 1; //item da NFe
523
523
  std.nDI; //número da DI
524
524
  std.nAdicao;
525
525
  std.nSeqAdic;
@@ -527,7 +527,7 @@ std.cFabricante;
527
527
  std.vDescDI;
528
528
  std.nDraw;
529
529
 
530
- nfe.tagadi(std);
530
+ nfe.tagadi(indexProd, std);
531
531
  ```
532
532
 
533
533
  ### 🔴 function tagdetExport(std)
@@ -538,10 +538,10 @@ Node com informações de exportação para o item
538
538
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
539
539
  ```javascript
540
540
  let std = new Object();
541
- std.item = 1; //item da NFe
541
+ let indexProd = 1; //item da NFe
542
542
  std.nDraw = '82828';
543
543
 
544
- nfe.tagdetExport(std);
544
+ nfe.tagdetExport(indexProd, std);
545
545
  ```
546
546
 
547
547
  ### 🔴 function tagdetExportInd(std)
@@ -553,12 +553,12 @@ nfe.tagdetExport(std) pois pertence a essa tag
553
553
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
554
554
  ```javascript
555
555
  let std = new Object();
556
- std.item = 1; //item da NFe
556
+ let indexProd = 1; //item da NFe
557
557
  std.nRE = '123456789012';
558
558
  std.chNFe = '53170924915365000295550550000001951000001952';
559
559
  std.qExport = 1234.123;
560
560
 
561
- nfe.tagdetExportInd(std);
561
+ nfe.tagdetExportInd(indexProd, std);
562
562
  ```
563
563
  ### 🔴 function tagRastro(std)
564
564
  Node com os dados de rastreabilidade do item da NFe
@@ -570,14 +570,14 @@ Node com os dados de rastreabilidade do item da NFe
570
570
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
571
571
  ```javascript
572
572
  let std = new Object();
573
- std.item = 1; //item da NFe
573
+ let indexProd = 1; //item da NFe
574
574
  std.nLote = '11111';
575
575
  std.qLote = 200;
576
576
  std.dFab = '2018-01-01';
577
577
  std.dVal = '2020-01-01';
578
578
  std.cAgreg = '1234';
579
579
 
580
- nfe.tagRastro(std);
580
+ nfe.tagRastro(indexProd, std);
581
581
  ```
582
582
 
583
583
  ### 🔴 function tagveicProd(std)
@@ -588,7 +588,7 @@ Node com o detalhamento de Veículos novos do item da NFe
588
588
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
589
589
  ```javascript
590
590
  let std = new Object();
591
- std.item = 1; //item da NFe
591
+ let indexProd = 1; //item da NFe
592
592
  std.tpOp;
593
593
  std.chassi;
594
594
  std.cCor;
@@ -614,7 +614,7 @@ std.cCorDENATRAN;
614
614
  std.lota;
615
615
  std.tpRest;
616
616
 
617
- nfe.tagveicProd(std);
617
+ nfe.tagveicProd(indexProd, std);
618
618
  ```
619
619
 
620
620
  ### 🔴 function tagmed(std)
@@ -626,12 +626,12 @@ Node com o detalhamento de Medicamentos e de matérias-primas farmacêuticas
626
626
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
627
627
  ```javascript
628
628
  let std = new Object();
629
- std.item = 1; //item da NFe
629
+ let indexProd = 1; //item da NFe
630
630
  std.cProdANVISA = '1234567890123'; //incluido no layout 4.00
631
631
  std.xMotivoIsencao = 'RDC 238';
632
632
  std.vPMC = 102.22;
633
633
 
634
- nfe.tagmed(std);
634
+ nfe.tagmed(indexProd, std);
635
635
  ```
636
636
 
637
637
  ### 🔴 function tagarma(std)
@@ -642,14 +642,14 @@ Node com informações e detalhamento de Armamento do item da NFe
642
642
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
643
643
  ```javascript
644
644
  let std = new Object();
645
- std.item = 1; //item da NFe
645
+ let indexProd = 1; //item da NFe
646
646
  std.nAR; //Indicativo de número da arma
647
647
  std.tpArma;
648
648
  std.nSerie;
649
649
  std.nCano;
650
650
  std.descr;
651
651
 
652
- nfe.tagarma(std);
652
+ nfe.tagarma(indexProd, std);
653
653
  ```
654
654
 
655
655
  ### 🔴 function tagcomb(std)
@@ -660,7 +660,7 @@ Node das informações específicas para combustíveis líquidos e lubrificantes
660
660
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
661
661
  ```javascript
662
662
  let std = new Object();
663
- std.item = 1; //item da NFe
663
+ let indexProd = 1; //item da NFe
664
664
  std.cProdANP;
665
665
 
666
666
  std.pMixGN; //removido no layout 4.00
@@ -678,7 +678,7 @@ std.qBCProd;
678
678
  std.vAliqProd;
679
679
  std.vCIDE;
680
680
 
681
- nfe.tagcomb(std);
681
+ nfe.tagcomb(indexProd, std);
682
682
  ```
683
683
 
684
684
  ### 🔴 function tagencerrante(std)
@@ -690,7 +690,7 @@ Referente ao item da NFe
690
690
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
691
691
  ```javascript
692
692
  let std = new Object();
693
- std.item = 1; //item da NFe
693
+ let indexProd = 1; //item da NFe
694
694
  std.nBico;
695
695
  std.nBomba;
696
696
  std.nTanque;
@@ -699,7 +699,7 @@ std.vEncFin;
699
699
  std.pBio; //NT 2022.001 v1.10
700
700
 
701
701
 
702
- nfe.tagencerrante(std);
702
+ nfe.tagencerrante(indexProd, std);
703
703
  ```
704
704
 
705
705
  ### 🔴 function tagorigComb(std)
@@ -710,12 +710,12 @@ Parte do grupo encerrante, podem haver de 0 até 30 tags desse tipo
710
710
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
711
711
  ```javascript
712
712
  let std = new Object();
713
- std.item = 1; //item da NFe
713
+ let indexProd = 1; //item da NFe
714
714
  std.indImport= 0; //NT 2023.001 v1.00
715
715
  std.cUFOrig = 35; //NT 2023.001 v1.00
716
716
  std.Orig = 100; //NT 2023.001 v1.00
717
717
 
718
- nfe.tagOrigComb(std);
718
+ nfe.tagOrigComb(indexProd, std);
719
719
  ```
720
720
 
721
721
 
@@ -727,10 +727,10 @@ Node inicial dos Tributos incidentes no Produto ou Serviço do item da NFe
727
727
  | std | stcClass | contêm os dados dos campos, nomeados conforme manual |
728
728
  ```javascript
729
729
  let std = new Object();
730
- std.item = 1; //item da NFe
730
+ let indexProd = 1; //item da NFe
731
731
  std.vTotTrib = 1000.00;
732
732
 
733
- nfe.tagimposto(std);
733
+ nfe.tagimposto(indexProd, std);
734
734
  ```
735
735
 
736
736
  ### 🔴 function tagICMS(std)
@@ -742,7 +742,7 @@ Node com informações do ICMS do item da NFe
742
742
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
743
743
  ```javascript
744
744
  let std = new Object();
745
- std.item = 1; //item da NFe
745
+ let indexProd = 1; //item da NFe
746
746
  std.orig;
747
747
  std.CST;
748
748
  std.modBC;
@@ -792,7 +792,7 @@ std.vICMSMonoRet; //NT 2023.001-v1.10
792
792
  std.vICMSMonoDif; //NT 2023.001-v1.10
793
793
  std.cBenefRBC; //NT 2019.001 v1.61
794
794
  std.indDeduzDeson; //NT 2023.004 v1.00
795
- nfe.tagICMS(std);
795
+ nfe.tagICMS(indexProd, std);
796
796
  ```
797
797
 
798
798
  ### 🔴 function tagICMSPart(std)
@@ -803,7 +803,7 @@ Node com informações da partilha do ICMS entre a UF de origem e UF de destino
803
803
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
804
804
  ```javascript
805
805
  let std = new Object();
806
- std.item = 1; //item da NFe
806
+ let indexProd = 1; //item da NFe
807
807
  std.orig = 0;
808
808
  std.CST = '90';
809
809
  std.modBC = 0;
@@ -820,7 +820,7 @@ std.vICMSST = 140.00;
820
820
  std.pBCOp = 10.00;
821
821
  std.UFST = 'RJ';
822
822
 
823
- nfe.tagICMSPart(std);
823
+ nfe.tagICMSPart(indexProd, std);
824
824
  ```
825
825
 
826
826
  ### 🔴 function tagICMSST(std)
@@ -832,7 +832,7 @@ Node Repasse de ICMS ST retido anteriormente em operações interestaduais com r
832
832
  | std | stcClass | contêm os dados dos campos, nomeados conforme manual |
833
833
  ```javascript
834
834
  let std = new Object();
835
- std.item = 1; //item da NFe
835
+ let indexProd = 1; //item da NFe
836
836
  std.orig = 0;
837
837
  std.CST = '60';
838
838
  std.vBCSTRet = 1000.00;
@@ -849,7 +849,7 @@ std.vBCEfet = null;
849
849
  std.pICMSEfet = null;
850
850
  std.vICMSEfet = null;
851
851
 
852
- nfe.tagICMSST(std);
852
+ nfe.tagICMSST(indexProd, std);
853
853
  ```
854
854
 
855
855
  ### 🟢 function tagProdICMSSN(std)
@@ -861,7 +861,7 @@ Node referente Tributação ICMS pelo Simples Nacional do item da NFe
861
861
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
862
862
  ```javascript
863
863
  let std = new Object();
864
- std.item = 1; //item da NFe
864
+ let indexProd = 1; //item da NFe
865
865
  std.orig = 0;
866
866
  std.CSOSN = '101';
867
867
  std.pCredSN = 2.00;
@@ -892,7 +892,7 @@ std.pICMSEfet = null;
892
892
  std.vICMSEfet = null;
893
893
  std.vICMSSubstituto = null;
894
894
 
895
- nfe.tagICMSSN(std);
895
+ nfe.tagICMSSN(indexProd, std);
896
896
  ```
897
897
 
898
898
  ### 🔴 function tagICMSUFDest(std)
@@ -903,7 +903,7 @@ Node de informação do ICMS Interestadual do item na NFe
903
903
  | std | stcClass | contêm os dados dos campos, nomeados conforme manual |
904
904
  ```javascript
905
905
  let std = new Object();
906
- std.item = 1; //item da NFe
906
+ let indexProd = 1; //item da NFe
907
907
  std.vBCUFDest = 100.00;
908
908
  std.vBCFCPUFDest = 100.00;
909
909
  std.pFCPUFDest = 1.00;
@@ -914,7 +914,7 @@ std.vFCPUFDest = 1.00;
914
914
  std.vICMSUFDest = 14.44;
915
915
  std.vICMSUFRemet = 3.56;
916
916
 
917
- nfe.tagICMSUFDest(std);
917
+ nfe.tagICMSUFDest(indexProd, std);
918
918
  ```
919
919
 
920
920
  ### 🔴 function tagIPI(std)
@@ -927,7 +927,7 @@ Node referente ao IPI do item da NFe
927
927
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
928
928
  ```javascript
929
929
  let std = new Object();
930
- std.item = 1; //item da NFe
930
+ let indexProd = 1; //item da NFe
931
931
  std.clEnq = null;
932
932
  std.CNPJProd = null;
933
933
  std.cSelo = null;
@@ -940,7 +940,7 @@ std.pIPI = 15.00;
940
940
  std.qUnid = null;
941
941
  std.vUnid = null;
942
942
 
943
- nfe.tagIPI(std);
943
+ nfe.tagIPI(indexProd, std);
944
944
  ```
945
945
 
946
946
  ### 🔴 function tagII(std)
@@ -951,13 +951,13 @@ Node Imposto de Importação do item da NFe
951
951
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
952
952
  ```javascript
953
953
  let std = new Object();
954
- std.item = 1; //item da NFe
954
+ let indexProd = 1; //item da NFe
955
955
  std.vBC = 1000.00;
956
956
  std.vDespAdu = 100.00;
957
957
  std.vII = 220.00;
958
958
  std.vIOF = null;
959
959
 
960
- nfe.tagII(std);
960
+ nfe.tagII(indexProd, std);
961
961
  ```
962
962
 
963
963
  ### 🟢 function tagProdPIS(std)
@@ -968,7 +968,7 @@ Node PIS do item da NFe
968
968
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
969
969
  ```javascript
970
970
  let std = new Object();
971
- std.item = 1; //item da NFe
971
+ let indexProd = 1; //item da NFe
972
972
  std.CST = '07';
973
973
  std.vBC = null;
974
974
  std.pPIS = null;
@@ -976,7 +976,7 @@ std.vPIS = null;
976
976
  std.qBCProd = null;
977
977
  std.vAliqProd = null;
978
978
 
979
- nfe.tagPIS(std);
979
+ nfe.tagPIS(indexProd, std);
980
980
  ```
981
981
 
982
982
  ### 🔴 function tagPISST(std)
@@ -987,7 +987,7 @@ Node PIS Substituição Tributária do item da NFe
987
987
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
988
988
  ```javascript
989
989
  let std = new Object();
990
- std.item = 1; //item da NFe
990
+ let indexProd = 1; //item da NFe
991
991
  std.vPIS = 16.00;
992
992
  std.vBC = 1000.00
993
993
  std.pPIS = 1.60;
@@ -996,7 +996,7 @@ std.vAliqProd = null;
996
996
  std.indSomaPISST = 0; //0=Valor do PISST não compõe o valor total da NF-e
997
997
  //1=Valor do PISST compõe o valor total da NF-e
998
998
 
999
- nfe.tagPISST(std);
999
+ nfe.tagPISST(indexProd, std);
1000
1000
  ```
1001
1001
 
1002
1002
  ### 🟢 function tagProdCOFINS(std)
@@ -1007,7 +1007,7 @@ Node COFINS do item da NFe
1007
1007
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
1008
1008
  ```javascript
1009
1009
  let std = new Object();
1010
- std.item = 1; //item da NFe
1010
+ let indexProd = 1; //item da NFe
1011
1011
  std.CST = '07';
1012
1012
  std.vBC = null;
1013
1013
  std.pCOFINS = null;
@@ -1015,7 +1015,7 @@ std.vCOFINS = null;
1015
1015
  std.qBCProd = null;
1016
1016
  std.vAliqProd = null;
1017
1017
 
1018
- nfe.tagCOFINS(std);
1018
+ nfe.tagCOFINS(indexProd, std);
1019
1019
  ```
1020
1020
 
1021
1021
  ### 🔴 function tagCOFINSST(std)
@@ -1026,7 +1026,7 @@ Node COFINS Substituição Tributária do item da NFe
1026
1026
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
1027
1027
  ```javascript
1028
1028
  let std = new Object();
1029
- std.item = 1; //item da NFe
1029
+ let indexProd = 1; //item da NFe
1030
1030
  std.vCOFINS = 289.30;
1031
1031
  std.vBC = 2893.00;
1032
1032
  std.pCOFINS = 10.00;
@@ -1035,7 +1035,7 @@ std.vAliqProd = null;
1035
1035
  std.indSomaCOFINSST = 0; //0=Valor do COFINS ST não compõe o valor total da NF-e
1036
1036
  //1=Valor do COFINS ST compõe o valor total da NF-e
1037
1037
 
1038
- nfe.tagCOFINSST(std);
1038
+ nfe.tagCOFINSST(indexProd, std);
1039
1039
  ```
1040
1040
 
1041
1041
  ### 🔴 function tagISSQN(std)
@@ -1046,7 +1046,7 @@ Node ISSQN do item da NFe
1046
1046
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
1047
1047
  ```javascript
1048
1048
  let std = new Object();
1049
- std.item = 1; //item da NFe
1049
+ let indexProd = 1; //item da NFe
1050
1050
  std.vBC = 1000.00;
1051
1051
  std.vAliq = 5.00;
1052
1052
  std.vISSQN = 50.00;
@@ -1064,7 +1064,7 @@ std.cPais = '1058';
1064
1064
  std.nProcesso = null;
1065
1065
  std.indIncentivo = 2;
1066
1066
 
1067
- nfe.tagISSQN(std);
1067
+ nfe.tagISSQN(indexProd, std);
1068
1068
  ```
1069
1069
 
1070
1070
  ### 🔴 function tagimpostoDevol(std)
@@ -1077,11 +1077,11 @@ Node referente a informação do Imposto devolvido
1077
1077
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
1078
1078
  ```javascript
1079
1079
  let std = new Object();
1080
- std.item = 1; //item da NFe
1080
+ let indexProd = 1; //item da NFe
1081
1081
  std.pDevol = 2.00;
1082
1082
  std.vIPIDevol = 123.36;
1083
1083
 
1084
- nfe.tagimpostoDevol(std);
1084
+ nfe.tagimpostoDevol(indexProd, std);
1085
1085
  ```
1086
1086
 
1087
1087
  ### 🟢 function tagICMSTot(std)
@@ -1299,7 +1299,7 @@ Node com as informações dos volumes transportados
1299
1299
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
1300
1300
  ```javascript
1301
1301
  let std = new Object();
1302
- std.item = 1; //indicativo do numero do volume
1302
+ let indexProd = 1; //indicativo do numero do volume
1303
1303
  std.qVol = 2;
1304
1304
  std.esp = 'caixa';
1305
1305
  std.marca = 'OLX';
@@ -1307,7 +1307,7 @@ std.nVol = '11111';
1307
1307
  std.pesoL = 10.50;
1308
1308
  std.pesoB = 11.00;
1309
1309
 
1310
- nfe.tagvol(std);
1310
+ nfe.tagvol(indexProd, std);
1311
1311
  ```
1312
1312
 
1313
1313
  ### 🔴 function taglacres(std)
@@ -1318,10 +1318,10 @@ Node com a identificação dos lacres, referentes ao volume
1318
1318
  | std | Object | contêm os dados dos campos, nomeados conforme manual |
1319
1319
  ```javascript
1320
1320
  let std = new Object();
1321
- std.item = 1; //indicativo do numero do volume
1321
+ let indexProd = 1; //indicativo do numero do volume
1322
1322
  std.nLacre = 'ZZEX425365';
1323
1323
 
1324
- nfe.taglacres(std);
1324
+ nfe.taglacres(indexProd, std);
1325
1325
  ```
1326
1326
 
1327
1327
  ### 🔴 function tagfat(std)
@@ -0,0 +1,19 @@
1
+ import { Tools } from "../dist/index.js"
2
+ import fs from "fs";
3
+
4
+ let myTools = new Tools({ //Configuração de habiente e sistema
5
+ mod: '55',
6
+ tpAmb: 1,
7
+ UF: 'MT',
8
+ versao: "4.00",
9
+
10
+ //Optativo: Leia sobre Requisitos.
11
+ xmllint: `../libxml2-2.9.3-win32-x86_64/bin/xmllint.exe`
12
+ }, { //Certificado digital
13
+ pfx: '../certificado.pfx',
14
+ senha: fs.readFileSync('../senha.txt', { encoding: "utf8" }),
15
+ });
16
+
17
+ myTools.consultarNFe("CHAVE DA NFE").then(res => {
18
+ console.log(res);
19
+ })
package/exemplos/nfe.js CHANGED
@@ -4,7 +4,8 @@ import fs from "fs";
4
4
  let myTools = new Tools({ //Configuração de habiente e sistema
5
5
  mod: '55',
6
6
  tpAmb: 2,
7
- cUF: '51',
7
+ UF: 'MT',
8
+ versao: '4.00',
8
9
 
9
10
  //Optativo: Leia sobre Requisitos.
10
11
  xmllint: `../libxml2-2.9.3-win32-x86_64/bin/xmllint.exe`
@@ -151,12 +152,12 @@ NFe.tagTransp({ modFrete: 9 });
151
152
  NFe.tagDetPag([{ indPag: 0, tPag: 17, vPag: "1200.00" }]);
152
153
  NFe.tagTroco("0.00");
153
154
  NFe.tagInfRespTec({ CNPJ: "47506306000188", xContato: "Guara Dev", email: "admin@guaradev.com", fone: "5566999638922" })
154
- fs.writeFileSync("nfe.xml", NFe.xml(), { encoding: "utf-8" });
155
+ fs.writeFileSync("testes/nfe.xml", NFe.xml(), { encoding: "utf-8" });
155
156
 
156
157
  //NFe.xml() = retorna o XML gerado ate o momento.
157
158
  // myTools.xmlSign(..) = Assina o xml utlizando o certificado declarado em new Tools.
158
159
  myTools.xmlSign(NFe.xml()).then(async xmlSign => {
159
- fs.writeFileSync("nfe_sign.xml", xmlSign, { encoding: "utf-8" });
160
+ fs.writeFileSync("testes/nfe_sign.xml", xmlSign, { encoding: "utf-8" });
160
161
  myTools.sefazEnviaLote(xmlSign, { indSinc: 1 }).then(res => {
161
162
  console.log(res)
162
163
  })
@@ -4,7 +4,8 @@ import fs from "fs";
4
4
  let myTools = new Tools({ //Configuração de habiente e sistema
5
5
  mod: '65',
6
6
  tpAmb: 2,
7
- cUF: '51',
7
+ UF: 'MT',
8
+ versao: "4.00",
8
9
 
9
10
  //Optativo: Leia sobre Requisitos.
10
11
  xmllint: `../libxml2-2.9.3-win32-x86_64/bin/xmllint.exe`