@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,144 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTransporte = void 0;
|
|
4
|
-
const utils_1 = require("../../../../domain/use-cases/utils");
|
|
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 getTransporte({ y, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo, larguraDoFormulario, transp }) {
|
|
12
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 8, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
13
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 28, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
14
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 48, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
15
|
-
(0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 68, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
|
|
16
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 8, y2: y + 68, x: 0, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
17
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 8, y2: y + 28, x: 170, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
18
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 8, y2: y + 28, x: 346, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
19
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 8, y2: y + 48, x: 434, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
20
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 8, y2: y + 48, x: 456.65, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
21
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 8, y2: y + 68, x: 258, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
22
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 48, y2: y + 68, x: 59.6, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
23
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 48, y2: y + 68, x: 156.6, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
24
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 48, y2: y + 68, x: 357, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
25
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 48, y2: y + 68, x: 473.3, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
26
|
-
(0, linha_vertical_1.linhaVertical)({ y1: y + 8, y2: y + 68, x: larguraDoFormulario, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
27
|
-
(0, secao_1.secao)({ doc, value: 'TRANSPORTADOR / VOLUMES TRANSPORTADOS', x: 1.5, y, largura: 0, ajusteX, ajusteY, margemEsquerda, margemTopo });
|
|
28
|
-
(0, titulo_1.titulo)({ value: 'NOME / RAZÃO SOCIAL', x: 1.5, y: y + 9.5, largura: 166.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
29
|
-
let tamanhoFonte = 6;
|
|
30
|
-
if (transp.transporta?.xNome && transp.transporta?.xNome.length > 40) {
|
|
31
|
-
tamanhoFonte = 5;
|
|
32
|
-
}
|
|
33
|
-
(0, campo_1.campo)({
|
|
34
|
-
value: transp.transporta?.xNome ?? '',
|
|
35
|
-
x: 1.5,
|
|
36
|
-
y: y + 17.5,
|
|
37
|
-
largura: 166.5,
|
|
38
|
-
alinhamento: 'left',
|
|
39
|
-
tamanho: tamanhoFonte,
|
|
40
|
-
ajusteX,
|
|
41
|
-
ajusteY,
|
|
42
|
-
doc,
|
|
43
|
-
margemEsquerda,
|
|
44
|
-
margemTopo
|
|
45
|
-
});
|
|
46
|
-
function ModFrete(value) {
|
|
47
|
-
if (value === '0') {
|
|
48
|
-
return 'Por conta do Remetente';
|
|
49
|
-
}
|
|
50
|
-
else if (value === '1') {
|
|
51
|
-
return 'Por conta do Destinatário';
|
|
52
|
-
}
|
|
53
|
-
else if (value === '2') {
|
|
54
|
-
return 'Por conta de Terceiros';
|
|
55
|
-
}
|
|
56
|
-
else if (value === '3') {
|
|
57
|
-
return 'Por conta do Remetente';
|
|
58
|
-
}
|
|
59
|
-
else if (value === '4') {
|
|
60
|
-
return 'Por conta do Destinatário';
|
|
61
|
-
}
|
|
62
|
-
else if (value === '9') {
|
|
63
|
-
return 'Sem Ocorrência de Transporte';
|
|
64
|
-
}
|
|
65
|
-
return 'VALOR NAO CADASTRADO';
|
|
66
|
-
}
|
|
67
|
-
(0, titulo_1.titulo)({ value: 'FRETE POR CONTA', x: 171.5, y: y + 9.5, largura: 85, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
68
|
-
(0, campo_1.campo)({
|
|
69
|
-
value: ModFrete(transp.modFrete),
|
|
70
|
-
x: 171.5,
|
|
71
|
-
y: y + 17.5,
|
|
72
|
-
largura: 85,
|
|
73
|
-
ajusteX,
|
|
74
|
-
ajusteY,
|
|
75
|
-
doc,
|
|
76
|
-
margemEsquerda,
|
|
77
|
-
margemTopo,
|
|
78
|
-
tamanho: 6
|
|
79
|
-
});
|
|
80
|
-
(0, titulo_1.titulo)({ value: 'CÓDIGO ANTT', x: 259.5, y: y + 9.5, largura: 84, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
81
|
-
(0, campo_1.campo)({ value: transp.veicTransp?.RNTC ?? '', x: 259.5, y: y + 17.5, largura: 84, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
82
|
-
(0, titulo_1.titulo)({ value: 'PLACA DO VEÍCULO', x: 347.5, y: y + 9.5, largura: 84, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
83
|
-
(0, campo_1.campo)({ value: transp.veicTransp?.placa ?? '', x: 347.5, y: y + 17.5, largura: 84, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
84
|
-
(0, titulo_1.titulo)({ value: 'UF', x: 435.5, y: y + 9.5, largura: 19.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
85
|
-
(0, campo_1.campo)({ value: transp.veicTransp?.UF ?? '', x: 435.5, y: y + 17.5, largura: 19.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
86
|
-
(0, titulo_1.titulo)({ value: 'CNPJ / CPF', x: 458, y: y + 9.5, largura: 126.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
87
|
-
(0, campo_1.campo)({ value: transp.transporta?.CNPJ ?? '', x: 458, y: y + 17.5, largura: 126.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
88
|
-
(0, campo_1.campo)({ value: transp.transporta?.CPF ?? '', x: 458, y: y + 17.5, largura: 126.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
89
|
-
(0, titulo_1.titulo)({ value: 'ENDEREÇO', x: 1.5, y: y + 30, largura: 254, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
90
|
-
(0, campo_1.campo)({
|
|
91
|
-
value: transp.transporta?.xEnder ?? '',
|
|
92
|
-
x: 1.5,
|
|
93
|
-
y: y + 38.5,
|
|
94
|
-
largura: 254,
|
|
95
|
-
alinhamento: 'left',
|
|
96
|
-
tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDoCampo - 0.5,
|
|
97
|
-
ajusteX,
|
|
98
|
-
ajusteY,
|
|
99
|
-
doc,
|
|
100
|
-
margemEsquerda,
|
|
101
|
-
margemTopo
|
|
102
|
-
});
|
|
103
|
-
(0, titulo_1.titulo)({ value: 'MUNICÍPIO', x: 259.5, y: y + 30, largura: 172, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
104
|
-
(0, campo_1.campo)({ value: transp.transporta?.xMun ?? '', x: 259.5, y: y + 38.5, largura: 172, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
105
|
-
(0, titulo_1.titulo)({ value: 'UF', x: 435.5, y: y + 30, largura: 19.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
106
|
-
(0, campo_1.campo)({ value: transp.transporta?.uf ?? '', x: 435.5, y: y + 38.5, largura: 19.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
107
|
-
(0, titulo_1.titulo)({ value: 'INSCRIÇÃO ESTADUAL', x: 458, y: y + 30, largura: 126.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
108
|
-
(0, campo_1.campo)({ value: transp.transporta?.ie ?? '', x: 458, y: y + 38.5, largura: 126.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
109
|
-
(0, titulo_1.titulo)({ value: 'QUANTIDADE', x: 1.5, y: y + 50, largura: 56.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
110
|
-
(0, campo_1.campo)({ value: transp.vol?.qVol ?? '', x: 1.5, y: y + 58, largura: 56.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
111
|
-
(0, titulo_1.titulo)({ value: 'ESPÉCIE', x: 60.8, y: y + 50, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
112
|
-
(0, campo_1.campo)({ value: transp.vol?.esp ?? '', x: 60.8, y: y + 58, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
113
|
-
(0, titulo_1.titulo)({ value: 'MARCA', x: 160, y: y + 50, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
114
|
-
(0, campo_1.campo)({ value: transp.vol?.marca ?? '', x: 160, y: y + 58, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
115
|
-
(0, titulo_1.titulo)({ value: 'NUMERAÇÃO', x: 259.5, y: y + 50, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
116
|
-
(0, campo_1.campo)({ value: transp.vol?.nVol ?? '', x: 259.5, y: y + 58, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
117
|
-
(0, titulo_1.titulo)({ value: 'PESO BRUTO', x: 358.5, y: y + 50, largura: 112.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
118
|
-
(0, campo_1.campo)({
|
|
119
|
-
value: transp.vol?.pesoB ? (0, utils_1.formatMoney)(transp.vol?.pesoB, 3) : '',
|
|
120
|
-
x: 358.5,
|
|
121
|
-
y: y + 58,
|
|
122
|
-
largura: 112.5,
|
|
123
|
-
ajusteX,
|
|
124
|
-
ajusteY,
|
|
125
|
-
doc,
|
|
126
|
-
margemEsquerda,
|
|
127
|
-
margemTopo
|
|
128
|
-
});
|
|
129
|
-
(0, titulo_1.titulo)({ value: 'PESO LÍQUIDO', x: 474.5, y: y + 50, largura: 110.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
|
|
130
|
-
(0, campo_1.campo)({
|
|
131
|
-
value: transp.vol?.pesoL ? (0, utils_1.formatMoney)(transp.vol?.pesoL, 3) : '',
|
|
132
|
-
x: 474.5,
|
|
133
|
-
y: y + 58,
|
|
134
|
-
largura: 110.5,
|
|
135
|
-
ajusteX,
|
|
136
|
-
ajusteY,
|
|
137
|
-
doc,
|
|
138
|
-
margemEsquerda,
|
|
139
|
-
margemTopo
|
|
140
|
-
});
|
|
141
|
-
return doc.y;
|
|
142
|
-
}
|
|
143
|
-
exports.getTransporte = getTransporte;
|
|
144
|
-
//# sourceMappingURL=get-transporte.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getTransporte=void 0;const utils_1=require("../../../../domain/use-cases/utils"),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 getTransporte({y:a,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g,larguraDoFormulario:h,transp:i}){(0,linha_horizontal_1.linhaHorizontal)({x1:0,x2:0,y:a+8,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_horizontal_1.linhaHorizontal)({x1:0,x2:0,y:a+28,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_horizontal_1.linhaHorizontal)({x1:0,x2:0,y:a+48,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_horizontal_1.linhaHorizontal)({x1:0,x2:0,y:a+68,doc:b,ajusteX:c,ajusteY:d,margemDireita:e,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+8,y2:a+68,x:0,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+8,y2:a+28,x:170,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+8,y2:a+28,x:346,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+8,y2:a+48,x:434,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+8,y2:a+48,x:456.65,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+8,y2:a+68,x:258,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+48,y2:a+68,x:59.6,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+48,y2:a+68,x:156.6,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+48,y2:a+68,x:357,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+48,y2:a+68,x:473.3,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,linha_vertical_1.linhaVertical)({y1:a+8,y2:a+68,x:h,doc:b,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,secao_1.secao)({doc:b,value:"TRANSPORTADOR / VOLUMES TRANSPORTADOS",x:1.5,y:a,largura:0,ajusteX:c,ajusteY:d,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"NOME / RAZ\xC3O SOCIAL",x:1.5,y:a+9.5,largura:166.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g});let j=6;return i.transporta?.xNome&&40<i.transporta?.xNome.length&&(j=5),(0,campo_1.campo)({value:i.transporta?.xNome??"",x:1.5,y:a+17.5,largura:166.5,alinhamento:"left",tamanho:j,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"FRETE POR CONTA",x:171.5,y:a+9.5,largura:85,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:function(a){return"0"===a?"Por conta do Remetente":"1"===a?"Por conta do Destinat\xE1rio":"2"===a?"Por conta de Terceiros":"3"===a?"Por conta do Remetente":"4"===a?"Por conta do Destinat\xE1rio":"9"===a?"Sem Ocorr\xEAncia de Transporte":"VALOR NAO CADASTRADO"}(i.modFrete),x:171.5,y:a+17.5,largura:85,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g,tamanho:6}),(0,titulo_1.titulo)({value:"C\xD3DIGO ANTT",x:259.5,y:a+9.5,largura:84,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.veicTransp?.RNTC??"",x:259.5,y:a+17.5,largura:84,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"PLACA DO VE\xCDCULO",x:347.5,y:a+9.5,largura:84,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.veicTransp?.placa??"",x:347.5,y:a+17.5,largura:84,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"UF",x:435.5,y:a+9.5,largura:19.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.veicTransp?.UF??"",x:435.5,y:a+17.5,largura:19.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"CNPJ / CPF",x:458,y:a+9.5,largura:126.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.transporta?.CNPJ??"",x:458,y:a+17.5,largura:126.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.transporta?.CPF??"",x:458,y:a+17.5,largura:126.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"ENDERE\xC7O",x:1.5,y:a+30,largura:254,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.transporta?.xEnder??"",x:1.5,y:a+38.5,largura:254,alinhamento:"left",tamanho:default_1.DEFAULT_NFE.tamanhoDaFonteDoCampo-.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"MUNIC\xCDPIO",x:259.5,y:a+30,largura:172,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.transporta?.xMun??"",x:259.5,y:a+38.5,largura:172,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"UF",x:435.5,y:a+30,largura:19.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.transporta?.uf??"",x:435.5,y:a+38.5,largura:19.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"INSCRI\xC7\xC3O ESTADUAL",x:458,y:a+30,largura:126.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.transporta?.ie??"",x:458,y:a+38.5,largura:126.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"QUANTIDADE",x:1.5,y:a+50,largura:56.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.vol?.qVol??"",x:1.5,y:a+58,largura:56.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"ESP\xC9CIE",x:60.8,y:a+50,largura:96,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.vol?.esp??"",x:60.8,y:a+58,largura:96,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"MARCA",x:160,y:a+50,largura:96,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.vol?.marca??"",x:160,y:a+58,largura:96,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"NUMERA\xC7\xC3O",x:259.5,y:a+50,largura:96,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.vol?.nVol??"",x:259.5,y:a+58,largura:96,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"PESO BRUTO",x:358.5,y:a+50,largura:112.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.vol?.pesoB?(0,utils_1.formatMoney)(i.vol?.pesoB,3):"",x:358.5,y:a+58,largura:112.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,titulo_1.titulo)({value:"PESO L\xCDQUIDO",x:474.5,y:a+50,largura:110.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),(0,campo_1.campo)({value:i.vol?.pesoL?(0,utils_1.formatMoney)(i.vol?.pesoL,3):"",x:474.5,y:a+58,largura:110.5,ajusteX:c,ajusteY:d,doc:b,margemEsquerda:f,margemTopo:g}),b.y}exports.getTransporte=getTransporte;
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.italico = void 0;
|
|
4
|
-
const default_1 = require("./default");
|
|
5
|
-
function italico({ ajusteX, ajusteY, doc, largura, margemEsquerda, margemTopo, value, x, y, alinhamento, tamanho }) {
|
|
6
|
-
doc.font('italico')
|
|
7
|
-
.fillColor(default_1.DEFAULT_NFE.corDoTitulo)
|
|
8
|
-
.fontSize(tamanho ?? 6)
|
|
9
|
-
.text(value ?? '', margemEsquerda + ajusteX + x, margemTopo + ajusteY + y, {
|
|
10
|
-
width: largura,
|
|
11
|
-
align: alinhamento ?? 'center',
|
|
12
|
-
lineGap: -1.5
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
exports.italico = italico;
|
|
16
|
-
//# sourceMappingURL=italico.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.italico=void 0;const default_1=require("./default");function italico({ajusteX:a,ajusteY:b,doc:c,largura:d,margemEsquerda:e,margemTopo:f,value:g,x:h,y:i,alinhamento:j,tamanho:k}){c.font("italico").fillColor(default_1.DEFAULT_NFE.corDoTitulo).fontSize(k??6).text(g??"",e+a+h,f+b+i,{width:d,align:j??"center",lineGap:-1.5})}exports.italico=italico;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.linhaHorizontalTracejada = void 0;
|
|
4
|
-
const linha_horizontal_1 = require("./linha-horizontal");
|
|
5
|
-
function linhaHorizontalTracejada(input) {
|
|
6
|
-
(0, linha_horizontal_1.linhaHorizontal)({ ...input, tracejada: false });
|
|
7
|
-
}
|
|
8
|
-
exports.linhaHorizontalTracejada = linhaHorizontalTracejada;
|
|
9
|
-
//# sourceMappingURL=linha-horizontal-tracejada.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.linhaHorizontalTracejada=void 0;const linha_horizontal_1=require("./linha-horizontal");function linhaHorizontalTracejada(a){(0,linha_horizontal_1.linhaHorizontal)({...a,tracejada:!1})}exports.linhaHorizontalTracejada=linhaHorizontalTracejada;
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.linhaHorizontal = void 0;
|
|
4
|
-
function linhaHorizontal({ ajusteX, ajusteY, doc, x1, x2, y, margemDireita, margemEsquerda, margemTopo, tracejada = false }) {
|
|
5
|
-
y = margemTopo + ajusteY + y;
|
|
6
|
-
x1 = margemEsquerda + ajusteX + x1;
|
|
7
|
-
x2 = margemDireita + ajusteX + x2;
|
|
8
|
-
if (tracejada) {
|
|
9
|
-
doc.moveTo(x1, y).lineTo(x2, y).dash(3, { space: 5 }).stroke();
|
|
10
|
-
doc.undash();
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
doc.moveTo(x1, y).lineTo(x2, y).stroke();
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.linhaHorizontal = linhaHorizontal;
|
|
17
|
-
//# sourceMappingURL=linha-horizontal.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.linhaHorizontal=void 0;function linhaHorizontal({ajusteX:a,ajusteY:b,doc:c,x1:d,x2:e,y:f,margemDireita:g,margemEsquerda:h,margemTopo:i,tracejada:j=!1}){f=i+b+f,d=h+a+d,e=g+a+e,j?(c.moveTo(d,f).lineTo(e,f).dash(3,{space:5}).stroke(),c.undash()):c.moveTo(d,f).lineTo(e,f).stroke()}exports.linhaHorizontal=linhaHorizontal;
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.linhaVertical = void 0;
|
|
4
|
-
function linhaVertical({ ajusteX, ajusteY, doc, margemEsquerda, margemTopo, x, y1, y2 }) {
|
|
5
|
-
x = margemEsquerda + ajusteX + x;
|
|
6
|
-
y1 = margemTopo + ajusteY + y1;
|
|
7
|
-
y2 = margemTopo + ajusteY + y2;
|
|
8
|
-
doc.moveTo(x, y1).lineTo(x, y2).stroke();
|
|
9
|
-
}
|
|
10
|
-
exports.linhaVertical = linhaVertical;
|
|
11
|
-
//# sourceMappingURL=linha-vertical.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.linhaVertical=void 0;function linhaVertical({ajusteX:a,ajusteY:b,doc:c,margemEsquerda:d,margemTopo:e,x:f,y1:g,y2:h}){f=d+a+f,g=e+b+g,h=e+b+h,c.moveTo(f,g).lineTo(f,h).stroke()}exports.linhaVertical=linhaVertical;
|
|
@@ -1,32 +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.loadFontsNFCe = exports.loadFonts = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
function loadFonts(doc) {
|
|
9
|
-
const diretorioDeFontes = path_1.default.join(__dirname, './../fontes');
|
|
10
|
-
const timesNewRoman = path_1.default.join(diretorioDeFontes, 'Times New Roman.ttf');
|
|
11
|
-
const timesNewRomanNegrito = path_1.default.join(diretorioDeFontes, 'Times New Roman Bold.ttf');
|
|
12
|
-
const timesNewRomanItalico = path_1.default.join(diretorioDeFontes, 'Times New Roman Italic.ttf');
|
|
13
|
-
const timesNewRomanNegritoItalico = path_1.default.join(diretorioDeFontes, 'Times New Roman Bold Italic.ttf');
|
|
14
|
-
doc.registerFont('normal', timesNewRoman);
|
|
15
|
-
doc.registerFont('negrito', timesNewRomanNegrito);
|
|
16
|
-
doc.registerFont('italico', timesNewRomanItalico);
|
|
17
|
-
doc.registerFont('negrito-italico', timesNewRomanNegritoItalico);
|
|
18
|
-
}
|
|
19
|
-
exports.loadFonts = loadFonts;
|
|
20
|
-
function loadFontsNFCe(doc) {
|
|
21
|
-
const diretorioDeFontes = path_1.default.join(__dirname, './../fontes/roboto-condensed');
|
|
22
|
-
const normal = path_1.default.join(diretorioDeFontes, 'RobotoCondensed-Regular.ttf');
|
|
23
|
-
const negrito = path_1.default.join(diretorioDeFontes, 'RobotoCondensed-Bold.ttf');
|
|
24
|
-
const italico = path_1.default.join(diretorioDeFontes, 'RobotoCondensed-Italic.ttf');
|
|
25
|
-
const negritoItalico = path_1.default.join(diretorioDeFontes, 'RobotoCondensed-BoldItalic.ttf');
|
|
26
|
-
doc.registerFont('normal', normal);
|
|
27
|
-
doc.registerFont('negrito', negrito);
|
|
28
|
-
doc.registerFont('italico', italico);
|
|
29
|
-
doc.registerFont('negrito-italico', negritoItalico);
|
|
30
|
-
}
|
|
31
|
-
exports.loadFontsNFCe = loadFontsNFCe;
|
|
32
|
-
//# sourceMappingURL=load-fontes.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.loadFontsNFCe=exports.loadFonts=void 0;const path_1=__importDefault(require("path"));function loadFonts(a){const b=path_1.default.join(__dirname,"./../fontes"),c=path_1.default.join(b,"Times New Roman.ttf"),d=path_1.default.join(b,"Times New Roman Bold.ttf"),e=path_1.default.join(b,"Times New Roman Italic.ttf"),f=path_1.default.join(b,"Times New Roman Bold Italic.ttf");a.registerFont("normal",c),a.registerFont("negrito",d),a.registerFont("italico",e),a.registerFont("negrito-italico",f)}exports.loadFonts=loadFonts;function loadFontsNFCe(a){const b=path_1.default.join(__dirname,"./../fontes/roboto-condensed"),c=path_1.default.join(b,"RobotoCondensed-Regular.ttf"),d=path_1.default.join(b,"RobotoCondensed-Bold.ttf"),e=path_1.default.join(b,"RobotoCondensed-Italic.ttf"),f=path_1.default.join(b,"RobotoCondensed-BoldItalic.ttf");a.registerFont("normal",c),a.registerFont("negrito",d),a.registerFont("italico",e),a.registerFont("negrito-italico",f)}exports.loadFontsNFCe=loadFontsNFCe;
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.negrito = void 0;
|
|
4
|
-
const default_1 = require("./default");
|
|
5
|
-
function negrito({ ajusteX, ajusteY, doc, largura, margemEsquerda, margemTopo, value, x, y, alinhamento, tamanho }) {
|
|
6
|
-
doc.font('negrito')
|
|
7
|
-
.fillColor(default_1.DEFAULT_NFE.corDoTitulo)
|
|
8
|
-
.fontSize(tamanho ?? 6)
|
|
9
|
-
.text(value, margemEsquerda + ajusteX + x, margemTopo + ajusteY + y, {
|
|
10
|
-
width: largura,
|
|
11
|
-
align: alinhamento ?? 'center',
|
|
12
|
-
lineGap: -1.5
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
exports.negrito = negrito;
|
|
16
|
-
//# sourceMappingURL=negrito.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.negrito=void 0;const default_1=require("./default");function negrito({ajusteX:a,ajusteY:b,doc:c,largura:d,margemEsquerda:e,margemTopo:f,value:g,x:h,y:i,alinhamento:j,tamanho:k}){c.font("negrito").fillColor(default_1.DEFAULT_NFE.corDoTitulo).fontSize(k??6).text(g,e+a+h,f+b+i,{width:d,align:j??"center",lineGap:-1.5})}exports.negrito=negrito;
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normal = void 0;
|
|
4
|
-
const default_1 = require("./default");
|
|
5
|
-
function normal({ ajusteX, ajusteY, doc, largura, margemEsquerda, margemTopo, value, x, y, alinhamento, tamanho }) {
|
|
6
|
-
doc.font('normal')
|
|
7
|
-
.fillColor(default_1.DEFAULT_NFE.corDoTitulo)
|
|
8
|
-
.fontSize(tamanho ?? 8)
|
|
9
|
-
.text(value ?? '', margemEsquerda + ajusteX + x, margemTopo + ajusteY + y, {
|
|
10
|
-
width: largura,
|
|
11
|
-
align: alinhamento ?? 'center',
|
|
12
|
-
lineGap: -1.5
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
exports.normal = normal;
|
|
16
|
-
//# sourceMappingURL=normal.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.normal=void 0;const default_1=require("./default");function normal({ajusteX:a,ajusteY:b,doc:c,largura:d,margemEsquerda:e,margemTopo:f,value:g,x:h,y:i,alinhamento:j,tamanho:k}){c.font("normal").fillColor(default_1.DEFAULT_NFE.corDoTitulo).fontSize(k??8).text(g??"",e+a+h,f+b+i,{width:d,align:j??"center",lineGap:-1.5})}exports.normal=normal;
|
|
@@ -1,15 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.optionsDocNFCe = exports.optionsDocNFe = void 0;
|
|
4
|
-
const default_1 = require("./default");
|
|
5
|
-
exports.optionsDocNFe = {
|
|
6
|
-
bufferPages: true,
|
|
7
|
-
margin: 0,
|
|
8
|
-
size: [default_1.DEFAULT_NFE.larguraDaPagina, default_1.DEFAULT_NFE.alturaDaPagina]
|
|
9
|
-
};
|
|
10
|
-
exports.optionsDocNFCe = {
|
|
11
|
-
bufferPages: true,
|
|
12
|
-
margin: 0,
|
|
13
|
-
size: [100, 10000000000000]
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=options-doc.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.optionsDocNFCe=exports.optionsDocNFe=void 0;const default_1=require("./default");exports.optionsDocNFe={bufferPages:!0,margin:0,size:[default_1.DEFAULT_NFE.larguraDaPagina,default_1.DEFAULT_NFE.alturaDaPagina]},exports.optionsDocNFCe={bufferPages:!0,margin:0,size:[100,1e13]};
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.secao = void 0;
|
|
4
|
-
const default_1 = require("./default");
|
|
5
|
-
function secao({ ajusteX, ajusteY, doc, largura, margemEsquerda, margemTopo, value, x, y, tamanho }) {
|
|
6
|
-
x = margemEsquerda + ajusteX + x;
|
|
7
|
-
y = margemTopo + ajusteY + y;
|
|
8
|
-
doc.font('negrito')
|
|
9
|
-
.fillColor(default_1.DEFAULT_NFE.corDaSecao)
|
|
10
|
-
.fontSize(tamanho ?? default_1.DEFAULT_NFE.tamanhoDaFonteDaSecao)
|
|
11
|
-
.text(value.toUpperCase(), x, y, {
|
|
12
|
-
width: largura,
|
|
13
|
-
align: 'left'
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
exports.secao = secao;
|
|
17
|
-
//# sourceMappingURL=secao.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.secao=void 0;const default_1=require("./default");function secao({ajusteX:a,ajusteY:b,doc:c,largura:d,margemEsquerda:e,margemTopo:f,value:g,x:h,y:i,tamanho:j}){h=e+a+h,i=f+b+i,c.font("negrito").fillColor(default_1.DEFAULT_NFE.corDaSecao).fontSize(j??default_1.DEFAULT_NFE.tamanhoDaFonteDaSecao).text(g.toUpperCase(),h,i,{width:d,align:"left"})}exports.secao=secao;
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.titulo = void 0;
|
|
4
|
-
const default_1 = require("./default");
|
|
5
|
-
function titulo({ doc, largura, value, x, y, margemEsquerda, margemTopo, ajusteX, ajusteY, alinhamento, tamanho }) {
|
|
6
|
-
x = margemEsquerda + ajusteX + x;
|
|
7
|
-
y = margemTopo + ajusteY + y;
|
|
8
|
-
doc.font('normal')
|
|
9
|
-
.fillColor(default_1.DEFAULT_NFE.corDoTitulo)
|
|
10
|
-
.fontSize(tamanho ?? default_1.DEFAULT_NFE.tamanhoDaFonteDoTitulo)
|
|
11
|
-
.text(value.toUpperCase(), x, y, {
|
|
12
|
-
width: largura,
|
|
13
|
-
align: alinhamento ?? default_1.DEFAULT_NFE.alinhamentoDoTitulo
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
exports.titulo = titulo;
|
|
17
|
-
//# sourceMappingURL=titulo.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.titulo=void 0;const default_1=require("./default");function titulo({doc:a,largura:b,value:c,x:d,y:e,margemEsquerda:f,margemTopo:g,ajusteX:h,ajusteY:i,alinhamento:j,tamanho:k}){d=f+h+d,e=g+i+e,a.font("normal").fillColor(default_1.DEFAULT_NFE.corDoTitulo).fontSize(k??default_1.DEFAULT_NFE.tamanhoDaFonteDoTitulo).text(c.toUpperCase(),d,e,{width:b,align:j??default_1.DEFAULT_NFE.alinhamentoDoTitulo})}exports.titulo=titulo;
|
|
@@ -1,26 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deserializeXml = void 0;
|
|
4
|
-
const xml2js_1 = require("xml2js");
|
|
5
|
-
async function deserializeXml(xml, options) {
|
|
6
|
-
if (options == null) {
|
|
7
|
-
options = {
|
|
8
|
-
mergeAttrs: true,
|
|
9
|
-
ignoreAttrs: true,
|
|
10
|
-
explicitArray: false
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
const parser = new xml2js_1.Parser(options);
|
|
14
|
-
return new Promise((resolve, reject) => {
|
|
15
|
-
parser.parseString(xml, (err, result) => {
|
|
16
|
-
if (err != null) {
|
|
17
|
-
reject(err);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
resolve(result);
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
exports.deserializeXml = deserializeXml;
|
|
26
|
-
//# sourceMappingURL=deserialize.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.deserializeXml=void 0;const xml2js_1=require("xml2js");async function deserializeXml(a,b){null==b&&(b={mergeAttrs:!0,ignoreAttrs:!0,explicitArray:!1});const c=new xml2js_1.Parser(b);return new Promise((b,d)=>{c.parseString(a,(a,c)=>{null==a?b(c):d(a)})})}exports.deserializeXml=deserializeXml;
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./deserialize"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(a,b,c,d){d===void 0&&(d=c);var e=Object.getOwnPropertyDescriptor(b,c);(!e||("get"in e?!b.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:function(){return b[c]}}),Object.defineProperty(a,d,e)}:function(a,b,c,d){d===void 0&&(d=c),a[d]=b[c]}),__exportStar=this&&this.__exportStar||function(a,b){for(var c in a)"default"==c||Object.prototype.hasOwnProperty.call(b,c)||__createBinding(b,a,c)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./deserialize"),exports);
|
|
@@ -1,27 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gerarPDF = void 0;
|
|
4
|
-
const xml_1 = require("../../../application/helpers/xml");
|
|
5
|
-
const pdf_NFCe_1 = require("./pdf-NFCe");
|
|
6
|
-
const pdf_NFe_1 = require("./pdf-NFe");
|
|
7
|
-
async function gerarPDF(xmlNFe, pathLogo) {
|
|
8
|
-
const nf = await (0, xml_1.deserializeXml)(xmlNFe);
|
|
9
|
-
const nfeProc = nf.nfeProc;
|
|
10
|
-
if (!(nfeProc.NFe.infNFe.det instanceof Array)) {
|
|
11
|
-
nfeProc.NFe.infNFe.det = [nfeProc.NFe.infNFe.det];
|
|
12
|
-
}
|
|
13
|
-
if (!(nfeProc.NFe.infNFe.pag.detPag instanceof Array)) {
|
|
14
|
-
nfeProc.NFe.infNFe.pag.detPag = [nfeProc.NFe.infNFe.pag.detPag];
|
|
15
|
-
}
|
|
16
|
-
if (nfeProc.NFe.infNFe.cobr?.dup !== undefined && !(nfeProc.NFe.infNFe.cobr?.dup instanceof Array)) {
|
|
17
|
-
nfeProc.NFe.infNFe.cobr.dup = [nfeProc.NFe.infNFe.cobr?.dup];
|
|
18
|
-
}
|
|
19
|
-
if (nfeProc.NFe.infNFe.ide.mod === '55') {
|
|
20
|
-
return await (0, pdf_NFe_1.pdfNFe)(nfeProc, pathLogo);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
return await (0, pdf_NFCe_1.pdfNFCe)(nfeProc, pathLogo);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.gerarPDF = gerarPDF;
|
|
27
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.gerarPDF=void 0;const xml_1=require("../../../application/helpers/xml"),pdf_NFCe_1=require("./pdf-NFCe"),pdf_NFe_1=require("./pdf-NFe");async function gerarPDF(a,b){const c=await(0,xml_1.deserializeXml)(a),d=c.nfeProc;return d.NFe.infNFe.det instanceof Array||(d.NFe.infNFe.det=[d.NFe.infNFe.det]),d.NFe.infNFe.pag.detPag instanceof Array||(d.NFe.infNFe.pag.detPag=[d.NFe.infNFe.pag.detPag]),void 0===d.NFe.infNFe.cobr?.dup||d.NFe.infNFe.cobr?.dup instanceof Array||(d.NFe.infNFe.cobr.dup=[d.NFe.infNFe.cobr?.dup]),"55"===d.NFe.infNFe.ide.mod?await(0,pdf_NFe_1.pdfNFe)(d,b):await(0,pdf_NFCe_1.pdfNFCe)(d,b)}exports.gerarPDF=gerarPDF;
|