node-sped-nfe 1.2.33 → 1.2.35

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.
@@ -3,7 +3,7 @@ declare class Make {
3
3
  formatData(dataUsr?: Date): string;
4
4
  tagInfNFe(obj: any): void;
5
5
  tagIde(obj: any): void;
6
- tagRefNFe(obj: any): void;
6
+ tagRefNFe(obj: string | string[]): void;
7
7
  tagRefNF(obj: any): void;
8
8
  tagRefNFP(obj: any): void;
9
9
  tagRefCTe(obj: any): void;
@@ -14,7 +14,7 @@ declare class Make {
14
14
  tagEnderDest(obj: any): 1 | undefined;
15
15
  tagRetirada(obj: any): void;
16
16
  tagAutXML(obj: any): void;
17
- tagProd(obj: any): void;
17
+ tagProd(obj: any): Promise<void>;
18
18
  tagCreditoPresumidoProd(obj: any): void;
19
19
  taginfAdProd(index: any, obj: any): void;
20
20
  tagCEST(obj: any): void;
@@ -62,11 +62,17 @@ class Make {
62
62
  __classPrivateFieldGet(this, _Make_NFe, "f").infNFe.ide[key] = obj[key];
63
63
  });
64
64
  }
65
+ //Referencimanto de NFe
65
66
  tagRefNFe(obj) {
66
67
  if (typeof __classPrivateFieldGet(this, _Make_NFe, "f").infNFe.ide.NFref == "undefined") {
67
68
  __classPrivateFieldGet(this, _Make_NFe, "f").infNFe.ide.NFref = new Array();
68
69
  }
69
- __classPrivateFieldGet(this, _Make_NFe, "f").infNFe.ide.NFref.push({ refNFe: obj });
70
+ if (Array.isArray(obj)) { //Array de referenciamento de refNFe
71
+ __classPrivateFieldGet(this, _Make_NFe, "f").infNFe.ide.NFref = obj.map(ref => ({ refNFe: `${ref}` }));
72
+ }
73
+ else { //String unica de refNFe
74
+ __classPrivateFieldGet(this, _Make_NFe, "f").infNFe.ide.NFref.push({ refNFe: obj });
75
+ }
70
76
  }
71
77
  tagRefNF(obj) {
72
78
  if (typeof __classPrivateFieldGet(this, _Make_NFe, "f").infNFe.ide.NFref == "undefined") {
@@ -138,7 +144,7 @@ class Make {
138
144
  __classPrivateFieldGet(this, _Make_NFe, "f").infNFe.autXML.push(obj);
139
145
  }
140
146
  //tagprod
141
- tagProd(obj) {
147
+ async tagProd(obj) {
142
148
  //Abrir tag de imposto
143
149
  for (let cont = 0; cont < obj.length; cont++) {
144
150
  if (obj[cont]['@nItem'] === undefined) {
@@ -296,7 +296,6 @@ class Tools {
296
296
  }
297
297
  // Ciência (210210), Confirmação (210200), Desconhecimento (210220) não precisam de campos extras
298
298
  const tempUF = urlEventos(cUF2UF[cOrgao], __classPrivateFieldGet(this, _Tools_config, "f").versao);
299
- console.log(cUF2UF);
300
299
  const evento = {
301
300
  "envEvento": {
302
301
  "@xmlns": "http://www.portalfiscal.inf.br/nfe",
@@ -336,7 +335,7 @@ class Tools {
336
335
  }
337
336
  });
338
337
  try {
339
- const req = https.request(tempUF[`mod${__classPrivateFieldGet(this, _Tools_config, "f").mod}`][(__classPrivateFieldGet(this, _Tools_config, "f").tpAmb == 1 ? "producao" : "homologacao")].NFeRecepcaoEvento, {
338
+ const req = https.request(tempUF[`mod${chNFe.substring(20, 22)}`][(__classPrivateFieldGet(this, _Tools_config, "f").tpAmb == 1 ? "producao" : "homologacao")].NFeRecepcaoEvento, {
340
339
  ...{
341
340
  method: 'POST',
342
341
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-sped-nfe",
3
- "version": "1.2.33",
3
+ "version": "1.2.35",
4
4
  "author": "Kalmon V. Tavares",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",