@alexssmusica/node-pdf-nfe 1.1.0 → 1.1.2
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.
- package/README.md +2 -2
- package/lib/application/helpers/generate-pdf/nfe/campo.js +15 -1
- package/lib/application/helpers/generate-pdf/nfe/cria-layout.js +143 -1
- package/lib/application/helpers/generate-pdf/nfe/default.js +26 -1
- package/lib/application/helpers/generate-pdf/nfe/gerar-itens.js +275 -1
- package/lib/application/helpers/generate-pdf/nfe/get-dados-adicionais.js +53 -1
- package/lib/application/helpers/generate-pdf/nfe/get-dados-emitente.js +309 -1
- package/lib/application/helpers/generate-pdf/nfe/get-destinatario-remetente.js +123 -1
- package/lib/application/helpers/generate-pdf/nfe/get-fatura-duplicata.js +64 -1
- package/lib/application/helpers/generate-pdf/nfe/get-homologacao.js +26 -1
- package/lib/application/helpers/generate-pdf/nfe/get-imposto.js +219 -1
- package/lib/application/helpers/generate-pdf/nfe/get-iss.js +63 -1
- package/lib/application/helpers/generate-pdf/nfe/get-menu-itens.js +199 -1
- package/lib/application/helpers/generate-pdf/nfe/get-recibo.js +102 -1
- package/lib/application/helpers/generate-pdf/nfe/get-transporte.js +143 -1
- package/lib/application/helpers/generate-pdf/nfe/italico.js +16 -1
- package/lib/application/helpers/generate-pdf/nfe/linha-horizontal-tracejada.js +8 -1
- package/lib/application/helpers/generate-pdf/nfe/linha-horizontal.js +16 -1
- package/lib/application/helpers/generate-pdf/nfe/linha-vertical.js +10 -1
- package/lib/application/helpers/generate-pdf/nfe/load-fontes.js +31 -1
- package/lib/application/helpers/generate-pdf/nfe/negrito.js +16 -1
- package/lib/application/helpers/generate-pdf/nfe/normal.js +16 -1
- package/lib/application/helpers/generate-pdf/nfe/options-doc.js +14 -1
- package/lib/application/helpers/generate-pdf/nfe/secao.js +17 -1
- package/lib/application/helpers/generate-pdf/nfe/titulo.js +17 -1
- package/lib/application/helpers/xml/deserialize.js +25 -1
- package/lib/application/helpers/xml/index.js +17 -1
- package/lib/domain/use-cases/pdf/index.js +26 -1
- package/lib/domain/use-cases/pdf/pdf-NFCe.js +688 -1
- package/lib/domain/use-cases/pdf/pdf-NFe.js +43 -1
- package/lib/domain/use-cases/utils/data-atual.js +12 -1
- package/lib/domain/use-cases/utils/index.js +18 -1
- package/lib/domain/use-cases/utils/intl-number-format.js +7 -1
- package/lib/index.js +5 -1
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/generate-pdf.js +2 -1
- package/lib/types/index.js +19 -1
- package/lib/types/nfe-proc.js +2 -1
- package/lib/types/schema.js +2 -1
- package/package.json +14 -15
package/README.md
CHANGED
|
@@ -4,10 +4,10 @@ Biblioteca para geração Danfe NF-e/NFC-e em aplicações node.js
|
|
|
4
4
|
## Instalação
|
|
5
5
|
Basta instalar através dos comandos
|
|
6
6
|
```bash
|
|
7
|
-
|
|
7
|
+
npm install @alexssmusica/node-pdf-nfe
|
|
8
8
|
```
|
|
9
9
|
```bash
|
|
10
|
-
|
|
10
|
+
yarn add @alexssmusica/node-pdf-nfe
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Exemplo
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.campo = void 0;
|
|
4
|
+
const default_1 = require("./default");
|
|
5
|
+
function campo({ ajusteX, ajusteY, doc, largura, margemEsquerda, margemTopo, value, x, y, alinhamento, tamanho }) {
|
|
6
|
+
doc
|
|
7
|
+
.font('negrito')
|
|
8
|
+
.fillColor(default_1.DEFAULT_NFE.corDoCampo)
|
|
9
|
+
.fontSize(tamanho ?? default_1.DEFAULT_NFE.tamanhoDaFonteDoCampo)
|
|
10
|
+
.text(value, margemEsquerda + ajusteX + x, margemTopo + ajusteY + y, {
|
|
11
|
+
width: largura,
|
|
12
|
+
align: alinhamento ?? default_1.DEFAULT_NFE.alinhamentoDoCampo
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
exports.campo = campo;
|
|
@@ -1 +1,143 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.criaLayout = void 0;
|
|
4
|
+
const default_1 = require("./default");
|
|
5
|
+
const get_dados_adicionais_1 = require("./get-dados-adicionais");
|
|
6
|
+
const get_dados_emitente_1 = require("./get-dados-emitente");
|
|
7
|
+
const get_destinatario_remetente_1 = require("./get-destinatario-remetente");
|
|
8
|
+
const get_fatura_duplicata_1 = require("./get-fatura-duplicata");
|
|
9
|
+
const get_homologacao_1 = require("./get-homologacao");
|
|
10
|
+
const get_imposto_1 = require("./get-imposto");
|
|
11
|
+
const get_iss_1 = require("./get-iss");
|
|
12
|
+
const get_menu_itens_1 = require("./get-menu-itens");
|
|
13
|
+
const get_recibo_1 = require("./get-recibo");
|
|
14
|
+
const get_transporte_1 = require("./get-transporte");
|
|
15
|
+
async function criaLayout({ pathLogo, nf, ajusteX, ajusteY, doc, margemEsquerda, margemTopo, larguraDoFormulario, margemDireita, folha }) {
|
|
16
|
+
const { dest, emit, ide, infAdic, total, transp, cobr } = nf.NFe.infNFe;
|
|
17
|
+
let y = 0;
|
|
18
|
+
const finalEspacoDet = folha === 0 ? default_1.DEFAULT_NFE.finalTamanhoDet1 : default_1.DEFAULT_NFE.finalTamanhoDetDemais;
|
|
19
|
+
if (ide.tpAmb === '2') {
|
|
20
|
+
(0, get_homologacao_1.getHomologacao)({
|
|
21
|
+
ajusteX,
|
|
22
|
+
ajusteY,
|
|
23
|
+
doc,
|
|
24
|
+
margemEsquerda,
|
|
25
|
+
margemTopo,
|
|
26
|
+
larguraDoFormulario,
|
|
27
|
+
protNFe: nf.protNFe
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (folha === 0) {
|
|
31
|
+
y = (0, get_recibo_1.getRecibo)({
|
|
32
|
+
y,
|
|
33
|
+
ajusteX,
|
|
34
|
+
ajusteY,
|
|
35
|
+
dest,
|
|
36
|
+
doc,
|
|
37
|
+
emit,
|
|
38
|
+
larguraDoFormulario,
|
|
39
|
+
margemDireita,
|
|
40
|
+
margemEsquerda,
|
|
41
|
+
margemTopo,
|
|
42
|
+
total,
|
|
43
|
+
ide
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
await (0, get_dados_emitente_1.getDadosEmitente)({
|
|
47
|
+
ajusteX,
|
|
48
|
+
ajusteY,
|
|
49
|
+
doc,
|
|
50
|
+
emit,
|
|
51
|
+
larguraDoFormulario,
|
|
52
|
+
margemDireita,
|
|
53
|
+
margemEsquerda,
|
|
54
|
+
margemTopo,
|
|
55
|
+
protNFe: nf.protNFe,
|
|
56
|
+
y,
|
|
57
|
+
pathLogo,
|
|
58
|
+
ide,
|
|
59
|
+
folha
|
|
60
|
+
});
|
|
61
|
+
y = (0, get_destinatario_remetente_1.getDestinatarioRemetente)({
|
|
62
|
+
ajusteX,
|
|
63
|
+
ajusteY,
|
|
64
|
+
dest,
|
|
65
|
+
doc,
|
|
66
|
+
larguraDoFormulario,
|
|
67
|
+
margemDireita,
|
|
68
|
+
margemEsquerda,
|
|
69
|
+
margemTopo,
|
|
70
|
+
y: doc.y,
|
|
71
|
+
ide
|
|
72
|
+
});
|
|
73
|
+
if (folha === 0) {
|
|
74
|
+
y = (0, get_fatura_duplicata_1.getFaturaDuplicata)({
|
|
75
|
+
ajusteX,
|
|
76
|
+
ajusteY,
|
|
77
|
+
doc,
|
|
78
|
+
larguraDoFormulario,
|
|
79
|
+
margemDireita,
|
|
80
|
+
margemEsquerda,
|
|
81
|
+
margemTopo,
|
|
82
|
+
cobr,
|
|
83
|
+
y
|
|
84
|
+
});
|
|
85
|
+
y = (0, get_imposto_1.getImposto)({
|
|
86
|
+
ajusteX,
|
|
87
|
+
ajusteY,
|
|
88
|
+
doc,
|
|
89
|
+
larguraDoFormulario,
|
|
90
|
+
margemDireita,
|
|
91
|
+
margemEsquerda,
|
|
92
|
+
margemTopo,
|
|
93
|
+
total,
|
|
94
|
+
y
|
|
95
|
+
});
|
|
96
|
+
y = (0, get_transporte_1.getTransporte)({
|
|
97
|
+
ajusteX,
|
|
98
|
+
ajusteY,
|
|
99
|
+
doc,
|
|
100
|
+
larguraDoFormulario,
|
|
101
|
+
margemDireita,
|
|
102
|
+
margemEsquerda,
|
|
103
|
+
margemTopo,
|
|
104
|
+
transp,
|
|
105
|
+
y
|
|
106
|
+
});
|
|
107
|
+
y = (0, get_iss_1.getIss)({
|
|
108
|
+
ajusteX,
|
|
109
|
+
ajusteY,
|
|
110
|
+
doc,
|
|
111
|
+
emit,
|
|
112
|
+
larguraDoFormulario,
|
|
113
|
+
margemDireita,
|
|
114
|
+
margemEsquerda,
|
|
115
|
+
margemTopo,
|
|
116
|
+
total,
|
|
117
|
+
y
|
|
118
|
+
});
|
|
119
|
+
(0, get_dados_adicionais_1.getDadosAdicionais)({
|
|
120
|
+
ajusteX,
|
|
121
|
+
ajusteY,
|
|
122
|
+
doc,
|
|
123
|
+
infAdic,
|
|
124
|
+
larguraDoFormulario,
|
|
125
|
+
margemDireita,
|
|
126
|
+
margemEsquerda,
|
|
127
|
+
margemTopo,
|
|
128
|
+
finalEspacoDet
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
y = (0, get_menu_itens_1.getMenuItens)({
|
|
132
|
+
ajusteX,
|
|
133
|
+
ajusteY,
|
|
134
|
+
doc,
|
|
135
|
+
margemEsquerda,
|
|
136
|
+
margemTopo,
|
|
137
|
+
y,
|
|
138
|
+
margemDireita,
|
|
139
|
+
finalEspacoDet,
|
|
140
|
+
larguraDoFormulario
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
exports.criaLayout = criaLayout;
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_NFE = void 0;
|
|
4
|
+
exports.DEFAULT_NFE = {
|
|
5
|
+
larguraDaPagina: 595.44,
|
|
6
|
+
alturaDaPagina: 841.68,
|
|
7
|
+
tamanhoDaFonteDoTitulo: 6,
|
|
8
|
+
corDoTitulo: 'black',
|
|
9
|
+
alinhamentoDoTitulo: 'left',
|
|
10
|
+
alinhamentoDoTituloDaTabela: 'center',
|
|
11
|
+
tamanhoDaFonteDaSecao: 7,
|
|
12
|
+
corDaSecao: 'black',
|
|
13
|
+
tamanhoDaFonteDoCampo: 9.5,
|
|
14
|
+
alinhamentoDoCampo: 'center',
|
|
15
|
+
corDoCampo: 'black',
|
|
16
|
+
tamanhoDaFonteDosItens: 7,
|
|
17
|
+
separadorDeItens: true,
|
|
18
|
+
ajusteYDoLogotipo: 0,
|
|
19
|
+
ajusteYDaIdentificacaoDoEmitente: 0,
|
|
20
|
+
opacidadeDaHomologacao: 0.4,
|
|
21
|
+
ajusteYDaHomologacao: 275,
|
|
22
|
+
tamanhoDoCodigoDeBarras: 32,
|
|
23
|
+
corDoLayout: 'black',
|
|
24
|
+
finalTamanhoDet1: 752,
|
|
25
|
+
finalTamanhoDetDemais: 822
|
|
26
|
+
};
|
|
@@ -1 +1,275 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gerarItens = void 0;
|
|
4
|
+
const utils_1 = require("../../../../domain/use-cases/utils");
|
|
5
|
+
const cria_layout_1 = require("./cria-layout");
|
|
6
|
+
const default_1 = require("./default");
|
|
7
|
+
const linha_horizontal_tracejada_1 = require("./linha-horizontal-tracejada");
|
|
8
|
+
const normal_1 = require("./normal");
|
|
9
|
+
const options_doc_1 = require("./options-doc");
|
|
10
|
+
async function gerarItens({ nf, ajusteX, ajusteY, doc, margemEsquerda, margemTopo, margemDireita, larguraDoFormulario, pathLogo }) {
|
|
11
|
+
let folha = 0;
|
|
12
|
+
await (0, cria_layout_1.criaLayout)({
|
|
13
|
+
ajusteX,
|
|
14
|
+
ajusteY,
|
|
15
|
+
nf,
|
|
16
|
+
doc,
|
|
17
|
+
larguraDoFormulario,
|
|
18
|
+
margemDireita,
|
|
19
|
+
margemEsquerda,
|
|
20
|
+
margemTopo,
|
|
21
|
+
pathLogo,
|
|
22
|
+
folha
|
|
23
|
+
});
|
|
24
|
+
let maiorY = doc.y;
|
|
25
|
+
for (let i = 0; i < nf.NFe.infNFe.det.length; i++) {
|
|
26
|
+
const item = nf.NFe.infNFe.det[i];
|
|
27
|
+
function renderizarLinha(pdf) {
|
|
28
|
+
const y = maiorY + 2;
|
|
29
|
+
(0, normal_1.normal)({
|
|
30
|
+
doc,
|
|
31
|
+
value: item.prod.cProd,
|
|
32
|
+
x: 1.5,
|
|
33
|
+
y,
|
|
34
|
+
largura: 51,
|
|
35
|
+
alinhamento: 'center',
|
|
36
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
37
|
+
ajusteX,
|
|
38
|
+
ajusteY,
|
|
39
|
+
margemEsquerda,
|
|
40
|
+
margemTopo
|
|
41
|
+
});
|
|
42
|
+
(0, normal_1.normal)({
|
|
43
|
+
doc,
|
|
44
|
+
value: item.prod.xProd,
|
|
45
|
+
x: 55.5,
|
|
46
|
+
y,
|
|
47
|
+
largura: 178,
|
|
48
|
+
alinhamento: 'justify',
|
|
49
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
50
|
+
ajusteX,
|
|
51
|
+
ajusteY,
|
|
52
|
+
margemEsquerda,
|
|
53
|
+
margemTopo
|
|
54
|
+
});
|
|
55
|
+
maiorY = Math.max(maiorY, pdf.y);
|
|
56
|
+
(0, normal_1.normal)({
|
|
57
|
+
doc,
|
|
58
|
+
value: item.prod.NCM,
|
|
59
|
+
x: 235.5,
|
|
60
|
+
y,
|
|
61
|
+
largura: 32.5,
|
|
62
|
+
alinhamento: 'center',
|
|
63
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
64
|
+
ajusteX,
|
|
65
|
+
ajusteY,
|
|
66
|
+
margemEsquerda,
|
|
67
|
+
margemTopo
|
|
68
|
+
});
|
|
69
|
+
maiorY = Math.max(maiorY, pdf.y);
|
|
70
|
+
(0, normal_1.normal)({
|
|
71
|
+
doc,
|
|
72
|
+
value: item.prod.CFOP,
|
|
73
|
+
x: 293.5,
|
|
74
|
+
y,
|
|
75
|
+
largura: 21,
|
|
76
|
+
alinhamento: 'center',
|
|
77
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
78
|
+
ajusteX,
|
|
79
|
+
ajusteY,
|
|
80
|
+
margemEsquerda,
|
|
81
|
+
margemTopo
|
|
82
|
+
});
|
|
83
|
+
maiorY = Math.max(maiorY, pdf.y);
|
|
84
|
+
(0, normal_1.normal)({
|
|
85
|
+
doc,
|
|
86
|
+
value: item.prod.uCom,
|
|
87
|
+
x: 315.5,
|
|
88
|
+
y,
|
|
89
|
+
largura: 16.5,
|
|
90
|
+
alinhamento: 'center',
|
|
91
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
92
|
+
ajusteX,
|
|
93
|
+
ajusteY,
|
|
94
|
+
margemEsquerda,
|
|
95
|
+
margemTopo
|
|
96
|
+
});
|
|
97
|
+
maiorY = Math.max(maiorY, pdf.y);
|
|
98
|
+
(0, normal_1.normal)({
|
|
99
|
+
doc,
|
|
100
|
+
value: (0, utils_1.formatMoney)(item.prod.qCom, 4),
|
|
101
|
+
x: 335,
|
|
102
|
+
y,
|
|
103
|
+
largura: 37,
|
|
104
|
+
alinhamento: 'center',
|
|
105
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
106
|
+
ajusteX,
|
|
107
|
+
ajusteY,
|
|
108
|
+
margemEsquerda,
|
|
109
|
+
margemTopo
|
|
110
|
+
});
|
|
111
|
+
maiorY = Math.max(maiorY, pdf.y);
|
|
112
|
+
(0, normal_1.normal)({
|
|
113
|
+
doc,
|
|
114
|
+
value: (0, utils_1.formatMoney)(item.prod.vUnCom, 2),
|
|
115
|
+
x: 375,
|
|
116
|
+
y,
|
|
117
|
+
largura: 32.5,
|
|
118
|
+
alinhamento: 'center',
|
|
119
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
120
|
+
ajusteX,
|
|
121
|
+
ajusteY,
|
|
122
|
+
margemEsquerda,
|
|
123
|
+
margemTopo
|
|
124
|
+
});
|
|
125
|
+
maiorY = Math.max(maiorY, pdf.y);
|
|
126
|
+
(0, normal_1.normal)({
|
|
127
|
+
doc,
|
|
128
|
+
value: (0, utils_1.formatMoney)(item.prod.vProd, 2),
|
|
129
|
+
x: 409.5,
|
|
130
|
+
y,
|
|
131
|
+
largura: 31,
|
|
132
|
+
alinhamento: 'center',
|
|
133
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
134
|
+
ajusteX,
|
|
135
|
+
ajusteY,
|
|
136
|
+
margemEsquerda,
|
|
137
|
+
margemTopo
|
|
138
|
+
});
|
|
139
|
+
maiorY = Math.max(maiorY, pdf.y);
|
|
140
|
+
const keys = Object.keys(item.imposto);
|
|
141
|
+
for (let i = 0; i < keys.length; i++) {
|
|
142
|
+
if (keys[i].includes('ICMS') && !keys[i].includes('UFDest')) {
|
|
143
|
+
const newKeys = Object.keys(item.imposto[keys[i]]);
|
|
144
|
+
(0, normal_1.normal)({
|
|
145
|
+
doc,
|
|
146
|
+
value: item.imposto[keys[i]][newKeys[0]].CST
|
|
147
|
+
? `${item.imposto[keys[i]][newKeys[0]].orig}${item.imposto[keys[i]][newKeys[0]].CST}`
|
|
148
|
+
: '',
|
|
149
|
+
x: 270,
|
|
150
|
+
y,
|
|
151
|
+
largura: 21,
|
|
152
|
+
alinhamento: 'center',
|
|
153
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
154
|
+
ajusteX,
|
|
155
|
+
ajusteY,
|
|
156
|
+
margemEsquerda,
|
|
157
|
+
margemTopo
|
|
158
|
+
});
|
|
159
|
+
(0, normal_1.normal)({
|
|
160
|
+
doc,
|
|
161
|
+
value: item.imposto[keys[i]][newKeys[0]].CSOSN
|
|
162
|
+
? `${item.imposto[keys[i]][newKeys[0]].orig}${item.imposto[keys[i]][newKeys[0]].CSOSN}`
|
|
163
|
+
: '',
|
|
164
|
+
x: 270,
|
|
165
|
+
y,
|
|
166
|
+
largura: 21,
|
|
167
|
+
alinhamento: 'center',
|
|
168
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
169
|
+
ajusteX,
|
|
170
|
+
ajusteY,
|
|
171
|
+
margemEsquerda,
|
|
172
|
+
margemTopo
|
|
173
|
+
});
|
|
174
|
+
maiorY = Math.max(maiorY, pdf.y);
|
|
175
|
+
(0, normal_1.normal)({
|
|
176
|
+
doc,
|
|
177
|
+
value: (0, utils_1.formatMoney)(item.imposto[keys[i]][newKeys[0]].vBC ?? 0, 2),
|
|
178
|
+
x: 443,
|
|
179
|
+
y,
|
|
180
|
+
largura: 32.5,
|
|
181
|
+
alinhamento: 'center',
|
|
182
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
183
|
+
ajusteX,
|
|
184
|
+
ajusteY,
|
|
185
|
+
margemEsquerda,
|
|
186
|
+
margemTopo
|
|
187
|
+
});
|
|
188
|
+
maiorY = Math.max(maiorY, pdf.y);
|
|
189
|
+
(0, normal_1.normal)({
|
|
190
|
+
doc,
|
|
191
|
+
value: (0, utils_1.formatMoney)(item.imposto[keys[i]][newKeys[0]].vICMS ?? 0, 2),
|
|
192
|
+
x: 476,
|
|
193
|
+
y,
|
|
194
|
+
largura: 32,
|
|
195
|
+
alinhamento: 'center',
|
|
196
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
197
|
+
ajusteX,
|
|
198
|
+
ajusteY,
|
|
199
|
+
margemEsquerda,
|
|
200
|
+
margemTopo
|
|
201
|
+
});
|
|
202
|
+
maiorY = Math.max(maiorY, pdf.y);
|
|
203
|
+
(0, normal_1.normal)({
|
|
204
|
+
doc,
|
|
205
|
+
value: (0, utils_1.formatMoney)(item.imposto[keys[i]][newKeys[0]].pICMS ?? 0, 2),
|
|
206
|
+
x: 532,
|
|
207
|
+
y: y + 0.65,
|
|
208
|
+
largura: 28,
|
|
209
|
+
alinhamento: 'center',
|
|
210
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
211
|
+
ajusteX,
|
|
212
|
+
ajusteY,
|
|
213
|
+
margemEsquerda,
|
|
214
|
+
margemTopo
|
|
215
|
+
});
|
|
216
|
+
maiorY = Math.max(maiorY, pdf.y);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
(0, normal_1.normal)({
|
|
220
|
+
doc,
|
|
221
|
+
value: (0, utils_1.formatMoney)(item.imposto.IPI?.IPITrib?.vIPI ?? 0, 2),
|
|
222
|
+
x: 507.5,
|
|
223
|
+
y,
|
|
224
|
+
largura: 26,
|
|
225
|
+
alinhamento: 'center',
|
|
226
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
227
|
+
ajusteX,
|
|
228
|
+
ajusteY,
|
|
229
|
+
margemEsquerda,
|
|
230
|
+
margemTopo
|
|
231
|
+
});
|
|
232
|
+
maiorY = Math.max(maiorY, pdf.y);
|
|
233
|
+
(0, normal_1.normal)({
|
|
234
|
+
doc,
|
|
235
|
+
value: (0, utils_1.formatMoney)(item.imposto.IPI?.IPITrib?.pIPI ?? 0, 2),
|
|
236
|
+
x: 557.75,
|
|
237
|
+
y,
|
|
238
|
+
largura: 29,
|
|
239
|
+
alinhamento: 'center',
|
|
240
|
+
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDosItens,
|
|
241
|
+
ajusteX,
|
|
242
|
+
ajusteY,
|
|
243
|
+
margemEsquerda,
|
|
244
|
+
margemTopo
|
|
245
|
+
});
|
|
246
|
+
maiorY = Math.max(maiorY, pdf.y);
|
|
247
|
+
return Number(maiorY) + (default_1.DEFAULT_NFE.separadorDeItens !== undefined ? 2 : 0);
|
|
248
|
+
}
|
|
249
|
+
maiorY = renderizarLinha(doc);
|
|
250
|
+
if (doc.y > (folha === 0 ? default_1.DEFAULT_NFE.finalTamanhoDet1 - 26 : 800)) {
|
|
251
|
+
doc.addPage(options_doc_1.optionsDocNFe);
|
|
252
|
+
doc.y = 0;
|
|
253
|
+
folha++;
|
|
254
|
+
await (0, cria_layout_1.criaLayout)({
|
|
255
|
+
ajusteX,
|
|
256
|
+
ajusteY,
|
|
257
|
+
nf,
|
|
258
|
+
doc,
|
|
259
|
+
larguraDoFormulario,
|
|
260
|
+
margemDireita,
|
|
261
|
+
margemEsquerda,
|
|
262
|
+
margemTopo,
|
|
263
|
+
pathLogo,
|
|
264
|
+
folha
|
|
265
|
+
});
|
|
266
|
+
maiorY = doc.y;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
if (default_1.DEFAULT_NFE.separadorDeItens !== undefined) {
|
|
270
|
+
(0, linha_horizontal_tracejada_1.linhaHorizontalTracejada)({ x1: 0, x2: 0, y: maiorY - 1, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
exports.gerarItens = gerarItens;
|
|
@@ -1 +1,53 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDadosAdicionais = void 0;
|
|
4
|
+
const linha_horizontal_1 = require("./linha-horizontal");
|
|
5
|
+
const linha_vertical_1 = require("./linha-vertical");
|
|
6
|
+
const normal_1 = require("./normal");
|
|
7
|
+
const secao_1 = require("./secao");
|
|
8
|
+
const titulo_1 = require("./titulo");
|
|
9
|
+
function getDadosAdicionais({ doc, ajusteX, ajusteY, margemEsquerda, margemTopo, margemDireita, larguraDoFormulario, infAdic, finalEspacoDet }) {
|
|
10
|
+
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: finalEspacoDet + 8, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
11
|
+
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: 821.8, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
12
|
+
(0, linha_vertical_1.linhaVertical)({ y1: finalEspacoDet + 8, y2: 821.8, x: 0, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
13
|
+
(0, linha_vertical_1.linhaVertical)({ y1: finalEspacoDet + 8, y2: 821.8, x: 388.25, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
14
|
+
(0, linha_vertical_1.linhaVertical)({ y1: finalEspacoDet + 8, y2: 821.8, x: larguraDoFormulario, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
15
|
+
(0, secao_1.secao)({ doc, value: 'DADOS ADICIONAIS', x: 1.5, y: finalEspacoDet, largura: 0, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
16
|
+
(0, titulo_1.titulo)({
|
|
17
|
+
value: 'INFORMAÇÕES COMPLEMENTARES',
|
|
18
|
+
x: 1.5,
|
|
19
|
+
y: finalEspacoDet + 10,
|
|
20
|
+
largura: 385.5,
|
|
21
|
+
ajusteX,
|
|
22
|
+
ajusteY,
|
|
23
|
+
doc,
|
|
24
|
+
margemEsquerda,
|
|
25
|
+
margemTopo
|
|
26
|
+
});
|
|
27
|
+
(0, titulo_1.titulo)({
|
|
28
|
+
value: 'RESERVADO AO FISCO',
|
|
29
|
+
x: 390,
|
|
30
|
+
y: finalEspacoDet + 10,
|
|
31
|
+
largura: 195,
|
|
32
|
+
ajusteX,
|
|
33
|
+
ajusteY,
|
|
34
|
+
doc,
|
|
35
|
+
margemEsquerda,
|
|
36
|
+
margemTopo
|
|
37
|
+
});
|
|
38
|
+
const informacoesComplementares = [infAdic.infCpl];
|
|
39
|
+
(0, normal_1.normal)({
|
|
40
|
+
doc,
|
|
41
|
+
value: informacoesComplementares.join(' - '),
|
|
42
|
+
x: 1,
|
|
43
|
+
y: finalEspacoDet + 17.5,
|
|
44
|
+
largura: 386,
|
|
45
|
+
alinhamento: 'justify',
|
|
46
|
+
tamanho: 6,
|
|
47
|
+
ajusteX,
|
|
48
|
+
ajusteY,
|
|
49
|
+
margemEsquerda,
|
|
50
|
+
margemTopo
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
exports.getDadosAdicionais = getDadosAdicionais;
|