@alexssmusica/node-pdf-nfe 1.0.57 → 1.0.58

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.
@@ -36,7 +36,8 @@ async function criaLayout({ pathLogo, nf, ajusteX, ajusteY, doc, margemEsquerda,
36
36
  protNFe: nf.protNFe,
37
37
  y,
38
38
  pathLogo,
39
- ide
39
+ ide,
40
+ folha
40
41
  });
41
42
  y = (0, get_destinatario_remetente_1.getDestinatarioRemetente)({
42
43
  ajusteX,
@@ -31,12 +31,12 @@ async function gerarItens({ nf, ajusteX, ajusteY, doc, margemEsquerda, margemTop
31
31
  maiorY = Math.max(maiorY, pdf.y);
32
32
  const keys = Object.keys(item.imposto);
33
33
  for (let i = 0; i < keys.length; i++) {
34
- if (keys[i].includes('ICMS')) {
34
+ if (keys[i].includes('ICMS') && !keys[i].includes('UFDest')) {
35
35
  const newKeys = Object.keys(item.imposto[keys[i]]);
36
36
  (0, normal_1.normal)({ doc, value: item.imposto[keys[i]][newKeys[0]].CST ? `${item.imposto[keys[i]][newKeys[0]].orig}${item.imposto[keys[i]][newKeys[0]].CST}` : '', x: 270, y, largura: 21, alinhamento: 'center', tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens, ajusteX, ajusteY, margemEsquerda, margemTopo });
37
37
  (0, normal_1.normal)({ doc, value: item.imposto[keys[i]][newKeys[0]].CSOSN ? `${item.imposto[keys[i]][newKeys[0]].orig}${item.imposto[keys[i]][newKeys[0]].CSOSN}` : '', x: 270, y, largura: 21, alinhamento: 'center', tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens, ajusteX, ajusteY, margemEsquerda, margemTopo });
38
38
  maiorY = Math.max(maiorY, pdf.y);
39
- (0, normal_1.normal)({ doc, value: item.imposto[keys[i]][newKeys[0]].vBc ?? Intl.NumberFormat('pt-BR', { minimumFractionDigits: 2 }).format(Number(0)), x: 443, y, largura: 32.5, alinhamento: 'center', tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens, ajusteX, ajusteY, margemEsquerda, margemTopo });
39
+ (0, normal_1.normal)({ doc, value: item.imposto[keys[i]][newKeys[0]].vBC ?? Intl.NumberFormat('pt-BR', { minimumFractionDigits: 2 }).format(Number(0)), x: 443, y, largura: 32.5, alinhamento: 'center', tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens, ajusteX, ajusteY, margemEsquerda, margemTopo });
40
40
  maiorY = Math.max(maiorY, pdf.y);
41
41
  (0, normal_1.normal)({ doc, value: item.imposto[keys[i]][newKeys[0]].vICMS ?? Intl.NumberFormat('pt-BR', { minimumFractionDigits: 2 }).format(Number(0)), x: 476, y, largura: 32, alinhamento: 'center', tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens, ajusteX, ajusteY, margemEsquerda, margemTopo });
42
42
  maiorY = Math.max(maiorY, pdf.y);
@@ -14,7 +14,7 @@ const campo_1 = require("./campo");
14
14
  const negrito_1 = require("./negrito");
15
15
  const default_1 = require("./default");
16
16
  const italico_1 = require("./italico");
17
- async function getDadosEmitente({ y, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo, larguraDoFormulario, emit, protNFe, pathLogo, ide }) {
17
+ async function getDadosEmitente({ y, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo, larguraDoFormulario, emit, protNFe, pathLogo, ide, folha }) {
18
18
  (0, linha_horizontal_1.linhaHorizontal)({ x1: 317, x2: -254.7, y: y + 53.1, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
19
19
  (0, linha_horizontal_1.linhaHorizontal)({ x1: 317, x2: -254.7, y: y + 72.9, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
20
20
  (0, linha_vertical_1.linhaVertical)({ y1: y + 53.1, y2: y + 72.9, x: 317.4, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
@@ -38,9 +38,16 @@ async function getDadosEmitente({ y, doc, ajusteX, ajusteY, margemDireita, marge
38
38
  const identificacaoDoEmitenteLargura = pathLogo !== undefined ? 172 : 237;
39
39
  const identificacaoDoEmitenteFonte = pathLogo !== undefined ? 0 : 1.5;
40
40
  if (pathLogo !== undefined) {
41
- doc.image(pathLogo, margemEsquerda + ajusteX + 4.5, margemTopo + ajusteY + default_1.DEFAULT_NFE.ajusteYDoLogotipo + 78, {
42
- fit: [60, 60]
43
- });
41
+ if (folha === 0) {
42
+ doc.image(pathLogo, margemEsquerda + ajusteX + 4.5, margemTopo + ajusteY + default_1.DEFAULT_NFE.ajusteYDoLogotipo + 78 , {
43
+ fit: [60, 60]
44
+ });
45
+ }else{
46
+ doc.image(pathLogo, margemEsquerda + ajusteX + 4.5, margemTopo + ajusteY + default_1.DEFAULT_NFE.ajusteYDoLogotipo + 33 , {
47
+ fit: [60, 60]
48
+ });
49
+ }
50
+
44
51
  }
45
52
  (0, negrito_1.negrito)({ doc, value: emit.xNome, x: identificacaoDoEmitenteX, y: identificacaoDoEmitenteY + default_1.DEFAULT_NFE.ajusteYDaIdentificacaoDoEmitente, largura: identificacaoDoEmitenteLargura, alinhamento: 'center', tamanho: 8 + identificacaoDoEmitenteFonte, ajusteX, ajusteY, margemEsquerda, margemTopo });
46
53
  (0, normal_1.normal)({ doc, value: `${emit.enderEmit.xLgr}, ${emit.enderEmit.nro} ${emit.enderEmit.xCpl ?? ''}`, x: identificacaoDoEmitenteX, y: doc.y - margemTopo + 2, largura: identificacaoDoEmitenteLargura, alinhamento: 'center', tamanho: 6 + identificacaoDoEmitenteFonte, ajusteX, ajusteY, margemEsquerda, margemTopo });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexssmusica/node-pdf-nfe",
3
- "version": "1.0.57",
3
+ "version": "1.0.58",
4
4
  "description": "Modulo que auxilia na geração de NFe e NFCe",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",