@facturacr/atv-sdk 2.0.0-alpha → 2.0.1-alpha

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 (106) hide show
  1. package/.eslintignore +3 -0
  2. package/.eslintrc.js +23 -23
  3. package/.github/dependabot.yml +11 -0
  4. package/.github/workflows/ci.yml +14 -12
  5. package/README.md +9 -2
  6. package/__tests__/stubs/commonExpectedXml.xml +14 -16
  7. package/__tests__/stubs/createDocument.data.ts +18 -1
  8. package/__tests__/stubs/frontendRequest.stub.ts +0 -1
  9. package/__tests__/stubs/token.stub.ts +9 -9
  10. package/__tests__/tests/ATV/__snapshots__/create-document.test.ts.snap +1 -1
  11. package/__tests__/tests/ATV/create-document.test.ts +8 -8
  12. package/__tests__/tests/ATV/create-receptor-message.test.ts +41 -36
  13. package/dist/src/ATV/core/CreateDocFactory.d.ts +11 -3
  14. package/dist/src/ATV/core/CreateDocFactory.js +3 -3
  15. package/dist/src/ATV/core/CreateDocFactory.js.map +1 -1
  16. package/dist/src/ATV/core/Document.d.ts +2 -2
  17. package/dist/src/ATV/core/Document.js +7 -4
  18. package/dist/src/ATV/core/Document.js.map +1 -1
  19. package/dist/src/ATV/core/DocumentType.d.ts +2 -3
  20. package/dist/src/ATV/core/DocumentType.js +1 -0
  21. package/dist/src/ATV/core/DocumentType.js.map +1 -1
  22. package/dist/src/ATV/core/FullConsecutive.d.ts +2 -1
  23. package/dist/src/ATV/core/FullConsecutive.js.map +1 -1
  24. package/dist/src/ATV/core/OrderLine.js +8 -1
  25. package/dist/src/ATV/core/OrderLine.js.map +1 -1
  26. package/dist/src/ATV/core/Person.d.ts +2 -2
  27. package/dist/src/ATV/core/ReceptorConsecutive.js.map +1 -1
  28. package/dist/src/ATV/core/ReferenceInformation.js.map +1 -1
  29. package/dist/src/ATV/core/types.d.ts +3 -2
  30. package/dist/src/ATV/core/types.js.map +1 -1
  31. package/dist/src/ATV/index.d.ts +2 -2
  32. package/dist/src/ATV/index.js +2 -2
  33. package/dist/src/ATV/mappers/billDocToAtv.js +32 -26
  34. package/dist/src/ATV/mappers/billDocToAtv.js.map +1 -1
  35. package/dist/src/ATV/types.d.ts +1 -1
  36. package/dist/src/ATV/useCases/createDocument/index.js +5 -9
  37. package/dist/src/ATV/useCases/createDocument/index.js.map +1 -1
  38. package/dist/src/ATV/useCases/createDocument/types.d.ts +4 -3
  39. package/dist/src/ATV/useCases/createReceptorMessage/index.d.ts +6 -5
  40. package/dist/src/ATV/useCases/createReceptorMessage/index.js +3 -3
  41. package/dist/src/ATV/useCases/createReceptorMessage/index.js.map +1 -1
  42. package/dist/src/helpers/comprobantes.js +10 -1
  43. package/dist/src/helpers/comprobantes.js.map +1 -1
  44. package/dist/src/lib/genClave/index.d.ts +8 -1
  45. package/dist/src/lib/genClave/index.js +5 -0
  46. package/dist/src/lib/genClave/index.js.map +1 -1
  47. package/dist/src/lib/genXML/index.js +6 -4
  48. package/dist/src/lib/genXML/index.js.map +1 -1
  49. package/dist/src/lib/genXML/sigXML/index.js +7 -4
  50. package/dist/src/lib/genXML/sigXML/index.js.map +1 -1
  51. package/dist/src/services/getToken/GetToken.js +0 -3
  52. package/dist/src/services/getToken/GetToken.js.map +1 -1
  53. package/dist/src/services/getToken/__tests__/GetToken.test.js +0 -1
  54. package/dist/src/services/getToken/__tests__/GetToken.test.js.map +1 -1
  55. package/dist/src/types/facturaInterfaces.d.ts +3 -3
  56. package/dist/src/xmlSchemaHeaderMap.d.ts +70 -0
  57. package/dist/src/xmlSchemaHeaderMap.js +30 -0
  58. package/dist/src/xmlSchemaHeaderMap.js.map +1 -0
  59. package/doc/atv-structures/4.3/FacturaElectronica_V4.3.xsd.xml +1633 -478
  60. package/doc/atv-structures/4.4/TiqueteElectronico_V4.4.xsd.xml +2817 -0
  61. package/doc/json-schemas/4.4/fe.json +544 -0
  62. package/doc/json-schemas/4.4/te.json +420 -0
  63. package/doc/testing.md +27 -0
  64. package/examples/README.md +10 -35
  65. package/examples/atvAccept.ts +18 -9
  66. package/examples/consultXML.ts +1 -0
  67. package/examples/{createAndSend.ts → createAndSendFE.ts} +11 -8
  68. package/examples/createAndSendTE.ts +73 -0
  69. package/examples/createCreditNote.ts +10 -6
  70. package/examples/createDebitNote.ts +2 -0
  71. package/examples/getToken.ts +2 -0
  72. package/package.json +3 -2
  73. package/src/ATV/core/CreateDocFactory.ts +32 -23
  74. package/src/ATV/core/Document.ts +7 -7
  75. package/src/ATV/core/DocumentType.ts +10 -3
  76. package/src/ATV/core/FullConsecutive.ts +2 -1
  77. package/src/ATV/core/OrderLine.ts +7 -1
  78. package/src/ATV/core/Person.ts +2 -2
  79. package/src/ATV/core/ReceptorConsecutive.ts +16 -16
  80. package/src/ATV/core/ReferenceInformation.ts +6 -6
  81. package/src/ATV/core/types.ts +7 -6
  82. package/src/ATV/index.ts +3 -3
  83. package/src/ATV/mappers/billDocToAtv.ts +35 -15
  84. package/src/ATV/types.ts +1 -1
  85. package/src/ATV/useCases/createDocument/index.ts +8 -8
  86. package/src/ATV/useCases/createDocument/types.ts +5 -6
  87. package/src/ATV/useCases/createReceptorMessage/index.ts +94 -93
  88. package/src/helpers/comprobantes.ts +10 -1
  89. package/src/lib/genClave/index.ts +10 -3
  90. package/src/lib/genXML/index.ts +3 -1
  91. package/src/lib/genXML/sigXML/index.ts +6 -3
  92. package/src/services/getToken/GetToken.ts +0 -3
  93. package/src/services/getToken/__tests__/GetToken.test.ts +0 -1
  94. package/src/types/facturaInterfaces.ts +3 -4
  95. package/src/xmlSchemaHeaderMap.ts +37 -0
  96. package/tools/readXML.ts +2 -0
  97. package/tools/xsdToJsonSchema.ts +1 -0
  98. package/tsconfig.json +1 -0
  99. package/dist/src/ATV/core/documentNames.types.d.ts +0 -1
  100. package/dist/src/ATV/core/documentNames.types.js +0 -3
  101. package/dist/src/ATV/core/documentNames.types.js.map +0 -1
  102. package/dist/src/lib/genXML/xmlConfig.d.ts +0 -55
  103. package/dist/src/lib/genXML/xmlConfig.js +0 -42
  104. package/dist/src/lib/genXML/xmlConfig.js.map +0 -1
  105. package/src/ATV/core/documentNames.types.ts +0 -6
  106. package/src/lib/genXML/xmlConfig.ts +0 -60
@@ -0,0 +1,544 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "FacturaElectronica",
4
+ "type": "object",
5
+ "properties": {
6
+ "Clave": { "type": "string", "pattern": "^\\d{50}$" },
7
+ "ProveedorSistemas": { "type": "string", "maxLength": 20 },
8
+ "CodigoActividadEmisor": {
9
+ "type": "string",
10
+ "minLength": 6,
11
+ "maxLength": 6
12
+ },
13
+ "CodigoActividadReceptor": {
14
+ "type": "string",
15
+ "minLength": 6,
16
+ "maxLength": 6
17
+ },
18
+ "NumeroConsecutivo": { "type": "string", "pattern": "^\\d{20}$" },
19
+ "FechaEmision": { "type": "string", "format": "date-time" },
20
+ "Emisor": { "$ref": "#/$defs/EmisorType" },
21
+ "Receptor": { "$ref": "#/$defs/ReceptorType" },
22
+ "CondicionVenta": {
23
+ "type": "string",
24
+ "enum": [
25
+ "01",
26
+ "02",
27
+ "03",
28
+ "04",
29
+ "05",
30
+ "06",
31
+ "07",
32
+ "08",
33
+ "10",
34
+ "12",
35
+ "13",
36
+ "14",
37
+ "15",
38
+ "99"
39
+ ]
40
+ },
41
+ "CondicionVentaOtros": {
42
+ "type": "string",
43
+ "minLength": 5,
44
+ "maxLength": 100
45
+ },
46
+ "PlazoCredito": { "type": "integer", "maximum": 99999 },
47
+ "DetalleServicio": { "$ref": "#/$defs/DetalleServicioType" },
48
+ "OtrosCargos": {
49
+ "type": "array",
50
+ "items": { "$ref": "#/$defs/OtrosCargosType" },
51
+ "maxItems": 15
52
+ },
53
+ "ResumenFactura": { "$ref": "#/$defs/ResumenFacturaType" },
54
+ "InformacionReferencia": {
55
+ "type": "array",
56
+ "items": { "$ref": "#/$defs/InformacionReferenciaType" },
57
+ "maxItems": 10
58
+ },
59
+ "Otros": { "$ref": "#/$defs/OtrosType" },
60
+ "ds:Signature": { "type": "object" }
61
+ },
62
+ "required": [
63
+ "Clave",
64
+ "ProveedorSistemas",
65
+ "CodigoActividadEmisor",
66
+ "NumeroConsecutivo",
67
+ "FechaEmision",
68
+ "Emisor",
69
+ "Receptor",
70
+ "CondicionVenta",
71
+ "ResumenFactura",
72
+ "ds:Signature"
73
+ ],
74
+ "$defs": {
75
+ "EmisorType": {
76
+ "type": "object",
77
+ "properties": {
78
+ "Nombre": { "type": "string", "minLength": 5, "maxLength": 100 },
79
+ "Identificacion": { "$ref": "#/$defs/IdentificacionType" },
80
+ "Registrofiscal8707": { "type": "string", "maxLength": 12 },
81
+ "NombreComercial": {
82
+ "type": "string",
83
+ "minLength": 3,
84
+ "maxLength": 80
85
+ },
86
+ "Ubicacion": { "$ref": "#/$defs/UbicacionType" },
87
+ "Telefono": { "$ref": "#/$defs/TelefonoType" },
88
+ "CorreoElectronico": {
89
+ "type": "array",
90
+ "items": { "type": "string", "maxLength": 160 },
91
+ "minItems": 1,
92
+ "maxItems": 4
93
+ }
94
+ },
95
+ "required": ["Nombre", "Identificacion", "Ubicacion", "CorreoElectronico"]
96
+ },
97
+ "ReceptorType": {
98
+ "type": "object",
99
+ "properties": {
100
+ "Nombre": { "type": "string", "minLength": 3, "maxLength": 100 },
101
+ "Identificacion": { "$ref": "#/$defs/IdentificacionType" },
102
+ "NombreComercial": {
103
+ "type": "string",
104
+ "minLength": 3,
105
+ "maxLength": 80
106
+ },
107
+ "Ubicacion": { "$ref": "#/$defs/UbicacionType" },
108
+ "OtrasSenasExtranjero": {
109
+ "type": "string",
110
+ "minLength": 5,
111
+ "maxLength": 300
112
+ },
113
+ "Telefono": { "$ref": "#/$defs/TelefonoType" },
114
+ "CorreoElectronico": { "type": "string", "maxLength": 160 }
115
+ },
116
+ "required": ["Nombre", "Identificacion"]
117
+ },
118
+ "IdentificacionType": {
119
+ "type": "object",
120
+ "properties": {
121
+ "Tipo": {
122
+ "type": "string",
123
+ "enum": ["01", "02", "03", "04", "05", "06"]
124
+ },
125
+ "Numero": { "type": "string", "maxLength": 20 }
126
+ },
127
+ "required": ["Tipo", "Numero"]
128
+ },
129
+ "UbicacionType": {
130
+ "type": "object",
131
+ "properties": {
132
+ "Provincia": { "type": "integer", "minimum": 1, "maximum": 9 },
133
+ "Canton": { "type": "integer", "minimum": 1, "maximum": 99 },
134
+ "Distrito": { "type": "integer", "minimum": 1, "maximum": 99 },
135
+ "Barrio": { "type": "string", "minLength": 5, "maxLength": 50 },
136
+ "OtrasSenas": { "type": "string", "minLength": 5, "maxLength": 250 }
137
+ },
138
+ "required": ["Provincia", "Canton", "Distrito", "OtrasSenas"]
139
+ },
140
+ "TelefonoType": {
141
+ "type": "object",
142
+ "properties": {
143
+ "CodigoPais": { "type": "integer", "minimum": 0, "maximum": 999 },
144
+ "NumTelefono": {
145
+ "type": "integer",
146
+ "minimum": 10000000,
147
+ "maximum": 99999999999999999999
148
+ }
149
+ },
150
+ "required": ["CodigoPais", "NumTelefono"]
151
+ },
152
+ "DetalleServicioType": {
153
+ "type": "object",
154
+ "properties": {
155
+ "LineaDetalle": {
156
+ "type": "array",
157
+ "items": { "$ref": "#/$defs/LineaDetalleType" },
158
+ "maxItems": 1000
159
+ }
160
+ }
161
+ },
162
+ "LineaDetalleType": {
163
+ "type": "object",
164
+ "properties": {
165
+ "NumeroLinea": { "type": "integer", "minimum": 1, "maximum": 1000 },
166
+ "CodigoCABYS": { "type": "string", "minLength": 13, "maxLength": 13 },
167
+ "CodigoComercial": {
168
+ "type": "array",
169
+ "items": { "$ref": "#/$defs/CodigoType" },
170
+ "maxItems": 5
171
+ },
172
+ "Cantidad": { "type": "number", "multipleOf": 0.001 },
173
+ "UnidadMedida": { "type": "string" },
174
+ "TipoTransaccion": { "type": "string", "maxLength": 2 },
175
+ "UnidadMedidaComercial": { "type": "string", "maxLength": 20 },
176
+ "Detalle": { "type": "string", "minLength": 3, "maxLength": 200 },
177
+ "NumeroVINoSerie": {
178
+ "type": "array",
179
+ "items": { "type": "string", "maxLength": 17 },
180
+ "maxItems": 1000
181
+ },
182
+ "RegistroMedicamento": { "type": "string", "maxLength": 100 },
183
+ "FormaFarmaceutica": { "type": "string", "maxLength": 3 },
184
+ "DetalleSurtido": { "$ref": "#/$defs/DetalleSurtidoType" },
185
+ "PrecioUnitario": { "type": "number" },
186
+ "MontoTotal": { "type": "number" },
187
+ "Descuento": {
188
+ "type": "array",
189
+ "items": { "$ref": "#/$defs/DescuentoType" },
190
+ "maxItems": 5
191
+ },
192
+ "SubTotal": { "type": "number" },
193
+ "IVACobradoFabrica": { "type": "string", "enum": ["01", "02"] },
194
+ "BaseImponible": { "type": "number" },
195
+ "Impuesto": {
196
+ "type": "array",
197
+ "items": { "$ref": "#/$defs/ImpuestoType" },
198
+ "maxItems": 1000
199
+ },
200
+ "ImpuestoAsumidoEmisorFabrica": { "type": "number" },
201
+ "ImpuestoNeto": { "type": "number" },
202
+ "MontoTotalLinea": { "type": "number" }
203
+ },
204
+ "required": [
205
+ "NumeroLinea",
206
+ "CodigoCABYS",
207
+ "Cantidad",
208
+ "UnidadMedida",
209
+ "Detalle",
210
+ "PrecioUnitario",
211
+ "MontoTotal",
212
+ "SubTotal",
213
+ "BaseImponible",
214
+ "MontoTotalLinea"
215
+ ]
216
+ },
217
+ "CodigoType": {
218
+ "type": "object",
219
+ "properties": {
220
+ "Tipo": {
221
+ "type": "string",
222
+ "enum": ["01", "02", "03", "04", "99"]
223
+ },
224
+ "Codigo": { "type": "string", "maxLength": 20 }
225
+ },
226
+ "required": ["Tipo", "Codigo"]
227
+ },
228
+ "DescuentoType": {
229
+ "type": "object",
230
+ "properties": {
231
+ "MontoDescuento": { "type": "number" },
232
+ "CodigoDescuento": {
233
+ "type": "string",
234
+ "enum": ["01", "02", "03", "04", "05", "06", "07", "08", "09", "99"]
235
+ },
236
+ "CodigoDescuentoOTRO": {
237
+ "type": "string",
238
+ "minLength": 5,
239
+ "maxLength": 100
240
+ },
241
+ "NaturalezaDescuento": {
242
+ "type": "string",
243
+ "minLength": 3,
244
+ "maxLength": 80
245
+ }
246
+ },
247
+ "required": ["MontoDescuento", "CodigoDescuento"]
248
+ },
249
+ "ImpuestoType": {
250
+ "type": "object",
251
+ "properties": {
252
+ "Codigo": {
253
+ "type": "string",
254
+ "enum": ["01", "02", "03", "04", "05", "06", "07", "08", "12", "99"]
255
+ },
256
+ "CodigoImpuestoOTRO": {
257
+ "type": "string",
258
+ "minLength": 5,
259
+ "maxLength": 100
260
+ },
261
+ "CodigoTarifaIVA": { "type": "string" },
262
+ "Tarifa": { "type": "number" },
263
+ "FactorCalculoIVA": { "type": "number" },
264
+ "DatosImpuestoEspecifico": {
265
+ "$ref": "#/$defs/DatosImpuestoEspecificoType"
266
+ },
267
+ "Monto": { "type": "number" },
268
+ "Exoneracion": { "$ref": "#/$defs/ExoneracionType" }
269
+ },
270
+ "required": ["Codigo", "Monto"]
271
+ },
272
+ "DatosImpuestoEspecificoType": {
273
+ "type": "object",
274
+ "properties": {
275
+ "CantidadUnidadMedida": { "type": "number" },
276
+ "Porcentaje": { "type": "number" },
277
+ "Proporcion": { "type": "number" },
278
+ "VolumenUnidadConsumo": { "type": "number" },
279
+ "ImpuestoUnidad": { "type": "number" }
280
+ }
281
+ },
282
+ "ExoneracionType": {
283
+ "type": "object",
284
+ "properties": {
285
+ "TipoDocumentoEX1": { "type": "string" },
286
+ "TipoDocumentoOTRO": {
287
+ "type": "string",
288
+ "minLength": 5,
289
+ "maxLength": 100
290
+ },
291
+ "NumeroDocumento": {
292
+ "type": "string",
293
+ "minLength": 3,
294
+ "maxLength": 40
295
+ },
296
+ "Articulo": { "type": "integer" },
297
+ "Inciso": { "type": "integer" },
298
+ "NombreInstitucion": { "type": "string" },
299
+ "NombreInstitucionOtros": {
300
+ "type": "string",
301
+ "minLength": 5,
302
+ "maxLength": 160
303
+ },
304
+ "FechaEmisionEX": { "type": "string", "format": "date-time" },
305
+ "TarifaExonerada": { "type": "number" },
306
+ "MontoExoneracion": { "type": "number" }
307
+ },
308
+ "required": [
309
+ "TipoDocumentoEX1",
310
+ "NumeroDocumento",
311
+ "NombreInstitucion",
312
+ "FechaEmisionEX",
313
+ "TarifaExonerada",
314
+ "MontoExoneracion"
315
+ ]
316
+ },
317
+ "DetalleSurtidoType": {
318
+ "type": "object",
319
+ "properties": {
320
+ "LineaDetalleSurtido": {
321
+ "type": "array",
322
+ "items": { "$ref": "#/$defs/LineaDetalleSurtidoType" },
323
+ "maxItems": 20
324
+ }
325
+ }
326
+ },
327
+ "LineaDetalleSurtidoType": {
328
+ "type": "object",
329
+ "properties": {
330
+ "CodigoCABYSSurtido": {
331
+ "type": "string",
332
+ "minLength": 13,
333
+ "maxLength": 13
334
+ },
335
+ "CodigoComercialSurtido": {
336
+ "type": "array",
337
+ "items": { "$ref": "#/$defs/CodigoComercialSurtidoType" },
338
+ "maxItems": 5
339
+ },
340
+ "CantidadSurtido": { "type": "number" },
341
+ "UnidadMedidaSurtido": { "type": "string", "maxLength": 15 },
342
+ "UnidadMedidaComercialSurtido": { "type": "string", "maxLength": 20 },
343
+ "DetalleSurtido": {
344
+ "type": "string",
345
+ "minLength": 3,
346
+ "maxLength": 200
347
+ },
348
+ "PrecioUnitarioSurtido": { "type": "number" },
349
+ "MontoTotalSurtido": { "type": "number" },
350
+ "DescuentoSurtido": {
351
+ "type": "array",
352
+ "items": { "$ref": "#/$defs/DescuentoSurtidoType" },
353
+ "maxItems": 5
354
+ },
355
+ "SubTotalSurtido": { "type": "number" },
356
+ "IVACobradoFabricaSurtido": { "type": "string", "enum": ["01", "02"] },
357
+ "BaseImponibleSurtido": { "type": "number" },
358
+ "ImpuestoSurtido": {
359
+ "type": "array",
360
+ "items": { "$ref": "#/$defs/ImpuestoSurtidoType" },
361
+ "maxItems": 1000
362
+ },
363
+ "MontoImpuestoSurtido": { "type": "number" }
364
+ }
365
+ },
366
+ "CodigoComercialSurtidoType": {
367
+ "type": "object",
368
+ "properties": {
369
+ "TipoSurtido": {
370
+ "type": "string",
371
+ "enum": ["01", "02", "03", "04", "99"]
372
+ },
373
+ "CodigoSurtido": { "type": "string", "minLength": 1, "maxLength": 20 }
374
+ }
375
+ },
376
+ "DescuentoSurtidoType": {
377
+ "type": "object",
378
+ "properties": {
379
+ "MontoDescuentoSurtido": { "type": "number" },
380
+ "CodigoDescuentoSurtido": { "type": "string" },
381
+ "DescuentoSurtidoOtros": {
382
+ "type": "string",
383
+ "minLength": 3,
384
+ "maxLength": 80
385
+ }
386
+ }
387
+ },
388
+ "ImpuestoSurtidoType": {
389
+ "type": "object",
390
+ "properties": {
391
+ "CodigoImpuestoSurtido": { "type": "string" },
392
+ "CodigoImpuestoOTROSurtido": {
393
+ "type": "string",
394
+ "minLength": 5,
395
+ "maxLength": 100
396
+ },
397
+ "CodigoTarifaIVASurtido": { "type": "string" },
398
+ "TarifaSurtido": { "type": "number" },
399
+ "DatosImpuestoEspecificoSurtido": {
400
+ "$ref": "#/$defs/DatosImpuestoEspecificoType"
401
+ },
402
+ "MontoImpuestoSurtido": { "type": "number" }
403
+ }
404
+ },
405
+ "OtrosCargosType": {
406
+ "type": "object",
407
+ "properties": {
408
+ "TipoDocumentoOC": { "type": "string" },
409
+ "TipoDocumentoOTROS": {
410
+ "type": "string",
411
+ "minLength": 5,
412
+ "maxLength": 100
413
+ },
414
+ "IdentificacionTercero": { "$ref": "#/$defs/IdentificacionType" },
415
+ "NombreTercero": { "type": "string", "minLength": 5, "maxLength": 100 },
416
+ "Detalle": { "type": "string", "maxLength": 160 },
417
+ "PorcentajeOC": { "type": "number" },
418
+ "MontoCargo": { "type": "number" }
419
+ },
420
+ "required": ["TipoDocumentoOC", "Detalle", "MontoCargo"]
421
+ },
422
+ "ResumenFacturaType": {
423
+ "type": "object",
424
+ "properties": {
425
+ "CodigoTipoMoneda": { "$ref": "#/$defs/CodigoMonedaType" },
426
+ "TotalServGravados": { "type": "number" },
427
+ "TotalServExentos": { "type": "number" },
428
+ "TotalServExonerado": { "type": "number" },
429
+ "TotalServNoSujeto": { "type": "number" },
430
+ "TotalMercanciasGravadas": { "type": "number" },
431
+ "TotalMercanciasExentas": { "type": "number" },
432
+ "TotalMercExonerada": { "type": "number" },
433
+ "TotalMercNoSujeta": { "type": "number" },
434
+ "TotalGravado": { "type": "number" },
435
+ "TotalExento": { "type": "number" },
436
+ "TotalExonerado": { "type": "number" },
437
+ "TotalNoSujeto": { "type": "number" },
438
+ "TotalVenta": { "type": "number" },
439
+ "TotalDescuentos": { "type": "number" },
440
+ "TotalVentaNeta": { "type": "number" },
441
+ "TotalDesgloseImpuesto": {
442
+ "type": "array",
443
+ "items": { "$ref": "#/$defs/TotalDesgloseImpuestoType" },
444
+ "maxItems": 1000
445
+ },
446
+ "TotalImpuesto": { "type": "number" },
447
+ "TotalImpAsumEmisorFabrica": { "type": "number" },
448
+ "TotalIVADevuelto": { "type": "number" },
449
+ "TotalOtrosCargos": { "type": "number" },
450
+ "MedioPago": {
451
+ "type": "array",
452
+ "items": { "$ref": "#/$defs/MedioPagoType" },
453
+ "maxItems": 4
454
+ },
455
+ "TotalComprobante": { "type": "number" }
456
+ },
457
+ "required": [
458
+ "CodigoTipoMoneda",
459
+ "TotalVenta",
460
+ "TotalVentaNeta",
461
+ "TotalComprobante"
462
+ ]
463
+ },
464
+ "CodigoMonedaType": {
465
+ "type": "object",
466
+ "properties": {
467
+ "CodigoMoneda": { "type": "string" },
468
+ "TipoCambio": { "type": "number" }
469
+ },
470
+ "required": ["CodigoMoneda", "TipoCambio"]
471
+ },
472
+ "TotalDesgloseImpuestoType": {
473
+ "type": "object",
474
+ "properties": {
475
+ "Codigo": { "type": "string" },
476
+ "CodigoTarifaIVA": { "type": "string" },
477
+ "TotalMontoImpuesto": { "type": "number" }
478
+ }
479
+ },
480
+ "MedioPagoType": {
481
+ "type": "object",
482
+ "properties": {
483
+ "TipoMedioPago": {
484
+ "type": "string",
485
+ "enum": ["01", "02", "03", "04", "05", "06", "07", "99"]
486
+ },
487
+ "MedioPagoOtros": {
488
+ "type": "string",
489
+ "minLength": 3,
490
+ "maxLength": 100
491
+ },
492
+ "TotalMedioPago": { "type": "number" }
493
+ }
494
+ },
495
+ "InformacionReferenciaType": {
496
+ "type": "object",
497
+ "properties": {
498
+ "TipoDocIR": { "type": "string" },
499
+ "TipoDocRefOTRO": {
500
+ "type": "string",
501
+ "minLength": 5,
502
+ "maxLength": 100
503
+ },
504
+ "Numero": { "type": "string", "maxLength": 50 },
505
+ "FechaEmisionIR": { "type": "string", "format": "date-time" },
506
+ "Codigo": { "type": "string" },
507
+ "CodigoReferenciaOTRO": {
508
+ "type": "string",
509
+ "minLength": 5,
510
+ "maxLength": 100
511
+ },
512
+ "Razon": { "type": "string", "maxLength": 180 }
513
+ },
514
+ "required": ["TipoDocIR", "FechaEmisionIR"]
515
+ },
516
+ "OtrosType": {
517
+ "type": "object",
518
+ "properties": {
519
+ "OtroTexto": {
520
+ "type": "array",
521
+ "items": { "$ref": "#/$defs/OtroTextoType" }
522
+ },
523
+ "OtroContenido": {
524
+ "type": "array",
525
+ "items": { "$ref": "#/$defs/OtroContenidoType" }
526
+ }
527
+ }
528
+ },
529
+ "OtroTextoType": {
530
+ "type": "object",
531
+ "properties": {
532
+ "value": { "type": "string", "maxLength": 500 },
533
+ "codigo": { "type": "string" }
534
+ }
535
+ },
536
+ "OtroContenidoType": {
537
+ "type": "object",
538
+ "properties": {
539
+ "value": { "type": "string", "maxLength": 500 },
540
+ "codigo": { "type": "string" }
541
+ }
542
+ }
543
+ }
544
+ }