@alexssmusica/node-pdf-nfe 1.0.62 → 1.1.0
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 +22 -21
- package/lib/application/helpers/generate-pdf/nfe/campo.js +1 -15
- package/lib/application/helpers/generate-pdf/nfe/cria-layout.js +1 -144
- package/lib/application/helpers/generate-pdf/nfe/default.js +1 -27
- package/lib/application/helpers/generate-pdf/nfe/gerar-itens.js +1 -276
- package/lib/application/helpers/generate-pdf/nfe/get-dados-adicionais.js +1 -54
- package/lib/application/helpers/generate-pdf/nfe/get-dados-emitente.js +1 -310
- package/lib/application/helpers/generate-pdf/nfe/get-destinatario-remetente.js +1 -124
- package/lib/application/helpers/generate-pdf/nfe/get-fatura-duplicata.js +1 -62
- package/lib/application/helpers/generate-pdf/nfe/get-homologacao.js +1 -25
- package/lib/application/helpers/generate-pdf/nfe/get-imposto.js +1 -220
- package/lib/application/helpers/generate-pdf/nfe/get-iss.js +1 -64
- package/lib/application/helpers/generate-pdf/nfe/get-menu-itens.js +1 -200
- package/lib/application/helpers/generate-pdf/nfe/get-recibo.js +1 -103
- package/lib/application/helpers/generate-pdf/nfe/get-transporte.js +1 -144
- package/lib/application/helpers/generate-pdf/nfe/italico.js +1 -16
- package/lib/application/helpers/generate-pdf/nfe/linha-horizontal-tracejada.js +1 -9
- package/lib/application/helpers/generate-pdf/nfe/linha-horizontal.js +1 -17
- package/lib/application/helpers/generate-pdf/nfe/linha-vertical.js +1 -11
- package/lib/application/helpers/generate-pdf/nfe/load-fontes.js +1 -32
- package/lib/application/helpers/generate-pdf/nfe/negrito.js +1 -16
- package/lib/application/helpers/generate-pdf/nfe/normal.js +1 -16
- package/lib/application/helpers/generate-pdf/nfe/options-doc.js +1 -15
- package/lib/application/helpers/generate-pdf/nfe/secao.js +1 -17
- package/lib/application/helpers/generate-pdf/nfe/titulo.js +1 -17
- package/lib/application/helpers/xml/deserialize.js +1 -26
- package/lib/application/helpers/xml/index.js +1 -18
- package/lib/domain/use-cases/pdf/index.js +1 -27
- package/lib/domain/use-cases/pdf/pdf-NFCe.js +1 -689
- package/lib/domain/use-cases/pdf/pdf-NFe.js +1 -44
- package/lib/domain/use-cases/utils/data-atual.js +1 -13
- package/lib/domain/use-cases/utils/index.js +1 -19
- package/lib/domain/use-cases/utils/intl-number-format.js +1 -8
- package/lib/index.js +1 -6
- package/lib/types/generate-pdf.d.ts +244 -0
- package/lib/types/generate-pdf.js +1 -0
- package/lib/types/index.d.ts +0 -1
- package/lib/types/index.js +1 -21
- package/lib/types/nfe-proc.d.ts +42 -0
- package/lib/types/nfe-proc.js +1 -0
- package/lib/types/schema.d.ts +875 -0
- package/lib/types/schema.js +1 -0
- package/package.json +62 -57
- package/lib/application/helpers/generate-pdf/nfe/campo.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/cria-layout.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/default.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/gerar-itens.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/get-dados-adicionais.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/get-dados-emitente.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/get-destinatario-remetente.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/get-fatura-duplicata.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/get-homologacao.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/get-imposto.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/get-iss.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/get-menu-itens.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/get-recibo.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/get-transporte.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/italico.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/linha-horizontal-tracejada.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/linha-horizontal.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/linha-vertical.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/load-fontes.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/negrito.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/normal.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/options-doc.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/secao.js.map +0 -1
- package/lib/application/helpers/generate-pdf/nfe/titulo.js.map +0 -1
- package/lib/application/helpers/xml/deserialize.js.map +0 -1
- package/lib/application/helpers/xml/index.js.map +0 -1
- package/lib/domain/use-cases/pdf/index.js.map +0 -1
- package/lib/domain/use-cases/pdf/pdf-NFCe.js.map +0 -1
- package/lib/domain/use-cases/pdf/pdf-NFe.js.map +0 -1
- package/lib/domain/use-cases/utils/data-atual.js.map +0 -1
- package/lib/domain/use-cases/utils/index.js.map +0 -1
- package/lib/domain/use-cases/utils/intl-number-format.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/types/index.js.map +0 -1
|
@@ -1,310 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getDadosEmitente = void 0;
|
|
7
|
-
const bwip_js_1 = __importDefault(require("bwip-js"));
|
|
8
|
-
const date_fns_1 = require("date-fns");
|
|
9
|
-
const campo_1 = require("./campo");
|
|
10
|
-
const default_1 = require("./default");
|
|
11
|
-
const italico_1 = require("./italico");
|
|
12
|
-
const linha_horizontal_1 = require("./linha-horizontal");
|
|
13
|
-
const linha_vertical_1 = require("./linha-vertical");
|
|
14
|
-
const negrito_1 = require("./negrito");
|
|
15
|
-
const normal_1 = require("./normal");
|
|
16
|
-
const titulo_1 = require("./titulo");
|
|
17
|
-
async function getDadosEmitente({ y, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo, larguraDoFormulario, emit, protNFe, pathLogo, ide, folha }) {
|
|
18
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 317, x2: -254.7, y: y + 53.1, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
19
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 317, x2: -254.7, y: y + 72.9, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
20
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 53.1, y2: y + 72.9, x: 317.4, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
21
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 53.1, y2: y + 72.9, x: 331.55, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
22
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 15.25, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
23
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 340.05, x2: 0, y: y + 60.5, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
24
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 340.05, x2: 0, y: y + 83.1, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
25
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 105.9, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
26
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 125.7, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
27
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 145.7, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
28
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 15.25, y2: y + 145.7, x: 0, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
29
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 15.25, y2: y + 105.7, x: 240.75, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
30
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 15.25, y2: y + 125.7, x: 340.05, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
31
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 15.25, y2: y + 145.7, x: larguraDoFormulario, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
32
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 125.7, y2: y + 145.7, x: 195.55, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
33
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 125.7, y2: y + 145.7, x: 391, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
34
|
-
(0, titulo_1.titulo)({
|
|
35
|
-
value: 'DANFE',
|
|
36
|
-
x: 266.5,
|
|
37
|
-
y: y + 19.2,
|
|
38
|
-
largura: 197,
|
|
39
|
-
alinhamento: 'left',
|
|
40
|
-
tamanho: 14,
|
|
41
|
-
ajusteX,
|
|
42
|
-
ajusteY,
|
|
43
|
-
doc,
|
|
44
|
-
margemEsquerda,
|
|
45
|
-
margemTopo
|
|
46
|
-
});
|
|
47
|
-
(0, italico_1.italico)({
|
|
48
|
-
doc,
|
|
49
|
-
value: 'IDENTIFICAÇÃO DO EMITENTE',
|
|
50
|
-
x: 1,
|
|
51
|
-
y: y + 15.7,
|
|
52
|
-
largura: 238,
|
|
53
|
-
alinhamento: 'center',
|
|
54
|
-
tamanho: 10,
|
|
55
|
-
ajusteX,
|
|
56
|
-
ajusteY,
|
|
57
|
-
margemEsquerda,
|
|
58
|
-
margemTopo
|
|
59
|
-
});
|
|
60
|
-
const identificacaoDoEmitenteY = pathLogo !== undefined ? y + 33.7 : y + 39.7;
|
|
61
|
-
const identificacaoDoEmitenteX = pathLogo !== undefined ? 67 : 1.5;
|
|
62
|
-
const identificacaoDoEmitenteLargura = pathLogo !== undefined ? 172 : 237;
|
|
63
|
-
const identificacaoDoEmitenteFonte = pathLogo !== undefined ? 0 : 1.5;
|
|
64
|
-
if (pathLogo !== undefined) {
|
|
65
|
-
if (folha === 0) {
|
|
66
|
-
doc.image(pathLogo, margemEsquerda + ajusteX + 4.5, margemTopo + ajusteY + default_1.DEFAULT_NFE.ajusteYDoLogotipo + 78, {
|
|
67
|
-
fit: [60, 60]
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
doc.image(pathLogo, margemEsquerda + ajusteX + 4.5, margemTopo + ajusteY + default_1.DEFAULT_NFE.ajusteYDoLogotipo + 33, {
|
|
72
|
-
fit: [60, 60]
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
(0, negrito_1.negrito)({
|
|
77
|
-
doc,
|
|
78
|
-
value: emit.xNome,
|
|
79
|
-
x: identificacaoDoEmitenteX,
|
|
80
|
-
y: identificacaoDoEmitenteY + default_1.DEFAULT_NFE.ajusteYDaIdentificacaoDoEmitente,
|
|
81
|
-
largura: identificacaoDoEmitenteLargura,
|
|
82
|
-
alinhamento: 'center',
|
|
83
|
-
tamanho: 8 + identificacaoDoEmitenteFonte,
|
|
84
|
-
ajusteX,
|
|
85
|
-
ajusteY,
|
|
86
|
-
margemEsquerda,
|
|
87
|
-
margemTopo
|
|
88
|
-
});
|
|
89
|
-
(0, normal_1.normal)({
|
|
90
|
-
doc,
|
|
91
|
-
value: `${emit.enderEmit.xLgr}, ${emit.enderEmit.nro} ${emit.enderEmit.xCpl ?? ''}`,
|
|
92
|
-
x: identificacaoDoEmitenteX,
|
|
93
|
-
y: doc.y - margemTopo + 2,
|
|
94
|
-
largura: identificacaoDoEmitenteLargura,
|
|
95
|
-
alinhamento: 'center',
|
|
96
|
-
tamanho: 6 + identificacaoDoEmitenteFonte,
|
|
97
|
-
ajusteX,
|
|
98
|
-
ajusteY,
|
|
99
|
-
margemEsquerda,
|
|
100
|
-
margemTopo
|
|
101
|
-
});
|
|
102
|
-
(0, normal_1.normal)({
|
|
103
|
-
doc,
|
|
104
|
-
value: `${emit.enderEmit.xBairro}. ${emit.enderEmit.xMun}-${emit.enderEmit.UF}`,
|
|
105
|
-
x: identificacaoDoEmitenteX,
|
|
106
|
-
y: doc.y - margemTopo,
|
|
107
|
-
largura: identificacaoDoEmitenteLargura,
|
|
108
|
-
alinhamento: 'center',
|
|
109
|
-
tamanho: 6 + identificacaoDoEmitenteFonte,
|
|
110
|
-
ajusteX,
|
|
111
|
-
ajusteY,
|
|
112
|
-
margemEsquerda,
|
|
113
|
-
margemTopo
|
|
114
|
-
});
|
|
115
|
-
if (emit.fone !== undefined) {
|
|
116
|
-
(0, normal_1.normal)({
|
|
117
|
-
doc,
|
|
118
|
-
value: 'Telefone: ' + emit.fone,
|
|
119
|
-
x: identificacaoDoEmitenteX,
|
|
120
|
-
y: doc.y - margemTopo + 2,
|
|
121
|
-
largura: identificacaoDoEmitenteLargura,
|
|
122
|
-
alinhamento: 'center',
|
|
123
|
-
tamanho: 6 + identificacaoDoEmitenteFonte,
|
|
124
|
-
ajusteX,
|
|
125
|
-
ajusteY,
|
|
126
|
-
margemEsquerda,
|
|
127
|
-
margemTopo
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
(0, normal_1.normal)({
|
|
131
|
-
doc,
|
|
132
|
-
value: 'Documento Auxiliar da Nota Fiscal Eletrônica',
|
|
133
|
-
x: 241.5,
|
|
134
|
-
y: y + 32.7,
|
|
135
|
-
largura: 99.5,
|
|
136
|
-
alinhamento: 'center',
|
|
137
|
-
tamanho: 10,
|
|
138
|
-
ajusteX,
|
|
139
|
-
ajusteY,
|
|
140
|
-
margemEsquerda,
|
|
141
|
-
margemTopo
|
|
142
|
-
});
|
|
143
|
-
(0, normal_1.normal)({
|
|
144
|
-
doc,
|
|
145
|
-
value: '0 - ENTRADA',
|
|
146
|
-
x: 248,
|
|
147
|
-
y: y + 55.7,
|
|
148
|
-
largura: 99.5,
|
|
149
|
-
alinhamento: 'left',
|
|
150
|
-
ajusteX,
|
|
151
|
-
ajusteY,
|
|
152
|
-
margemEsquerda,
|
|
153
|
-
margemTopo
|
|
154
|
-
});
|
|
155
|
-
(0, normal_1.normal)({
|
|
156
|
-
doc,
|
|
157
|
-
value: '1 - SAÍDA',
|
|
158
|
-
x: 248,
|
|
159
|
-
y: y + 64.2,
|
|
160
|
-
largura: 99.5,
|
|
161
|
-
alinhamento: 'left',
|
|
162
|
-
ajusteX,
|
|
163
|
-
ajusteY,
|
|
164
|
-
margemEsquerda,
|
|
165
|
-
margemTopo
|
|
166
|
-
});
|
|
167
|
-
(0, normal_1.normal)({
|
|
168
|
-
doc,
|
|
169
|
-
value: ide.tpNF,
|
|
170
|
-
x: 317.5,
|
|
171
|
-
y: y + 52.5,
|
|
172
|
-
largura: 14.5,
|
|
173
|
-
alinhamento: 'center',
|
|
174
|
-
tamanho: 18,
|
|
175
|
-
ajusteX,
|
|
176
|
-
ajusteY,
|
|
177
|
-
margemEsquerda,
|
|
178
|
-
margemTopo
|
|
179
|
-
});
|
|
180
|
-
(0, normal_1.normal)({
|
|
181
|
-
doc,
|
|
182
|
-
value: 'Consulta de autenticidade no portal nacional da NF-e',
|
|
183
|
-
x: 340.5,
|
|
184
|
-
y: y + 85.7,
|
|
185
|
-
largura: 244,
|
|
186
|
-
ajusteX,
|
|
187
|
-
ajusteY,
|
|
188
|
-
margemEsquerda,
|
|
189
|
-
margemTopo
|
|
190
|
-
});
|
|
191
|
-
(0, normal_1.normal)({
|
|
192
|
-
doc,
|
|
193
|
-
value: 'www.nfe.fazenda.gov.br/portal ou no site da Sefaz Autorizadora',
|
|
194
|
-
x: 340.5,
|
|
195
|
-
y: y + 93.7,
|
|
196
|
-
largura: 244,
|
|
197
|
-
ajusteX,
|
|
198
|
-
ajusteY,
|
|
199
|
-
margemEsquerda,
|
|
200
|
-
margemTopo
|
|
201
|
-
});
|
|
202
|
-
(0, normal_1.normal)({
|
|
203
|
-
doc,
|
|
204
|
-
value: 'Nº. ' + ide.nNF.padStart(9, '0').replace(/(\d{3})(\d{3})(\d{3})/, '$1.$2.$3'),
|
|
205
|
-
x: 241.2,
|
|
206
|
-
y: y + 75.2,
|
|
207
|
-
largura: 98.5,
|
|
208
|
-
alinhamento: 'center',
|
|
209
|
-
tamanho: 10,
|
|
210
|
-
ajusteX,
|
|
211
|
-
ajusteY,
|
|
212
|
-
margemEsquerda,
|
|
213
|
-
margemTopo
|
|
214
|
-
});
|
|
215
|
-
(0, normal_1.normal)({
|
|
216
|
-
doc,
|
|
217
|
-
value: 'Série ' + ide.serie,
|
|
218
|
-
x: 241.2,
|
|
219
|
-
y: y + 85.2,
|
|
220
|
-
largura: 98.5,
|
|
221
|
-
alinhamento: 'center',
|
|
222
|
-
tamanho: 10,
|
|
223
|
-
ajusteX,
|
|
224
|
-
ajusteY,
|
|
225
|
-
margemEsquerda,
|
|
226
|
-
margemTopo
|
|
227
|
-
});
|
|
228
|
-
const options = {
|
|
229
|
-
bcid: 'code128',
|
|
230
|
-
text: protNFe.infProt.chNFe,
|
|
231
|
-
height: 15,
|
|
232
|
-
width: 130
|
|
233
|
-
};
|
|
234
|
-
const barcodeCep = await bwip_js_1.default.toBuffer(options);
|
|
235
|
-
doc.image(barcodeCep, 350, y + 22.7, { fit: [230, 50] });
|
|
236
|
-
(0, titulo_1.titulo)({ value: 'CHAVE DE ACESSO', x: 341.5, y: y + 61.2, largura: 244, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
237
|
-
(0, campo_1.campo)({
|
|
238
|
-
value: protNFe.infProt.chNFe.replace(/(.{4})(?=.)/g, '$1 '),
|
|
239
|
-
x: 341.5,
|
|
240
|
-
y: y + 67.7,
|
|
241
|
-
largura: 244,
|
|
242
|
-
ajusteX,
|
|
243
|
-
ajusteY,
|
|
244
|
-
doc,
|
|
245
|
-
margemEsquerda,
|
|
246
|
-
margemTopo
|
|
247
|
-
});
|
|
248
|
-
(0, titulo_1.titulo)({
|
|
249
|
-
value: 'PROTOCOLO DE AUTORIZAÇÃO DE USO',
|
|
250
|
-
x: 341.5,
|
|
251
|
-
y: y + 106.7,
|
|
252
|
-
largura: 244,
|
|
253
|
-
ajusteX,
|
|
254
|
-
ajusteY,
|
|
255
|
-
doc,
|
|
256
|
-
margemEsquerda,
|
|
257
|
-
margemTopo
|
|
258
|
-
});
|
|
259
|
-
(0, campo_1.campo)({
|
|
260
|
-
value: `${protNFe.infProt.nProt.replace(/(.{3})(?=.)/g, '$1 ')} - ${(0, date_fns_1.format)((0, date_fns_1.parseISO)(protNFe.infProt.dhRecbto), 'dd/MM/yyyy HH:mm:ss')}`,
|
|
261
|
-
x: 341.5,
|
|
262
|
-
y: y + 114.1,
|
|
263
|
-
largura: 244,
|
|
264
|
-
ajusteX,
|
|
265
|
-
ajusteY,
|
|
266
|
-
doc,
|
|
267
|
-
margemEsquerda,
|
|
268
|
-
margemTopo
|
|
269
|
-
});
|
|
270
|
-
(0, titulo_1.titulo)({ value: 'NATUREZA DA OPERAÇÃO', x: 1.5, y: y + 106.7, largura: 338, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
271
|
-
(0, campo_1.campo)({ value: ide.natOp, x: 1.5, y: y + 114.1, largura: 338, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
272
|
-
(0, titulo_1.titulo)({ value: 'INSCRIÇÃO ESTADUAL', x: 1.5, y: y + 126.7, largura: 192.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
273
|
-
(0, campo_1.campo)({
|
|
274
|
-
value: emit.IE.replace(/(\d{3})(\d{3})(\d{3})(\d{3})/, '$1.$2.$3.$4'),
|
|
275
|
-
x: 1.5,
|
|
276
|
-
y: y + 134.1,
|
|
277
|
-
largura: 192.5,
|
|
278
|
-
ajusteX,
|
|
279
|
-
ajusteY,
|
|
280
|
-
doc,
|
|
281
|
-
margemEsquerda,
|
|
282
|
-
margemTopo
|
|
283
|
-
});
|
|
284
|
-
(0, titulo_1.titulo)({
|
|
285
|
-
value: 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.',
|
|
286
|
-
x: 197,
|
|
287
|
-
y: y + 126.7,
|
|
288
|
-
largura: 192.5,
|
|
289
|
-
ajusteX,
|
|
290
|
-
ajusteY,
|
|
291
|
-
doc,
|
|
292
|
-
margemEsquerda,
|
|
293
|
-
margemTopo
|
|
294
|
-
});
|
|
295
|
-
(0, campo_1.campo)({ value: emit.iEST ?? '', x: 197, y: y + 134.1, largura: 192.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
296
|
-
(0, titulo_1.titulo)({ value: 'CNPJ', x: 392.5, y: y + 126.7, largura: 192.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
297
|
-
(0, campo_1.campo)({
|
|
298
|
-
value: emit.CNPJ?.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/, '$1.$2.$3/$4-$5') ?? '',
|
|
299
|
-
x: 392.5,
|
|
300
|
-
y: y + 134.1,
|
|
301
|
-
largura: 192.5,
|
|
302
|
-
ajusteX,
|
|
303
|
-
ajusteY,
|
|
304
|
-
doc,
|
|
305
|
-
margemEsquerda,
|
|
306
|
-
margemTopo
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
exports.getDadosEmitente = getDadosEmitente;
|
|
310
|
-
//# sourceMappingURL=get-dados-emitente.js.map
|
|
1
|
+
"use strict";var __importDefault=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDadosEmitente=void 0;const bwip_js_1=__importDefault(require("bwip-js")),date_fns_1=require("date-fns"),campo_1=require("./campo"),default_1=require("./default"),italico_1=require("./italico"),linha_horizontal_1=require("./linha-horizontal"),linha_vertical_1=require("./linha-vertical"),negrito_1=require("./negrito"),normal_1=require("./normal"),titulo_1=require("./titulo");async function getDadosEmitente({y:a,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g,larguraDoFormulario:h,emit:i,protNFe:j,pathLogo:k,ide:l,folha:m}){(0,linha_horizontal_1.linhaHorizontal)({x1:317,x2:-254.7,y:a+53.1,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_horizontal_1.linhaHorizontal)({x1:317,x2:-254.7,y:a+72.9,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+53.1,y2:a+72.9,x:317.4,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+53.1,y2:a+72.9,x:331.55,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_horizontal_1.linhaHorizontal)({x1:0,x2:0,y:a+15.25,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_horizontal_1.linhaHorizontal)({x1:340.05,x2:0,y:a+60.5,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_horizontal_1.linhaHorizontal)({x1:340.05,x2:0,y:a+83.1,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_horizontal_1.linhaHorizontal)({x1:0,x2:0,y:a+105.9,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_horizontal_1.linhaHorizontal)({x1:0,x2:0,y:a+125.7,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_horizontal_1.linhaHorizontal)({x1:0,x2:0,y:a+145.7,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+15.25,y2:a+145.7,x:0,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+15.25,y2:a+105.7,x:240.75,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+15.25,y2:a+125.7,x:340.05,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+15.25,y2:a+145.7,x:h,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+125.7,y2:a+145.7,x:195.55,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+125.7,y2:a+145.7,x:391,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"DANFE",x:266.5,y:a+19.2,largura:197,alinhamento:"left",tamanho:14,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,italico_1.italico)({doc:b,value:"IDENTIFICA\xC7\xC3O DO EMITENTE",x:1,y:a+15.7,largura:238,alinhamento:"center",tamanho:10,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g});const n=k===void 0?a+39.7:a+33.7,o=k===void 0?1.5:67,p=k===void 0?237:172,q=k===void 0?1.5:0;k!==void 0&&(0===m?b.image(k,f+c+4.5,g+d+default_1.DEFAULT_NFE.ajusteYDoLogotipo+78,{fit:[60,60]}):b.image(k,f+c+4.5,g+d+default_1.DEFAULT_NFE.ajusteYDoLogotipo+33,{fit:[60,60]})),(0,negrito_1.negrito)({doc:b,value:i.xNome,x:o,y:n+default_1.DEFAULT_NFE.ajusteYDaIdentificacaoDoEmitente,largura:p,alinhamento:"center",tamanho:8+q,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,normal_1.normal)({doc:b,value:`${i.enderEmit.xLgr}, ${i.enderEmit.nro} ${i.enderEmit.xCpl??""}`,x:o,y:b.y-g+2,largura:p,alinhamento:"center",tamanho:6+q,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,normal_1.normal)({doc:b,value:`${i.enderEmit.xBairro}. ${i.enderEmit.xMun}-${i.enderEmit.UF}`,x:o,y:b.y-g,largura:p,alinhamento:"center",tamanho:6+q,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),i.fone!==void 0&&(0,normal_1.normal)({doc:b,value:"Telefone: "+i.fone,x:o,y:b.y-g+2,largura:p,alinhamento:"center",tamanho:6+q,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,normal_1.normal)({doc:b,value:"Documento Auxiliar da Nota Fiscal Eletr\xF4nica",x:241.5,y:a+32.7,largura:99.5,alinhamento:"center",tamanho:10,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,normal_1.normal)({doc:b,value:"0 - ENTRADA",x:248,y:a+55.7,largura:99.5,alinhamento:"left",ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,normal_1.normal)({doc:b,value:"1 - SA\xCDDA",x:248,y:a+64.2,largura:99.5,alinhamento:"left",ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,normal_1.normal)({doc:b,value:l.tpNF,x:317.5,y:a+52.5,largura:14.5,alinhamento:"center",tamanho:18,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,normal_1.normal)({doc:b,value:"Consulta de autenticidade no portal nacional da NF-e",x:340.5,y:a+85.7,largura:244,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,normal_1.normal)({doc:b,value:"www.nfe.fazenda.gov.br/portal ou no site da Sefaz Autorizadora",x:340.5,y:a+93.7,largura:244,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,normal_1.normal)({doc:b,value:"N\xBA. "+l.nNF.padStart(9,"0").replace(/(\d{3})(\d{3})(\d{3})/,"$1.$2.$3"),x:241.2,y:a+75.2,largura:98.5,alinhamento:"center",tamanho:10,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,normal_1.normal)({doc:b,value:"S\xE9rie "+l.serie,x:241.2,y:a+85.2,largura:98.5,alinhamento:"center",tamanho:10,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g});const r={bcid:"code128",text:j.infProt.chNFe,height:15,width:130},s=await bwip_js_1.default.toBuffer(r);b.image(s,350,a+22.7,{fit:[230,50]}),(0,titulo_1.titulo)({value:"CHAVE DE ACESSO",x:341.5,y:a+61.2,largura:244,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:j.infProt.chNFe.replace(/(.{4})(?=.)/g,"$1 "),x:341.5,y:a+67.7,largura:244,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"PROTOCOLO DE AUTORIZA\xC7\xC3O DE USO",x:341.5,y:a+106.7,largura:244,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:`${j.infProt.nProt.replace(/(.{3})(?=.)/g,"$1 ")} - ${(0,date_fns_1.format)((0,date_fns_1.parseISO)(j.infProt.dhRecbto),"dd/MM/yyyy HH:mm:ss")}`,x:341.5,y:a+114.1,largura:244,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"NATUREZA DA OPERA\xC7\xC3O",x:1.5,y:a+106.7,largura:338,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:l.natOp,x:1.5,y:a+114.1,largura:338,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"INSCRI\xC7\xC3O ESTADUAL",x:1.5,y:a+126.7,largura:192.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.IE.replace(/(\d{3})(\d{3})(\d{3})(\d{3})/,"$1.$2.$3.$4"),x:1.5,y:a+134.1,largura:192.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"INSCRI\xC7\xC3O ESTADUAL DO SUBST. TRIBUT.",x:197,y:a+126.7,largura:192.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.iEST??"",x:197,y:a+134.1,largura:192.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"CNPJ",x:392.5,y:a+126.7,largura:192.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.CNPJ?.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/,"$1.$2.$3/$4-$5")??"",x:392.5,y:a+134.1,largura:192.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g})}exports.getDadosEmitente=getDadosEmitente;
|
|
@@ -1,124 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDestinatarioRemetente = void 0;
|
|
4
|
-
const date_fns_1 = require("date-fns");
|
|
5
|
-
const campo_1 = require("./campo");
|
|
6
|
-
const default_1 = require("./default");
|
|
7
|
-
const linha_horizontal_1 = require("./linha-horizontal");
|
|
8
|
-
const linha_vertical_1 = require("./linha-vertical");
|
|
9
|
-
const secao_1 = require("./secao");
|
|
10
|
-
const titulo_1 = require("./titulo");
|
|
11
|
-
function getDestinatarioRemetente({ y, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo, larguraDoFormulario, dest, ide }) {
|
|
12
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 9, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
13
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 29, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
14
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 49, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
15
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 69, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
16
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 9.2, y2: y + 69, x: 0, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
17
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 9.2, y2: y + 29, x: 357.1, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
18
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 29.2, y2: y + 69, x: 274.9, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
19
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 49.2, y2: y + 69, x: 297.6, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
20
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 29.2, y2: y + 69, x: 396.75, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
21
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 9.2, y2: y + 69, x: 493.1, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
22
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 9.2, y2: y + 69, x: larguraDoFormulario, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
23
|
-
(0, secao_1.secao)({ doc, value: 'DESTINATÁRIO / REMETENTE', x: 1.5, y: y + 0.9, largura: 0, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
24
|
-
(0, titulo_1.titulo)({ value: 'NOME / RAZÃO SOCIAL', x: 1.5, y: y + 11, largura: 353.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
25
|
-
(0, campo_1.campo)({ value: dest.xNome, x: 1.5, y: y + 18, largura: 353.5, alinhamento: 'left', ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
26
|
-
(0, titulo_1.titulo)({ value: 'CNPJ / CPF', x: 358, y: y + 11, largura: 133.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
27
|
-
(0, campo_1.campo)({
|
|
28
|
-
value: dest.CPF?.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/, '$1.$2.$3-$4') ?? '',
|
|
29
|
-
x: 358,
|
|
30
|
-
y: y + 18,
|
|
31
|
-
largura: 133.5,
|
|
32
|
-
ajusteX,
|
|
33
|
-
ajusteY,
|
|
34
|
-
doc,
|
|
35
|
-
margemEsquerda,
|
|
36
|
-
margemTopo
|
|
37
|
-
});
|
|
38
|
-
(0, campo_1.campo)({
|
|
39
|
-
value: dest.CNPJ?.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/, '$1.$2.$3/$4-$5') ?? '',
|
|
40
|
-
x: 358,
|
|
41
|
-
y: y + 18,
|
|
42
|
-
largura: 133.5,
|
|
43
|
-
ajusteX,
|
|
44
|
-
ajusteY,
|
|
45
|
-
doc,
|
|
46
|
-
margemEsquerda,
|
|
47
|
-
margemTopo
|
|
48
|
-
});
|
|
49
|
-
(0, titulo_1.titulo)({ value: 'DATA DA EMISSÃO', x: 495, y: y + 11, largura: 90, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
50
|
-
(0, campo_1.campo)({
|
|
51
|
-
value: (0, date_fns_1.format)((0, date_fns_1.parseISO)(ide.dhEmi), 'dd/MM/yyyy HH:mm:ss'),
|
|
52
|
-
x: 495,
|
|
53
|
-
y: y + 18,
|
|
54
|
-
largura: 90,
|
|
55
|
-
ajusteX,
|
|
56
|
-
ajusteY,
|
|
57
|
-
doc,
|
|
58
|
-
margemEsquerda,
|
|
59
|
-
margemTopo
|
|
60
|
-
});
|
|
61
|
-
(0, titulo_1.titulo)({ value: 'ENDEREÇO', x: 1.5, y: y + 30, largura: 272, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
62
|
-
(0, campo_1.campo)({
|
|
63
|
-
value: dest.enderDest?.xLgr && dest.enderDest?.nro ? `${dest.enderDest.xLgr}, ${dest.enderDest.nro}` : dest.enderDest?.xLgr ?? '',
|
|
64
|
-
x: 1.5,
|
|
65
|
-
y: y + 38,
|
|
66
|
-
largura: 272,
|
|
67
|
-
alinhamento: 'left',
|
|
68
|
-
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDoCampo - 0.5,
|
|
69
|
-
ajusteX,
|
|
70
|
-
ajusteY,
|
|
71
|
-
doc,
|
|
72
|
-
margemEsquerda,
|
|
73
|
-
margemTopo
|
|
74
|
-
});
|
|
75
|
-
(0, titulo_1.titulo)({ value: 'BAIRRO / DISTRITO', x: 276, y: y + 30, largura: 192, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
76
|
-
(0, campo_1.campo)({ value: dest.enderDest?.xBairro ?? '', x: 276, y: y + 38, largura: 119, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
77
|
-
(0, titulo_1.titulo)({ value: 'CEP', x: 398, y: y + 30, largura: 93, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
78
|
-
(0, campo_1.campo)({ value: dest.enderDest?.CEP ?? '', x: 398, y: y + 38, largura: 93, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
79
|
-
(0, titulo_1.titulo)({ value: 'DATA DA SAÍDA', x: 495, y: y + 30, largura: 90, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
80
|
-
(0, campo_1.campo)({
|
|
81
|
-
value: ide.dhSaiEnt !== undefined ? (0, date_fns_1.format)((0, date_fns_1.parseISO)(ide.dhSaiEnt), 'dd/MM/yyyy HH:mm:ss') : '',
|
|
82
|
-
x: 495,
|
|
83
|
-
y: y + 38,
|
|
84
|
-
largura: 90,
|
|
85
|
-
ajusteX,
|
|
86
|
-
ajusteY,
|
|
87
|
-
doc,
|
|
88
|
-
margemEsquerda,
|
|
89
|
-
margemTopo
|
|
90
|
-
});
|
|
91
|
-
(0, titulo_1.titulo)({ value: 'MUNICÍPIO', x: 1.5, y: y + 51, largura: 272, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
92
|
-
(0, campo_1.campo)({
|
|
93
|
-
value: dest.enderDest?.xMun ?? '',
|
|
94
|
-
x: 1.5,
|
|
95
|
-
y: y + 58,
|
|
96
|
-
largura: 272,
|
|
97
|
-
alinhamento: 'left',
|
|
98
|
-
ajusteX,
|
|
99
|
-
ajusteY,
|
|
100
|
-
doc,
|
|
101
|
-
margemEsquerda,
|
|
102
|
-
margemTopo
|
|
103
|
-
});
|
|
104
|
-
(0, titulo_1.titulo)({ value: 'UF', x: 276, y: y + 51, largura: 20, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
105
|
-
(0, campo_1.campo)({ value: dest.enderDest?.UF ?? '', x: 276, y: y + 58, largura: 20, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
106
|
-
(0, titulo_1.titulo)({ value: 'FONE / FAX', x: 299, y: y + 51, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
107
|
-
(0, campo_1.campo)({ value: dest.enderDest?.fone ?? '', x: 299, y: y + 58, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
108
|
-
(0, titulo_1.titulo)({ value: 'INSCRIÇÃO ESTADUAL', x: 398, y: y + 51, largura: 93, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
109
|
-
(0, campo_1.campo)({
|
|
110
|
-
value: dest?.IE?.replace(/(\d{3})(\d{3})(\d{3})(\d{3})/, '$1.$2.$3.$4') ?? '',
|
|
111
|
-
x: 398,
|
|
112
|
-
y: y + 58,
|
|
113
|
-
largura: 93,
|
|
114
|
-
ajusteX,
|
|
115
|
-
ajusteY,
|
|
116
|
-
doc,
|
|
117
|
-
margemEsquerda,
|
|
118
|
-
margemTopo
|
|
119
|
-
});
|
|
120
|
-
(0, titulo_1.titulo)({ value: 'HORA DA SAÍDA', x: 495, y: y + 51, largura: 90, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
121
|
-
return doc.y;
|
|
122
|
-
}
|
|
123
|
-
exports.getDestinatarioRemetente = getDestinatarioRemetente;
|
|
124
|
-
//# sourceMappingURL=get-destinatario-remetente.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDestinatarioRemetente=void 0;const date_fns_1=require("date-fns"),campo_1=require("./campo"),default_1=require("./default"),linha_horizontal_1=require("./linha-horizontal"),linha_vertical_1=require("./linha-vertical"),secao_1=require("./secao"),titulo_1=require("./titulo");function getDestinatarioRemetente({y:a,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g,larguraDoFormulario:h,dest:i,ide:j}){return(0,linha_horizontal_1.linhaHorizontal)({x1:0,x2:0,y:a+9,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_horizontal_1.linhaHorizontal)({x1:0,x2:0,y:a+29,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_horizontal_1.linhaHorizontal)({x1:0,x2:0,y:a+49,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_horizontal_1.linhaHorizontal)({x1:0,x2:0,y:a+69,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+9.2,y2:a+69,x:0,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+9.2,y2:a+29,x:357.1,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+29.2,y2:a+69,x:274.9,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+49.2,y2:a+69,x:297.6,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+29.2,y2:a+69,x:396.75,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+9.2,y2:a+69,x:493.1,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+9.2,y2:a+69,x:h,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,secao_1.secao)({doc:b,value:"DESTINAT\xC1RIO / REMETENTE",x:1.5,y:a+.9,largura:0,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"NOME / RAZ\xC3O SOCIAL",x:1.5,y:a+11,largura:353.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.xNome,x:1.5,y:a+18,largura:353.5,alinhamento:"left",ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"CNPJ / CPF",x:358,y:a+11,largura:133.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.CPF?.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/,"$1.$2.$3-$4")??"",x:358,y:a+18,largura:133.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.CNPJ?.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/,"$1.$2.$3/$4-$5")??"",x:358,y:a+18,largura:133.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"DATA DA EMISS\xC3O",x:495,y:a+11,largura:90,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:(0,date_fns_1.format)((0,date_fns_1.parseISO)(j.dhEmi),"dd/MM/yyyy HH:mm:ss"),x:495,y:a+18,largura:90,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"ENDERE\xC7O",x:1.5,y:a+30,largura:272,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.enderDest?.xLgr&&i.enderDest?.nro?`${i.enderDest.xLgr}, ${i.enderDest.nro}`:i.enderDest?.xLgr??"",x:1.5,y:a+38,largura:272,alinhamento:"left",tamanho:default_1.DEFAULT_NFE.tamanhoDaFonteDoCampo-.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"BAIRRO / DISTRITO",x:276,y:a+30,largura:192,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.enderDest?.xBairro??"",x:276,y:a+38,largura:119,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"CEP",x:398,y:a+30,largura:93,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.enderDest?.CEP??"",x:398,y:a+38,largura:93,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"DATA DA SA\xCDDA",x:495,y:a+30,largura:90,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:void 0===j.dhSaiEnt?"":(0,date_fns_1.format)((0,date_fns_1.parseISO)(j.dhSaiEnt),"dd/MM/yyyy HH:mm:ss"),x:495,y:a+38,largura:90,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"MUNIC\xCDPIO",x:1.5,y:a+51,largura:272,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.enderDest?.xMun??"",x:1.5,y:a+58,largura:272,alinhamento:"left",ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"UF",x:276,y:a+51,largura:20,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.enderDest?.UF??"",x:276,y:a+58,largura:20,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"FONE / FAX",x:299,y:a+51,largura:96,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.enderDest?.fone??"",x:299,y:a+58,largura:96,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"INSCRI\xC7\xC3O ESTADUAL",x:398,y:a+51,largura:93,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i?.IE?.replace(/(\d{3})(\d{3})(\d{3})(\d{3})/,"$1.$2.$3.$4")??"",x:398,y:a+58,largura:93,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"HORA DA SA\xCDDA",x:495,y:a+51,largura:90,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),b.y}exports.getDestinatarioRemetente=getDestinatarioRemetente;
|
|
@@ -1,62 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFaturaDuplicata = void 0;
|
|
4
|
-
const date_fns_1 = require("date-fns");
|
|
5
|
-
const utils_1 = require("../../../../domain/use-cases/utils");
|
|
6
|
-
const default_1 = require("./default");
|
|
7
|
-
const linha_horizontal_1 = require("./linha-horizontal");
|
|
8
|
-
const linha_vertical_1 = require("./linha-vertical");
|
|
9
|
-
const secao_1 = require("./secao");
|
|
10
|
-
function getFaturaDuplicata({ y, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo, larguraDoFormulario, cobr }) {
|
|
11
|
-
if (cobr !== undefined && Object.keys(cobr).length > 0) {
|
|
12
|
-
(0, secao_1.secao)({ doc, value: 'FATURA / DUPLICATA', x: 1.5, y: y + 12, largura: 0, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
13
|
-
if (cobr.fat !== undefined) {
|
|
14
|
-
doc.font('negrito')
|
|
15
|
-
.fillColor(default_1.DEFAULT_NFE.corDoTitulo)
|
|
16
|
-
.fontSize(8)
|
|
17
|
-
.text('Número da Fatura:', 5, y + 24, {
|
|
18
|
-
width: larguraDoFormulario - 5,
|
|
19
|
-
align: 'justify',
|
|
20
|
-
lineGap: -1.5,
|
|
21
|
-
continued: true
|
|
22
|
-
})
|
|
23
|
-
.font('normal')
|
|
24
|
-
.text(cobr.fat.nFat, { continued: true })
|
|
25
|
-
.font('negrito')
|
|
26
|
-
.text(' Valor Original:', { continued: true })
|
|
27
|
-
.font('normal')
|
|
28
|
-
.text(` ${(0, utils_1.formatMoney)(cobr.fat.vOrig, 2)}`, { continued: true })
|
|
29
|
-
.font('negrito')
|
|
30
|
-
.text(' Valor Desconto:', { continued: true })
|
|
31
|
-
.font('normal')
|
|
32
|
-
.text(` ${(0, utils_1.formatMoney)(cobr.fat.vDesc, 2)}`, { continued: true })
|
|
33
|
-
.font('negrito')
|
|
34
|
-
.text(' Valor Líquido:', { continued: true })
|
|
35
|
-
.font('normal')
|
|
36
|
-
.text(` ${(0, utils_1.formatMoney)(cobr.fat.vLiq, 2)}.`, { continued: true });
|
|
37
|
-
}
|
|
38
|
-
if (cobr.dup !== undefined) {
|
|
39
|
-
cobr.dup.forEach((dup, index) => {
|
|
40
|
-
doc.font('negrito').text(' Duplicata:', { continued: true }).font('normal').text(` ${dup.nDup}`, { continued: true });
|
|
41
|
-
doc.font('negrito')
|
|
42
|
-
.text(' Valor:', { continued: true })
|
|
43
|
-
.font('normal')
|
|
44
|
-
.text(` ${(0, utils_1.formatMoney)(dup.vDup, 2)}`, { continued: true });
|
|
45
|
-
doc.font('negrito')
|
|
46
|
-
.text(' Vencimento:', { continued: true })
|
|
47
|
-
.font('normal')
|
|
48
|
-
.text(` ${(0, date_fns_1.format)((0, date_fns_1.parseISO)(dup.dVenc), 'dd/MM/yyyy')}`, { continued: true });
|
|
49
|
-
if (index === cobr.dup.length - 1) {
|
|
50
|
-
doc.text('');
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 20, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
55
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: doc.y + 6, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
56
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 20, y2: doc.y + 6, x: 0, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
57
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 20, y2: doc.y + 6, x: larguraDoFormulario, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
58
|
-
}
|
|
59
|
-
return doc.y;
|
|
60
|
-
}
|
|
61
|
-
exports.getFaturaDuplicata = getFaturaDuplicata;
|
|
62
|
-
//# sourceMappingURL=get-fatura-duplicata.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getFaturaDuplicata=void 0;const date_fns_1=require("date-fns"),utils_1=require("../../../../domain/use-cases/utils"),default_1=require("./default"),linha_horizontal_1=require("./linha-horizontal"),linha_vertical_1=require("./linha-vertical"),secao_1=require("./secao");function getFaturaDuplicata({y:a,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g,larguraDoFormulario:h,cobr:i}){return void 0!==i&&0<Object.keys(i).length&&((0,secao_1.secao)({doc:b,value:"FATURA / DUPLICATA",x:1.5,y:a+12,largura:0,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),void 0!==i.fat&&b.font("negrito").fillColor(default_1.DEFAULT_NFE.corDoTitulo).fontSize(8).text("N\xFAmero da Fatura:",5,a+24,{width:h-5,align:"justify",lineGap:-1.5,continued:!0}).font("normal").text(i.fat.nFat,{continued:!0}).font("negrito").text(" Valor Original:",{continued:!0}).font("normal").text(` ${(0,utils_1.formatMoney)(i.fat.vOrig,2)}`,{continued:!0}).font("negrito").text(" Valor Desconto:",{continued:!0}).font("normal").text(` ${(0,utils_1.formatMoney)(i.fat.vDesc,2)}`,{continued:!0}).font("negrito").text(" Valor L\xEDquido:",{continued:!0}).font("normal").text(` ${(0,utils_1.formatMoney)(i.fat.vLiq,2)}.`,{continued:!0}),void 0!==i.dup&&i.dup.forEach((a,c)=>{b.font("negrito").text(" Duplicata:",{continued:!0}).font("normal").text(` ${a.nDup}`,{continued:!0}),b.font("negrito").text(" Valor:",{continued:!0}).font("normal").text(` ${(0,utils_1.formatMoney)(a.vDup,2)}`,{continued:!0}),b.font("negrito").text(" Vencimento:",{continued:!0}).font("normal").text(` ${(0,date_fns_1.format)((0,date_fns_1.parseISO)(a.dVenc),"dd/MM/yyyy")}`,{continued:!0}),c===i.dup.length-1&&b.text("")}),(0,linha_horizontal_1.linhaHorizontal)({x1:0,x2:0,y:a+20,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_horizontal_1.linhaHorizontal)({x1:0,x2:0,y:b.y+6,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+20,y2:b.y+6,x:0,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+20,y2:b.y+6,x:h,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g})),b.y}exports.getFaturaDuplicata=getFaturaDuplicata;
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHomologacao = void 0;
|
|
4
|
-
const default_1 = require("./default");
|
|
5
|
-
function getHomologacao({ doc, ajusteX, ajusteY, margemEsquerda, margemTopo, larguraDoFormulario, protNFe }) {
|
|
6
|
-
doc.font('normal')
|
|
7
|
-
.fillColor(default_1.DEFAULT_NFE.corDoTitulo)
|
|
8
|
-
.fontSize(38)
|
|
9
|
-
.fillOpacity(default_1.DEFAULT_NFE.opacidadeDaHomologacao)
|
|
10
|
-
.text('EMITIDA EM HOMOLOGAÇÃO', margemEsquerda + ajusteX + 0, margemTopo + ajusteY + 200 + default_1.DEFAULT_NFE.ajusteYDaHomologacao, {
|
|
11
|
-
width: larguraDoFormulario,
|
|
12
|
-
align: 'center'
|
|
13
|
-
});
|
|
14
|
-
doc.font('normal')
|
|
15
|
-
.fillColor(default_1.DEFAULT_NFE.corDoTitulo)
|
|
16
|
-
.fontSize(25)
|
|
17
|
-
.fillOpacity(default_1.DEFAULT_NFE.opacidadeDaHomologacao)
|
|
18
|
-
.text(protNFe !== undefined ? 'SEM VALOR FISCAL' : 'NÃO ENVIADA PARA SEFAZ', margemEsquerda + ajusteX + 0, margemTopo + ajusteY + 250 + default_1.DEFAULT_NFE.ajusteYDaHomologacao, {
|
|
19
|
-
width: larguraDoFormulario,
|
|
20
|
-
align: 'center'
|
|
21
|
-
});
|
|
22
|
-
doc.fillOpacity(100);
|
|
23
|
-
}
|
|
24
|
-
exports.getHomologacao = getHomologacao;
|
|
25
|
-
//# sourceMappingURL=get-homologacao.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getHomologacao=void 0;const default_1=require("./default");function getHomologacao({doc:a,ajusteX:b,ajusteY:c,margemEsquerda:d,margemTopo:e,larguraDoFormulario:f,protNFe:g}){a.font("normal").fillColor(default_1.DEFAULT_NFE.corDoTitulo).fontSize(38).fillOpacity(default_1.DEFAULT_NFE.opacidadeDaHomologacao).text("EMITIDA EM HOMOLOGA\xC7\xC3O",d+b+0,e+c+200+default_1.DEFAULT_NFE.ajusteYDaHomologacao,{width:f,align:"center"}),a.font("normal").fillColor(default_1.DEFAULT_NFE.corDoTitulo).fontSize(25).fillOpacity(default_1.DEFAULT_NFE.opacidadeDaHomologacao).text(g===void 0?"N\xC3O ENVIADA PARA SEFAZ":"SEM VALOR FISCAL",d+b+0,e+c+250+default_1.DEFAULT_NFE.ajusteYDaHomologacao,{width:f,align:"center"}),a.fillOpacity(100)}exports.getHomologacao=getHomologacao;
|