@alexssmusica/node-pdf-nfe 1.2.4 → 1.2.5

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.
Files changed (102) hide show
  1. package/lib/application/helpers/generate-pdf/nfe/campo.js +14 -15
  2. package/lib/application/helpers/generate-pdf/nfe/cria-layout.js +147 -148
  3. package/lib/application/helpers/generate-pdf/nfe/default.js +26 -26
  4. package/lib/application/helpers/generate-pdf/nfe/gerar-itens.js +276 -277
  5. package/lib/application/helpers/generate-pdf/nfe/get-dados-adicionais.js +52 -53
  6. package/lib/application/helpers/generate-pdf/nfe/get-dados-emitente.js +333 -319
  7. package/lib/application/helpers/generate-pdf/nfe/get-destinatario-remetente.js +153 -154
  8. package/lib/application/helpers/generate-pdf/nfe/get-fatura-duplicata.js +63 -64
  9. package/lib/application/helpers/generate-pdf/nfe/get-homologacao.js +36 -37
  10. package/lib/application/helpers/generate-pdf/nfe/get-imposto.js +218 -219
  11. package/lib/application/helpers/generate-pdf/nfe/get-iss.js +73 -74
  12. package/lib/application/helpers/generate-pdf/nfe/get-menu-itens.js +198 -199
  13. package/lib/application/helpers/generate-pdf/nfe/get-nota-cancelada.js +16 -17
  14. package/lib/application/helpers/generate-pdf/nfe/get-recibo.js +100 -101
  15. package/lib/application/helpers/generate-pdf/nfe/get-transporte.js +178 -179
  16. package/lib/application/helpers/generate-pdf/nfe/italico.js +15 -16
  17. package/lib/application/helpers/generate-pdf/nfe/linha-horizontal-tracejada.js +7 -8
  18. package/lib/application/helpers/generate-pdf/nfe/linha-horizontal.js +15 -16
  19. package/lib/application/helpers/generate-pdf/nfe/linha-vertical.js +9 -10
  20. package/lib/application/helpers/generate-pdf/nfe/load-fontes.js +30 -31
  21. package/lib/application/helpers/generate-pdf/nfe/negrito.js +15 -16
  22. package/lib/application/helpers/generate-pdf/nfe/normal.js +15 -16
  23. package/lib/application/helpers/generate-pdf/nfe/options-doc.js +14 -14
  24. package/lib/application/helpers/generate-pdf/nfe/secao.js +16 -17
  25. package/lib/application/helpers/generate-pdf/nfe/titulo.js +16 -17
  26. package/lib/application/helpers/xml/deserialize.js +24 -25
  27. package/lib/application/helpers/xml/index.js +17 -17
  28. package/lib/domain/use-cases/pdf/index.js +25 -26
  29. package/lib/domain/use-cases/pdf/pdf-NFCe.js +688 -688
  30. package/lib/domain/use-cases/pdf/pdf-NFe.js +54 -54
  31. package/lib/domain/use-cases/utils/current-date.js +8 -12
  32. package/lib/domain/use-cases/utils/format-cnpj.js +8 -9
  33. package/lib/domain/use-cases/utils/format-cpf.js +8 -9
  34. package/lib/domain/use-cases/utils/format-date-time.js +10 -11
  35. package/lib/domain/use-cases/utils/format-date.js +9 -10
  36. package/lib/domain/use-cases/utils/format-key.js +6 -7
  37. package/lib/domain/use-cases/utils/format-number.js +6 -7
  38. package/lib/domain/use-cases/utils/format-phone.js +20 -21
  39. package/lib/domain/use-cases/utils/format-plate.js +16 -17
  40. package/lib/domain/use-cases/utils/format-postal-code.js +12 -9
  41. package/lib/domain/use-cases/utils/format-protocol.js +8 -9
  42. package/lib/domain/use-cases/utils/format-state-registration.js +49 -50
  43. package/lib/domain/use-cases/utils/format-time.js +8 -9
  44. package/lib/domain/use-cases/utils/index.js +30 -30
  45. package/lib/domain/use-cases/utils/return-font-size-carrier.js +23 -24
  46. package/lib/index.js +5 -5
  47. package/lib/tsconfig.tsbuildinfo +1 -1
  48. package/lib/types/generate-pdf.js +2 -2
  49. package/lib/types/index.js +19 -19
  50. package/lib/types/nfe-proc.js +2 -2
  51. package/lib/types/schema.js +2 -2
  52. package/package.json +76 -72
  53. package/lib/application/helpers/generate-pdf/nfe/campo.d.ts +0 -2
  54. package/lib/application/helpers/generate-pdf/nfe/cria-layout.d.ts +0 -2
  55. package/lib/application/helpers/generate-pdf/nfe/default.d.ts +0 -23
  56. package/lib/application/helpers/generate-pdf/nfe/gerar-itens.d.ts +0 -2
  57. package/lib/application/helpers/generate-pdf/nfe/get-dados-adicionais.d.ts +0 -2
  58. package/lib/application/helpers/generate-pdf/nfe/get-dados-emitente.d.ts +0 -2
  59. package/lib/application/helpers/generate-pdf/nfe/get-destinatario-remetente.d.ts +0 -2
  60. package/lib/application/helpers/generate-pdf/nfe/get-fatura-duplicata.d.ts +0 -2
  61. package/lib/application/helpers/generate-pdf/nfe/get-homologacao.d.ts +0 -2
  62. package/lib/application/helpers/generate-pdf/nfe/get-imposto.d.ts +0 -2
  63. package/lib/application/helpers/generate-pdf/nfe/get-iss.d.ts +0 -2
  64. package/lib/application/helpers/generate-pdf/nfe/get-menu-itens.d.ts +0 -2
  65. package/lib/application/helpers/generate-pdf/nfe/get-nota-cancelada.d.ts +0 -2
  66. package/lib/application/helpers/generate-pdf/nfe/get-recibo.d.ts +0 -2
  67. package/lib/application/helpers/generate-pdf/nfe/get-transporte.d.ts +0 -2
  68. package/lib/application/helpers/generate-pdf/nfe/italico.d.ts +0 -2
  69. package/lib/application/helpers/generate-pdf/nfe/linha-horizontal-tracejada.d.ts +0 -2
  70. package/lib/application/helpers/generate-pdf/nfe/linha-horizontal.d.ts +0 -2
  71. package/lib/application/helpers/generate-pdf/nfe/linha-vertical.d.ts +0 -2
  72. package/lib/application/helpers/generate-pdf/nfe/load-fontes.d.ts +0 -3
  73. package/lib/application/helpers/generate-pdf/nfe/negrito.d.ts +0 -2
  74. package/lib/application/helpers/generate-pdf/nfe/normal.d.ts +0 -2
  75. package/lib/application/helpers/generate-pdf/nfe/options-doc.d.ts +0 -10
  76. package/lib/application/helpers/generate-pdf/nfe/secao.d.ts +0 -2
  77. package/lib/application/helpers/generate-pdf/nfe/titulo.d.ts +0 -2
  78. package/lib/application/helpers/xml/deserialize.d.ts +0 -2
  79. package/lib/application/helpers/xml/index.d.ts +0 -1
  80. package/lib/domain/use-cases/pdf/index.d.ts +0 -3
  81. package/lib/domain/use-cases/pdf/pdf-NFCe.d.ts +0 -3
  82. package/lib/domain/use-cases/pdf/pdf-NFe.d.ts +0 -3
  83. package/lib/domain/use-cases/utils/current-date.d.ts +0 -1
  84. package/lib/domain/use-cases/utils/format-cnpj.d.ts +0 -1
  85. package/lib/domain/use-cases/utils/format-cpf.d.ts +0 -1
  86. package/lib/domain/use-cases/utils/format-date-time.d.ts +0 -1
  87. package/lib/domain/use-cases/utils/format-date.d.ts +0 -1
  88. package/lib/domain/use-cases/utils/format-key.d.ts +0 -1
  89. package/lib/domain/use-cases/utils/format-number.d.ts +0 -1
  90. package/lib/domain/use-cases/utils/format-phone.d.ts +0 -1
  91. package/lib/domain/use-cases/utils/format-plate.d.ts +0 -1
  92. package/lib/domain/use-cases/utils/format-postal-code.d.ts +0 -1
  93. package/lib/domain/use-cases/utils/format-protocol.d.ts +0 -1
  94. package/lib/domain/use-cases/utils/format-state-registration.d.ts +0 -1
  95. package/lib/domain/use-cases/utils/format-time.d.ts +0 -1
  96. package/lib/domain/use-cases/utils/index.d.ts +0 -14
  97. package/lib/domain/use-cases/utils/return-font-size-carrier.d.ts +0 -1
  98. package/lib/index.d.ts +0 -1
  99. package/lib/types/generate-pdf.d.ts +0 -259
  100. package/lib/types/index.d.ts +0 -3
  101. package/lib/types/nfe-proc.d.ts +0 -42
  102. package/lib/types/schema.d.ts +0 -875
@@ -1,179 +1,178 @@
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
- (0, campo_1.campo)({
30
- value: transp.transporta?.xNome ?? '',
31
- x: 1.5,
32
- y: y + 17.5,
33
- largura: 166.5,
34
- alinhamento: 'left',
35
- tamanho: (0, utils_1.returnFontSizeCarrier)(transp.transporta?.xNome ?? ''),
36
- ajusteX,
37
- ajusteY,
38
- doc,
39
- margemEsquerda,
40
- margemTopo
41
- });
42
- function ModFrete(value) {
43
- if (value === '0') {
44
- return '0 - Por conta do Remet';
45
- }
46
- else if (value === '1') {
47
- return '1 - Por conta do Dest';
48
- }
49
- else if (value === '2') {
50
- return '2 - Por conta de Terc';
51
- }
52
- else if (value === '3') {
53
- return '3 - Por conta do Remet';
54
- }
55
- else if (value === '4') {
56
- return '4 - Por conta do Dest';
57
- }
58
- else if (value === '9') {
59
- return '9 - Sem Ocorr de Transp';
60
- }
61
- return '';
62
- }
63
- (0, titulo_1.titulo)({ value: 'FRETE POR CONTA', x: 171.5, y: y + 9.5, largura: 85, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
64
- (0, campo_1.campo)({
65
- value: ModFrete(transp.modFrete),
66
- x: 164,
67
- y: y + 17.5,
68
- largura: 100,
69
- ajusteX,
70
- ajusteY,
71
- doc,
72
- margemEsquerda,
73
- margemTopo,
74
- tamanho: 8.4
75
- });
76
- (0, titulo_1.titulo)({ value: 'CÓDIGO ANTT', x: 259.5, y: y + 9.5, largura: 84, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
77
- (0, campo_1.campo)({ value: transp.veicTransp?.RNTC ?? '', x: 259.5, y: y + 17.5, largura: 84, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
78
- (0, titulo_1.titulo)({ value: 'PLACA DO VEÍCULO', x: 347.5, y: y + 9.5, largura: 84, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
79
- (0, campo_1.campo)({
80
- value: (0, utils_1.formatLicensePlate)(transp.veicTransp?.placa ?? ''),
81
- x: 347.5,
82
- y: y + 17.5,
83
- largura: 84,
84
- ajusteX,
85
- ajusteY,
86
- doc,
87
- margemEsquerda,
88
- margemTopo
89
- });
90
- (0, titulo_1.titulo)({ value: 'UF', x: 435.5, y: y + 9.5, largura: 19.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
91
- (0, campo_1.campo)({ value: transp.veicTransp?.UF ?? '', x: 435.5, y: y + 17.5, largura: 19.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
92
- (0, titulo_1.titulo)({ value: 'CNPJ / CPF', x: 458, y: y + 9.5, largura: 126.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
93
- (0, campo_1.campo)({
94
- value: (0, utils_1.formatCnpj)(transp.transporta?.CNPJ ?? ''),
95
- x: 458,
96
- y: y + 17.5,
97
- largura: 126.5,
98
- ajusteX,
99
- ajusteY,
100
- doc,
101
- margemEsquerda,
102
- margemTopo
103
- });
104
- (0, campo_1.campo)({
105
- value: (0, utils_1.formatCpf)(transp.transporta?.CPF ?? ''),
106
- x: 458,
107
- y: y + 17.5,
108
- largura: 126.5,
109
- ajusteX,
110
- ajusteY,
111
- doc,
112
- margemEsquerda,
113
- margemTopo
114
- });
115
- (0, titulo_1.titulo)({ value: 'ENDEREÇO', x: 1.5, y: y + 30, largura: 254, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
116
- (0, campo_1.campo)({
117
- value: transp.transporta?.xEnder ?? '',
118
- x: 1.5,
119
- y: y + 38.5,
120
- largura: 254,
121
- alinhamento: 'left',
122
- tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDoCampo - 0.5,
123
- ajusteX,
124
- ajusteY,
125
- doc,
126
- margemEsquerda,
127
- margemTopo
128
- });
129
- (0, titulo_1.titulo)({ value: 'MUNICÍPIO', x: 259.5, y: y + 30, largura: 172, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
130
- (0, campo_1.campo)({ value: transp.transporta?.xMun ?? '', x: 259.5, y: y + 38.5, largura: 172, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
131
- (0, titulo_1.titulo)({ value: 'UF', x: 435.5, y: y + 30, largura: 19.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
132
- (0, campo_1.campo)({ value: transp.transporta?.uf ?? '', x: 435.5, y: y + 38.5, largura: 19.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
133
- (0, titulo_1.titulo)({ value: 'INSCRIÇÃO ESTADUAL', x: 458, y: y + 30, largura: 126.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
134
- (0, campo_1.campo)({
135
- value: (0, utils_1.formatStateRegistration)(transp.transporta?.ie ?? ''),
136
- x: 458,
137
- y: y + 38.5,
138
- largura: 126.5,
139
- ajusteX,
140
- ajusteY,
141
- doc,
142
- margemEsquerda,
143
- margemTopo
144
- });
145
- (0, titulo_1.titulo)({ value: 'QUANTIDADE', x: 1.5, y: y + 50, largura: 56.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
146
- (0, campo_1.campo)({ value: transp.vol?.qVol ?? '', x: 1.5, y: y + 58, largura: 56.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
147
- (0, titulo_1.titulo)({ value: 'ESPÉCIE', x: 60.8, y: y + 50, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
148
- (0, campo_1.campo)({ value: transp.vol?.esp ?? '', x: 60.8, y: y + 58, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
149
- (0, titulo_1.titulo)({ value: 'MARCA', x: 160, y: y + 50, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
150
- (0, campo_1.campo)({ value: transp.vol?.marca ?? '', x: 160, y: y + 58, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
151
- (0, titulo_1.titulo)({ value: 'NUMERAÇÃO', x: 259.5, y: y + 50, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
152
- (0, campo_1.campo)({ value: transp.vol?.nVol ?? '', x: 259.5, y: y + 58, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
153
- (0, titulo_1.titulo)({ value: 'PESO BRUTO', x: 358.5, y: y + 50, largura: 112.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
154
- (0, campo_1.campo)({
155
- value: transp.vol?.pesoB ? (0, utils_1.formatNumber)(transp.vol?.pesoB, 3) : '',
156
- x: 358.5,
157
- y: y + 58,
158
- largura: 112.5,
159
- ajusteX,
160
- ajusteY,
161
- doc,
162
- margemEsquerda,
163
- margemTopo
164
- });
165
- (0, titulo_1.titulo)({ value: 'PESO LÍQUIDO', x: 474.5, y: y + 50, largura: 110.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
166
- (0, campo_1.campo)({
167
- value: transp.vol?.pesoL ? (0, utils_1.formatNumber)(transp.vol?.pesoL, 3) : '',
168
- x: 474.5,
169
- y: y + 58,
170
- largura: 110.5,
171
- ajusteX,
172
- ajusteY,
173
- doc,
174
- margemEsquerda,
175
- margemTopo
176
- });
177
- return doc.y;
178
- }
179
- exports.getTransporte = getTransporte;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTransporte = getTransporte;
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
+ (0, campo_1.campo)({
30
+ value: transp.transporta?.xNome ?? '',
31
+ x: 1.5,
32
+ y: y + 17.5,
33
+ largura: 166.5,
34
+ alinhamento: 'left',
35
+ tamanho: (0, utils_1.returnFontSizeCarrier)(transp.transporta?.xNome ?? ''),
36
+ ajusteX,
37
+ ajusteY,
38
+ doc,
39
+ margemEsquerda,
40
+ margemTopo
41
+ });
42
+ function ModFrete(value) {
43
+ if (value === '0') {
44
+ return '0 - Por conta do Remet';
45
+ }
46
+ else if (value === '1') {
47
+ return '1 - Por conta do Dest';
48
+ }
49
+ else if (value === '2') {
50
+ return '2 - Por conta de Terc';
51
+ }
52
+ else if (value === '3') {
53
+ return '3 - Por conta do Remet';
54
+ }
55
+ else if (value === '4') {
56
+ return '4 - Por conta do Dest';
57
+ }
58
+ else if (value === '9') {
59
+ return '9 - Sem Ocorr de Transp';
60
+ }
61
+ return '';
62
+ }
63
+ (0, titulo_1.titulo)({ value: 'FRETE POR CONTA', x: 171.5, y: y + 9.5, largura: 85, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
64
+ (0, campo_1.campo)({
65
+ value: ModFrete(transp.modFrete),
66
+ x: 164,
67
+ y: y + 17.5,
68
+ largura: 100,
69
+ ajusteX,
70
+ ajusteY,
71
+ doc,
72
+ margemEsquerda,
73
+ margemTopo,
74
+ tamanho: 8.4
75
+ });
76
+ (0, titulo_1.titulo)({ value: 'CÓDIGO ANTT', x: 259.5, y: y + 9.5, largura: 84, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
77
+ (0, campo_1.campo)({ value: transp.veicTransp?.RNTC ?? '', x: 259.5, y: y + 17.5, largura: 84, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
78
+ (0, titulo_1.titulo)({ value: 'PLACA DO VEÍCULO', x: 347.5, y: y + 9.5, largura: 84, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
79
+ (0, campo_1.campo)({
80
+ value: (0, utils_1.formatLicensePlate)(transp.veicTransp?.placa ?? ''),
81
+ x: 347.5,
82
+ y: y + 17.5,
83
+ largura: 84,
84
+ ajusteX,
85
+ ajusteY,
86
+ doc,
87
+ margemEsquerda,
88
+ margemTopo
89
+ });
90
+ (0, titulo_1.titulo)({ value: 'UF', x: 435.5, y: y + 9.5, largura: 19.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
91
+ (0, campo_1.campo)({ value: transp.veicTransp?.UF ?? '', x: 435.5, y: y + 17.5, largura: 19.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
92
+ (0, titulo_1.titulo)({ value: 'CNPJ / CPF', x: 458, y: y + 9.5, largura: 126.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
93
+ (0, campo_1.campo)({
94
+ value: (0, utils_1.formatCnpj)(transp.transporta?.CNPJ ?? ''),
95
+ x: 458,
96
+ y: y + 17.5,
97
+ largura: 126.5,
98
+ ajusteX,
99
+ ajusteY,
100
+ doc,
101
+ margemEsquerda,
102
+ margemTopo
103
+ });
104
+ (0, campo_1.campo)({
105
+ value: (0, utils_1.formatCpf)(transp.transporta?.CPF ?? ''),
106
+ x: 458,
107
+ y: y + 17.5,
108
+ largura: 126.5,
109
+ ajusteX,
110
+ ajusteY,
111
+ doc,
112
+ margemEsquerda,
113
+ margemTopo
114
+ });
115
+ (0, titulo_1.titulo)({ value: 'ENDEREÇO', x: 1.5, y: y + 30, largura: 254, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
116
+ (0, campo_1.campo)({
117
+ value: transp.transporta?.xEnder ?? '',
118
+ x: 1.5,
119
+ y: y + 38.5,
120
+ largura: 254,
121
+ alinhamento: 'left',
122
+ tamanho: default_1.DEFAULT_NFE.tamanhoDaFonteDoCampo - 0.5,
123
+ ajusteX,
124
+ ajusteY,
125
+ doc,
126
+ margemEsquerda,
127
+ margemTopo
128
+ });
129
+ (0, titulo_1.titulo)({ value: 'MUNICÍPIO', x: 259.5, y: y + 30, largura: 172, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
130
+ (0, campo_1.campo)({ value: transp.transporta?.xMun ?? '', x: 259.5, y: y + 38.5, largura: 172, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
131
+ (0, titulo_1.titulo)({ value: 'UF', x: 435.5, y: y + 30, largura: 19.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
132
+ (0, campo_1.campo)({ value: transp.transporta?.uf ?? '', x: 435.5, y: y + 38.5, largura: 19.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
133
+ (0, titulo_1.titulo)({ value: 'INSCRIÇÃO ESTADUAL', x: 458, y: y + 30, largura: 126.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
134
+ (0, campo_1.campo)({
135
+ value: (0, utils_1.formatStateRegistration)(transp.transporta?.ie ?? ''),
136
+ x: 458,
137
+ y: y + 38.5,
138
+ largura: 126.5,
139
+ ajusteX,
140
+ ajusteY,
141
+ doc,
142
+ margemEsquerda,
143
+ margemTopo
144
+ });
145
+ (0, titulo_1.titulo)({ value: 'QUANTIDADE', x: 1.5, y: y + 50, largura: 56.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
146
+ (0, campo_1.campo)({ value: transp.vol?.qVol ?? '', x: 1.5, y: y + 58, largura: 56.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
147
+ (0, titulo_1.titulo)({ value: 'ESPÉCIE', x: 60.8, y: y + 50, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
148
+ (0, campo_1.campo)({ value: transp.vol?.esp ?? '', x: 60.8, y: y + 58, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
149
+ (0, titulo_1.titulo)({ value: 'MARCA', x: 160, y: y + 50, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
150
+ (0, campo_1.campo)({ value: transp.vol?.marca ?? '', x: 160, y: y + 58, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
151
+ (0, titulo_1.titulo)({ value: 'NUMERAÇÃO', x: 259.5, y: y + 50, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
152
+ (0, campo_1.campo)({ value: transp.vol?.nVol ?? '', x: 259.5, y: y + 58, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
153
+ (0, titulo_1.titulo)({ value: 'PESO BRUTO', x: 358.5, y: y + 50, largura: 112.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
154
+ (0, campo_1.campo)({
155
+ value: transp.vol?.pesoB ? (0, utils_1.formatNumber)(transp.vol?.pesoB, 3) : '',
156
+ x: 358.5,
157
+ y: y + 58,
158
+ largura: 112.5,
159
+ ajusteX,
160
+ ajusteY,
161
+ doc,
162
+ margemEsquerda,
163
+ margemTopo
164
+ });
165
+ (0, titulo_1.titulo)({ value: 'PESO LÍQUIDO', x: 474.5, y: y + 50, largura: 110.5, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
166
+ (0, campo_1.campo)({
167
+ value: transp.vol?.pesoL ? (0, utils_1.formatNumber)(transp.vol?.pesoL, 3) : '',
168
+ x: 474.5,
169
+ y: y + 58,
170
+ largura: 110.5,
171
+ ajusteX,
172
+ ajusteY,
173
+ doc,
174
+ margemEsquerda,
175
+ margemTopo
176
+ });
177
+ return doc.y;
178
+ }
@@ -1,16 +1,15 @@
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
7
- .font('italico')
8
- .fillColor(default_1.DEFAULT_NFE.corDoTitulo)
9
- .fontSize(tamanho ?? 6)
10
- .text(value ?? '', margemEsquerda + ajusteX + x, margemTopo + ajusteY + y, {
11
- width: largura,
12
- align: alinhamento ?? 'center',
13
- lineGap: -1.5
14
- });
15
- }
16
- exports.italico = italico;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.italico = italico;
4
+ const default_1 = require("./default");
5
+ function italico({ ajusteX, ajusteY, doc, largura, margemEsquerda, margemTopo, value, x, y, alinhamento, tamanho }) {
6
+ doc
7
+ .font('italico')
8
+ .fillColor(default_1.DEFAULT_NFE.corDoTitulo)
9
+ .fontSize(tamanho ?? 6)
10
+ .text(value ?? '', margemEsquerda + ajusteX + x, margemTopo + ajusteY + y, {
11
+ width: largura,
12
+ align: alinhamento ?? 'center',
13
+ lineGap: -1.5
14
+ });
15
+ }
@@ -1,8 +1,7 @@
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;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.linhaHorizontalTracejada = linhaHorizontalTracejada;
4
+ const linha_horizontal_1 = require("./linha-horizontal");
5
+ function linhaHorizontalTracejada(input) {
6
+ (0, linha_horizontal_1.linhaHorizontal)({ ...input, tracejada: false });
7
+ }
@@ -1,16 +1,15 @@
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;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.linhaHorizontal = linhaHorizontal;
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
+ }
@@ -1,10 +1,9 @@
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;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.linhaVertical = linhaVertical;
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
+ }
@@ -1,31 +1,30 @@
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;
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.loadFonts = loadFonts;
7
+ exports.loadFontsNFCe = loadFontsNFCe;
8
+ const path_1 = __importDefault(require("path"));
9
+ function loadFonts(doc) {
10
+ const diretorioDeFontes = path_1.default.join(__dirname, './../fontes');
11
+ const timesNewRoman = path_1.default.join(diretorioDeFontes, 'Times New Roman.ttf');
12
+ const timesNewRomanNegrito = path_1.default.join(diretorioDeFontes, 'Times New Roman Bold.ttf');
13
+ const timesNewRomanItalico = path_1.default.join(diretorioDeFontes, 'Times New Roman Italic.ttf');
14
+ const timesNewRomanNegritoItalico = path_1.default.join(diretorioDeFontes, 'Times New Roman Bold Italic.ttf');
15
+ doc.registerFont('normal', timesNewRoman);
16
+ doc.registerFont('negrito', timesNewRomanNegrito);
17
+ doc.registerFont('italico', timesNewRomanItalico);
18
+ doc.registerFont('negrito-italico', timesNewRomanNegritoItalico);
19
+ }
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
+ }
@@ -1,16 +1,15 @@
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
7
- .font('negrito')
8
- .fillColor(default_1.DEFAULT_NFE.corDoTitulo)
9
- .fontSize(tamanho ?? 6)
10
- .text(value, margemEsquerda + ajusteX + x, margemTopo + ajusteY + y, {
11
- width: largura,
12
- align: alinhamento ?? 'center',
13
- lineGap: -1.5
14
- });
15
- }
16
- exports.negrito = negrito;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.negrito = negrito;
4
+ const default_1 = require("./default");
5
+ function negrito({ ajusteX, ajusteY, doc, largura, margemEsquerda, margemTopo, value, x, y, alinhamento, tamanho }) {
6
+ doc
7
+ .font('negrito')
8
+ .fillColor(default_1.DEFAULT_NFE.corDoTitulo)
9
+ .fontSize(tamanho ?? 6)
10
+ .text(value, margemEsquerda + ajusteX + x, margemTopo + ajusteY + y, {
11
+ width: largura,
12
+ align: alinhamento ?? 'center',
13
+ lineGap: -1.5
14
+ });
15
+ }
@@ -1,16 +1,15 @@
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
7
- .font('normal')
8
- .fillColor(default_1.DEFAULT_NFE.corDoTitulo)
9
- .fontSize(tamanho ?? 8)
10
- .text(value ?? '', margemEsquerda + ajusteX + x, margemTopo + ajusteY + y, {
11
- width: largura,
12
- align: alinhamento ?? 'center',
13
- lineGap: -1.5
14
- });
15
- }
16
- exports.normal = normal;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normal = normal;
4
+ const default_1 = require("./default");
5
+ function normal({ ajusteX, ajusteY, doc, largura, margemEsquerda, margemTopo, value, x, y, alinhamento, tamanho }) {
6
+ doc
7
+ .font('normal')
8
+ .fillColor(default_1.DEFAULT_NFE.corDoTitulo)
9
+ .fontSize(tamanho ?? 8)
10
+ .text(value ?? '', margemEsquerda + ajusteX + x, margemTopo + ajusteY + y, {
11
+ width: largura,
12
+ align: alinhamento ?? 'center',
13
+ lineGap: -1.5
14
+ });
15
+ }
@@ -1,14 +1,14 @@
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
- };
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
+ };