@alexssmusica/node-pdf-nfe 1.2.3 → 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 -102
  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 +32 -28
  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,154 +1,153 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDestinatarioRemetente = 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 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: (0, utils_1.formatCpf)(dest.CPF ?? ''),
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: (0, utils_1.formatCnpj)(dest.CNPJ ?? ''),
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, utils_1.formatDate)(ide.dhEmi),
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)({
79
- value: (0, utils_1.formatPostalCode)(dest.enderDest?.CEP ?? ''),
80
- x: 398,
81
- y: y + 38,
82
- largura: 93,
83
- ajusteX,
84
- ajusteY,
85
- doc,
86
- margemEsquerda,
87
- margemTopo
88
- });
89
- (0, titulo_1.titulo)({ value: 'DATA DA SAÍDA', x: 495, y: y + 30, largura: 90, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
90
- (0, campo_1.campo)({
91
- value: ide.dhSaiEnt !== undefined ? (0, utils_1.formatDate)(ide.dhSaiEnt) : '',
92
- x: 495,
93
- y: y + 38,
94
- largura: 90,
95
- ajusteX,
96
- ajusteY,
97
- doc,
98
- margemEsquerda,
99
- margemTopo
100
- });
101
- (0, titulo_1.titulo)({ value: 'MUNICÍPIO', x: 1.5, y: y + 51, largura: 272, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
102
- (0, campo_1.campo)({
103
- value: dest.enderDest?.xMun ?? '',
104
- x: 1.5,
105
- y: y + 58,
106
- largura: 272,
107
- alinhamento: 'left',
108
- ajusteX,
109
- ajusteY,
110
- doc,
111
- margemEsquerda,
112
- margemTopo
113
- });
114
- (0, titulo_1.titulo)({ value: 'UF', x: 276, y: y + 51, largura: 20, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
115
- (0, campo_1.campo)({ value: dest.enderDest?.UF ?? '', x: 276, y: y + 58, largura: 20, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
116
- (0, titulo_1.titulo)({ value: 'FONE / FAX', x: 299, y: y + 51, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
117
- (0, campo_1.campo)({
118
- value: (0, utils_1.formatPhone)(dest.enderDest?.fone ?? ''),
119
- x: 299,
120
- y: y + 58,
121
- largura: 96,
122
- ajusteX,
123
- ajusteY,
124
- doc,
125
- margemEsquerda,
126
- margemTopo
127
- });
128
- (0, titulo_1.titulo)({ value: 'INSCRIÇÃO ESTADUAL', x: 398, y: y + 51, largura: 93, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
129
- (0, campo_1.campo)({
130
- value: (0, utils_1.formatStateRegistration)(dest?.IE ?? ''),
131
- x: 398,
132
- y: y + 58,
133
- largura: 93,
134
- ajusteX,
135
- ajusteY,
136
- doc,
137
- margemEsquerda,
138
- margemTopo
139
- });
140
- (0, titulo_1.titulo)({ value: 'HORA DA SAÍDA', x: 495, y: y + 51, largura: 90, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
141
- (0, campo_1.campo)({
142
- value: ide.dhSaiEnt !== undefined ? (0, utils_1.formatTime)(ide.dhSaiEnt) : '',
143
- x: 495,
144
- y: y + 58,
145
- largura: 90,
146
- ajusteX,
147
- ajusteY,
148
- doc,
149
- margemEsquerda,
150
- margemTopo
151
- });
152
- return doc.y;
153
- }
154
- exports.getDestinatarioRemetente = getDestinatarioRemetente;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDestinatarioRemetente = getDestinatarioRemetente;
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 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: (0, utils_1.formatCpf)(dest.CPF ?? ''),
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: (0, utils_1.formatCnpj)(dest.CNPJ ?? ''),
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, utils_1.formatDate)(ide.dhEmi),
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)({
79
+ value: (0, utils_1.formatPostalCode)(dest.enderDest?.CEP ?? ''),
80
+ x: 398,
81
+ y: y + 38,
82
+ largura: 93,
83
+ ajusteX,
84
+ ajusteY,
85
+ doc,
86
+ margemEsquerda,
87
+ margemTopo
88
+ });
89
+ (0, titulo_1.titulo)({ value: 'DATA DA SAÍDA', x: 495, y: y + 30, largura: 90, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
90
+ (0, campo_1.campo)({
91
+ value: ide.dhSaiEnt !== undefined ? (0, utils_1.formatDate)(ide.dhSaiEnt) : '',
92
+ x: 495,
93
+ y: y + 38,
94
+ largura: 90,
95
+ ajusteX,
96
+ ajusteY,
97
+ doc,
98
+ margemEsquerda,
99
+ margemTopo
100
+ });
101
+ (0, titulo_1.titulo)({ value: 'MUNICÍPIO', x: 1.5, y: y + 51, largura: 272, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
102
+ (0, campo_1.campo)({
103
+ value: dest.enderDest?.xMun ?? '',
104
+ x: 1.5,
105
+ y: y + 58,
106
+ largura: 272,
107
+ alinhamento: 'left',
108
+ ajusteX,
109
+ ajusteY,
110
+ doc,
111
+ margemEsquerda,
112
+ margemTopo
113
+ });
114
+ (0, titulo_1.titulo)({ value: 'UF', x: 276, y: y + 51, largura: 20, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
115
+ (0, campo_1.campo)({ value: dest.enderDest?.UF ?? '', x: 276, y: y + 58, largura: 20, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
116
+ (0, titulo_1.titulo)({ value: 'FONE / FAX', x: 299, y: y + 51, largura: 96, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
117
+ (0, campo_1.campo)({
118
+ value: (0, utils_1.formatPhone)(dest.enderDest?.fone ?? ''),
119
+ x: 299,
120
+ y: y + 58,
121
+ largura: 96,
122
+ ajusteX,
123
+ ajusteY,
124
+ doc,
125
+ margemEsquerda,
126
+ margemTopo
127
+ });
128
+ (0, titulo_1.titulo)({ value: 'INSCRIÇÃO ESTADUAL', x: 398, y: y + 51, largura: 93, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
129
+ (0, campo_1.campo)({
130
+ value: (0, utils_1.formatStateRegistration)(dest?.IE ?? ''),
131
+ x: 398,
132
+ y: y + 58,
133
+ largura: 93,
134
+ ajusteX,
135
+ ajusteY,
136
+ doc,
137
+ margemEsquerda,
138
+ margemTopo
139
+ });
140
+ (0, titulo_1.titulo)({ value: 'HORA DA SAÍDA', x: 495, y: y + 51, largura: 90, ajusteX, ajusteY, doc, margemEsquerda, margemTopo });
141
+ (0, campo_1.campo)({
142
+ value: ide.dhSaiEnt !== undefined ? (0, utils_1.formatTime)(ide.dhSaiEnt) : '',
143
+ x: 495,
144
+ y: y + 58,
145
+ largura: 90,
146
+ ajusteX,
147
+ ajusteY,
148
+ doc,
149
+ margemEsquerda,
150
+ margemTopo
151
+ });
152
+ return doc.y;
153
+ }
@@ -1,64 +1,63 @@
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
15
- .font('negrito')
16
- .fillColor(default_1.DEFAULT_NFE.corDoTitulo)
17
- .fontSize(8)
18
- .text('Número da Fatura:', 5, y + 24, {
19
- width: larguraDoFormulario - 5,
20
- align: 'justify',
21
- lineGap: -1.5,
22
- continued: true
23
- })
24
- .font('normal')
25
- .text(cobr.fat.nFat, { continued: true })
26
- .font('negrito')
27
- .text(' Valor Original:', { continued: true })
28
- .font('normal')
29
- .text(` ${(0, utils_1.formatNumber)(cobr.fat.vOrig, 2)}`, { continued: true })
30
- .font('negrito')
31
- .text(' Valor Desconto:', { continued: true })
32
- .font('normal')
33
- .text(` ${(0, utils_1.formatNumber)(cobr.fat.vDesc, 2)}`, { continued: true })
34
- .font('negrito')
35
- .text(' Valor Líquido:', { continued: true })
36
- .font('normal')
37
- .text(` ${(0, utils_1.formatNumber)(cobr.fat.vLiq, 2)}.`, { continued: true });
38
- }
39
- if (cobr.dup !== undefined) {
40
- cobr.dup.forEach((dup, index) => {
41
- doc.font('negrito').text(' Duplicata:', { continued: true }).font('normal').text(` ${dup.nDup}`, { continued: true });
42
- doc
43
- .font('negrito')
44
- .text(' Valor:', { continued: true })
45
- .font('normal')
46
- .text(` ${(0, utils_1.formatNumber)(dup.vDup, 2)}`, { continued: true });
47
- doc
48
- .font('negrito')
49
- .text(' Vencimento:', { continued: true })
50
- .font('normal')
51
- .text(` ${(0, date_fns_1.format)((0, date_fns_1.parseISO)(dup.dVenc), 'dd/MM/yyyy')}`, { continued: true });
52
- if (index === cobr.dup.length - 1) {
53
- doc.text('');
54
- }
55
- });
56
- }
57
- (0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 20, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
58
- (0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: doc.y + 6, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
59
- (0, linha_vertical_1.linhaVertical)({ y1: y + 20, y2: doc.y + 6, x: 0, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
60
- (0, linha_vertical_1.linhaVertical)({ y1: y + 20, y2: doc.y + 6, x: larguraDoFormulario, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
61
- }
62
- return doc.y;
63
- }
64
- exports.getFaturaDuplicata = getFaturaDuplicata;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFaturaDuplicata = getFaturaDuplicata;
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
15
+ .font('negrito')
16
+ .fillColor(default_1.DEFAULT_NFE.corDoTitulo)
17
+ .fontSize(8)
18
+ .text('Número da Fatura:', 5, y + 24, {
19
+ width: larguraDoFormulario - 5,
20
+ align: 'justify',
21
+ lineGap: -1.5,
22
+ continued: true
23
+ })
24
+ .font('normal')
25
+ .text(cobr.fat.nFat, { continued: true })
26
+ .font('negrito')
27
+ .text(' Valor Original:', { continued: true })
28
+ .font('normal')
29
+ .text(` ${(0, utils_1.formatNumber)(cobr.fat.vOrig, 2)}`, { continued: true })
30
+ .font('negrito')
31
+ .text(' Valor Desconto:', { continued: true })
32
+ .font('normal')
33
+ .text(` ${(0, utils_1.formatNumber)(cobr.fat.vDesc, 2)}`, { continued: true })
34
+ .font('negrito')
35
+ .text(' Valor Líquido:', { continued: true })
36
+ .font('normal')
37
+ .text(` ${(0, utils_1.formatNumber)(cobr.fat.vLiq, 2)}.`, { continued: true });
38
+ }
39
+ if (cobr.dup !== undefined) {
40
+ cobr.dup.forEach((dup, index) => {
41
+ doc.font('negrito').text(' Duplicata:', { continued: true }).font('normal').text(` ${dup.nDup}`, { continued: true });
42
+ doc
43
+ .font('negrito')
44
+ .text(' Valor:', { continued: true })
45
+ .font('normal')
46
+ .text(` ${(0, utils_1.formatNumber)(dup.vDup, 2)}`, { continued: true });
47
+ doc
48
+ .font('negrito')
49
+ .text(' Vencimento:', { continued: true })
50
+ .font('normal')
51
+ .text(` ${(0, date_fns_1.format)((0, date_fns_1.parseISO)(dup.dVenc), 'dd/MM/yyyy')}`, { continued: true });
52
+ if (index === cobr.dup.length - 1) {
53
+ doc.text('');
54
+ }
55
+ });
56
+ }
57
+ (0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: y + 20, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
58
+ (0, linha_horizontal_1.linhaHorizontal)({ x1: 0, x2: 0, y: doc.y + 6, doc, ajusteX, ajusteY, margemDireita, margemEsquerda, margemTopo });
59
+ (0, linha_vertical_1.linhaVertical)({ y1: y + 20, y2: doc.y + 6, x: 0, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
60
+ (0, linha_vertical_1.linhaVertical)({ y1: y + 20, y2: doc.y + 6, x: larguraDoFormulario, doc, ajusteX, ajusteY, margemEsquerda, margemTopo });
61
+ }
62
+ return doc.y;
63
+ }
@@ -1,37 +1,36 @@
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, cancelada }) {
6
- doc
7
- .font('normal')
8
- .fillColor(default_1.DEFAULT_NFE.corDoTitulo)
9
- .fontSize(38)
10
- .fillOpacity(default_1.DEFAULT_NFE.opacidadeDaHomologacao)
11
- .text('EMITIDA EM HOMOLOGAÇÃO', margemEsquerda + ajusteX + 0, margemTopo + ajusteY + 200 + default_1.DEFAULT_NFE.ajusteYDaHomologacao, {
12
- width: larguraDoFormulario,
13
- align: 'center'
14
- });
15
- doc
16
- .font('normal')
17
- .fillColor(default_1.DEFAULT_NFE.corDoTitulo)
18
- .fontSize(25)
19
- .fillOpacity(default_1.DEFAULT_NFE.opacidadeDaHomologacao)
20
- .text(protNFe !== undefined ? 'SEM VALOR FISCAL' : 'NÃO ENVIADA PARA SEFAZ', margemEsquerda + ajusteX + 0, margemTopo + ajusteY + 250 + default_1.DEFAULT_NFE.ajusteYDaHomologacao, {
21
- width: larguraDoFormulario,
22
- align: 'center'
23
- });
24
- if (cancelada) {
25
- doc
26
- .font('normal')
27
- .fillColor(default_1.DEFAULT_NFE.corDoTitulo)
28
- .fontSize(38)
29
- .fillOpacity(default_1.DEFAULT_NFE.opacidadeDaHomologacao)
30
- .text('CANCELADA', margemEsquerda + ajusteX + 0, margemTopo + ajusteY + 300 + default_1.DEFAULT_NFE.ajusteYDaHomologacao, {
31
- width: larguraDoFormulario,
32
- align: 'center'
33
- });
34
- }
35
- doc.fillOpacity(100);
36
- }
37
- exports.getHomologacao = getHomologacao;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getHomologacao = getHomologacao;
4
+ const default_1 = require("./default");
5
+ function getHomologacao({ doc, ajusteX, ajusteY, margemEsquerda, margemTopo, larguraDoFormulario, protNFe, cancelada }) {
6
+ doc
7
+ .font('normal')
8
+ .fillColor(default_1.DEFAULT_NFE.corDoTitulo)
9
+ .fontSize(38)
10
+ .fillOpacity(default_1.DEFAULT_NFE.opacidadeDaHomologacao)
11
+ .text('EMITIDA EM HOMOLOGAÇÃO', margemEsquerda + ajusteX + 0, margemTopo + ajusteY + 200 + default_1.DEFAULT_NFE.ajusteYDaHomologacao, {
12
+ width: larguraDoFormulario,
13
+ align: 'center'
14
+ });
15
+ doc
16
+ .font('normal')
17
+ .fillColor(default_1.DEFAULT_NFE.corDoTitulo)
18
+ .fontSize(25)
19
+ .fillOpacity(default_1.DEFAULT_NFE.opacidadeDaHomologacao)
20
+ .text(protNFe !== undefined ? 'SEM VALOR FISCAL' : 'NÃO ENVIADA PARA SEFAZ', margemEsquerda + ajusteX + 0, margemTopo + ajusteY + 250 + default_1.DEFAULT_NFE.ajusteYDaHomologacao, {
21
+ width: larguraDoFormulario,
22
+ align: 'center'
23
+ });
24
+ if (cancelada) {
25
+ doc
26
+ .font('normal')
27
+ .fillColor(default_1.DEFAULT_NFE.corDoTitulo)
28
+ .fontSize(38)
29
+ .fillOpacity(default_1.DEFAULT_NFE.opacidadeDaHomologacao)
30
+ .text('CANCELADA', margemEsquerda + ajusteX + 0, margemTopo + ajusteY + 300 + default_1.DEFAULT_NFE.ajusteYDaHomologacao, {
31
+ width: larguraDoFormulario,
32
+ align: 'center'
33
+ });
34
+ }
35
+ doc.fillOpacity(100);
36
+ }