ticketbai 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +32 -0
  4. data/CHANGELOG.md +13 -0
  5. data/Gemfile +6 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +107 -0
  8. data/Rakefile +12 -0
  9. data/bin/console +15 -0
  10. data/bin/setup +8 -0
  11. data/lib/ticketbai/api/client.rb +63 -0
  12. data/lib/ticketbai/api/registry.rb +34 -0
  13. data/lib/ticketbai/api/request.rb +125 -0
  14. data/lib/ticketbai/api/response_parser.rb +36 -0
  15. data/lib/ticketbai/checksum_calculator.rb +15 -0
  16. data/lib/ticketbai/document.rb +21 -0
  17. data/lib/ticketbai/document_validator.rb +42 -0
  18. data/lib/ticketbai/documents/annulment.rb +45 -0
  19. data/lib/ticketbai/documents/api_payload.rb +47 -0
  20. data/lib/ticketbai/documents/issuance.rb +55 -0
  21. data/lib/ticketbai/documents/issuance_unsigned.rb +58 -0
  22. data/lib/ticketbai/errors.rb +27 -0
  23. data/lib/ticketbai/nodes/breakdown_type.rb +72 -0
  24. data/lib/ticketbai/nodes/invoice_chaining.rb +22 -0
  25. data/lib/ticketbai/nodes/invoice_data.rb +24 -0
  26. data/lib/ticketbai/nodes/invoice_header.rb +26 -0
  27. data/lib/ticketbai/nodes/issuer.rb +18 -0
  28. data/lib/ticketbai/nodes/lroe_header.rb +29 -0
  29. data/lib/ticketbai/nodes/lroe_issued_invoices.rb +28 -0
  30. data/lib/ticketbai/nodes/receiver.rb +36 -0
  31. data/lib/ticketbai/nodes/software.rb +17 -0
  32. data/lib/ticketbai/operation.rb +59 -0
  33. data/lib/ticketbai/operations/annulment.rb +41 -0
  34. data/lib/ticketbai/operations/issuance.rb +93 -0
  35. data/lib/ticketbai/operations/issuance_unsigned.rb +89 -0
  36. data/lib/ticketbai/signer.rb +273 -0
  37. data/lib/ticketbai/tbai_identifier.rb +33 -0
  38. data/lib/ticketbai/tbai_qr.rb +50 -0
  39. data/lib/ticketbai/version.rb +5 -0
  40. data/lib/ticketbai/xmldsig-core-schema.xsd +318 -0
  41. data/lib/ticketbai/xsd_validators/annulment.xsd +392 -0
  42. data/lib/ticketbai/xsd_validators/issuance.xsd +865 -0
  43. data/lib/ticketbai.rb +89 -0
  44. data/ticketbai.gemspec +42 -0
  45. metadata +186 -0
@@ -0,0 +1,865 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:T="urn:ticketbai:emision" targetNamespace="urn:ticketbai:emision">
3
+
4
+ <import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="lib/ticketbai/xmldsig-core-schema.xsd"/>
5
+
6
+ <element name="TicketBai">
7
+ <complexType>
8
+ <sequence>
9
+ <element name="Cabecera" type="T:Cabecera"/>
10
+ <element name="Sujetos" type="T:Sujetos"/>
11
+ <element name="Factura" type="T:Factura"/>
12
+ <element name="HuellaTBAI" type="T:HuellaTBAI"/>
13
+ <element ref="ds:Signature"/>
14
+ </sequence>
15
+ </complexType>
16
+ </element>
17
+ <complexType name="Cabecera">
18
+ <sequence>
19
+ <element name="IDVersionTBAI" type="T:IDVersionTicketBaiType"/>
20
+ </sequence>
21
+ </complexType>
22
+ <complexType name="Sujetos">
23
+ <sequence>
24
+ <element name="Emisor" type="T:Emisor"/>
25
+ <element name="Destinatarios" type="T:Destinatarios" minOccurs="0"/>
26
+ <element name="VariosDestinatarios" type="T:SiNoType" minOccurs="0"/>
27
+ <element name="EmitidaPorTercerosODestinatario" type="T:EmitidaPorTercerosType" minOccurs="0"/>
28
+ </sequence>
29
+ </complexType>
30
+
31
+ <complexType name="Emisor">
32
+ <sequence>
33
+ <element name="NIF" type="T:NIFType"/>
34
+ <element name="ApellidosNombreRazonSocial" type="T:TextMax120Type"/>
35
+ </sequence>
36
+ </complexType>
37
+ <complexType name="Destinatarios">
38
+ <sequence>
39
+ <element name="IDDestinatario" type="T:IDDestinatario" maxOccurs="100"/>
40
+ </sequence>
41
+ </complexType>
42
+ <complexType name="IDDestinatario">
43
+ <sequence>
44
+ <choice>
45
+ <element name="NIF" type="T:NIFType"/>
46
+ <element name="IDOtro" type="T:IDOtro"/>
47
+ </choice>
48
+ <element name="ApellidosNombreRazonSocial" type="T:TextMax120Type"/>
49
+ <element name="CodigoPostal" type="T:TextMax20Type" minOccurs="0"/>
50
+ <element name="Direccion" type="T:TextMax250Type" minOccurs="0"/>
51
+ </sequence>
52
+ </complexType>
53
+
54
+ <complexType name="IDOtro">
55
+ <sequence>
56
+ <element name="CodigoPais" type="T:CountryType2" minOccurs="0"/>
57
+ <element name="IDType" type="T:IDTypeType"/>
58
+ <element name="ID" type="T:TextMax20Type"/>
59
+ </sequence>
60
+ </complexType>
61
+
62
+ <complexType name="Factura">
63
+ <sequence>
64
+ <element name="CabeceraFactura" type="T:CabeceraFacturaType"/>
65
+ <element name="DatosFactura" type="T:DatosFacturaType"/>
66
+ <element name="TipoDesglose" type="T:TipoDesgloseType"/>
67
+ </sequence>
68
+ </complexType>
69
+ <complexType name="CabeceraFacturaType">
70
+ <sequence>
71
+ <element name="SerieFactura" type="T:TextMax20Type" minOccurs="0"/>
72
+ <element name="NumFactura" type="T:TextMax20Type"/>
73
+ <element name="FechaExpedicionFactura" type="T:FechaType"/>
74
+ <element name="HoraExpedicionFactura" type="T:HoraType"/>
75
+ <element name="FacturaSimplificada" type="T:SiNoType" minOccurs="0"/>
76
+ <element name="FacturaEmitidaSustitucionSimplificada" type="T:SiNoType" minOccurs="0"/>
77
+ <element name="FacturaRectificativa" type="T:FacturaRectificativaType" minOccurs="0"/>
78
+ <element name="FacturasRectificadasSustituidas" type="T:FacturasRectificadasSustituidasType" minOccurs="0" />
79
+ </sequence>
80
+ </complexType>
81
+ <complexType name="FacturaRectificativaType">
82
+ <sequence>
83
+ <element name="Codigo" type="T:ClaveTipoFacturaType"/>
84
+ <element name="Tipo" type="T:ClaveTipoRectificativaType"/>
85
+ <element name="ImporteRectificacionSustitutiva" type="T:ImporteRectificacionSustitutivaType" minOccurs="0" />
86
+ </sequence>
87
+ </complexType>
88
+ <complexType name="ImporteRectificacionSustitutivaType">
89
+ <sequence>
90
+ <element name="BaseRectificada" type="T:ImporteSgn12.2Type"/>
91
+ <element name="CuotaRectificada" type="T:ImporteSgn12.2Type"/>
92
+ <element name="CuotaRecargoRectificada" type="T:ImporteSgn12.2Type" minOccurs="0"/>
93
+ </sequence>
94
+ </complexType>
95
+ <complexType name="DatosFacturaType">
96
+ <sequence>
97
+ <element name="FechaOperacion" type="T:FechaType" minOccurs="0"/>
98
+ <element name="DescripcionFactura" type="T:TextMax250Type"/>
99
+ <element name="DetallesFactura" type="T:DetallesFacturaType" minOccurs="0"/>
100
+ <element name="ImporteTotalFactura" type="T:ImporteSgn12.2Type"/>
101
+ <element name="RetencionSoportada" type="T:ImporteSgn12.2Type" minOccurs="0"/>
102
+ <element name="BaseImponibleACoste" type="T:ImporteSgn12.2Type" minOccurs="0"/>
103
+ <element name="Claves" type="T:ClavesType"/>
104
+ </sequence>
105
+ </complexType>
106
+ <complexType name="DetallesFacturaType">
107
+ <sequence>
108
+ <element name="IDDetalleFactura" type="T:IDDetalleFacturaType" maxOccurs="1000"/>
109
+ </sequence>
110
+ </complexType>
111
+ <complexType name="IDDetalleFacturaType">
112
+ <sequence>
113
+ <element name="DescripcionDetalle" type="T:TextMax250Type"/>
114
+ <element name="Cantidad" type="T:ImporteSgn12.2Type"/>
115
+ <element name="ImporteUnitario" type="T:ImporteSgn12.8Type"/>
116
+ <element name="Descuento" type="T:ImporteSgn12.2Type" minOccurs="0"/>
117
+ <element name="ImporteTotal" type="T:ImporteSgn12.2Type"/>
118
+ </sequence>
119
+ </complexType>
120
+ <complexType name="ClavesType">
121
+ <sequence>
122
+ <element name="IDClave" type="T:IDClaveType" maxOccurs="3"/>
123
+ </sequence>
124
+ </complexType>
125
+ <complexType name="IDClaveType">
126
+ <sequence>
127
+ <element name="ClaveRegimenIvaOpTrascendencia" type="T:IdOperacionesTrascendenciaTributariaType"/>
128
+ </sequence>
129
+ </complexType>
130
+ <complexType name="FacturasRectificadasSustituidasType">
131
+ <sequence>
132
+ <element name="IDFacturaRectificadaSustituida" type="T:IDFacturaRectificadaSustituidaType" maxOccurs="100" />
133
+ </sequence>
134
+ </complexType>
135
+ <complexType name="IDFacturaRectificadaSustituidaType">
136
+ <sequence>
137
+ <element name="SerieFactura" type="T:TextMax20Type" minOccurs="0"/>
138
+ <element name="NumFactura" type="T:TextMax20Type"/>
139
+ <element name="FechaExpedicionFactura" type="T:FechaType"/>
140
+ </sequence>
141
+ </complexType>
142
+ <complexType name="TipoDesgloseType">
143
+ <sequence>
144
+ <choice>
145
+ <element name="DesgloseFactura" type="T:DesgloseFacturaType"/>
146
+ <element name="DesgloseTipoOperacion" type="T:DesgloseTipoOperacionType"/>
147
+ </choice>
148
+ </sequence>
149
+ </complexType>
150
+ <complexType name="DesgloseTipoOperacionType">
151
+ <sequence>
152
+ <element name="PrestacionServicios" type="T:PrestacionServicios" minOccurs="0"/>
153
+ <element name="Entrega" type="T:Entrega" minOccurs="0"/>
154
+ </sequence>
155
+ </complexType>
156
+ <complexType name="PrestacionServicios">
157
+ <sequence>
158
+ <element name="Sujeta" type="T:SujetaType" minOccurs="0" />
159
+ <element name="NoSujeta" type="T:NoSujetaType" minOccurs="0" />
160
+ </sequence>
161
+ </complexType>
162
+ <complexType name="Entrega">
163
+ <sequence>
164
+ <element name="Sujeta" type="T:SujetaType" minOccurs="0" />
165
+ <element name="NoSujeta" type="T:NoSujetaType" minOccurs="0" />
166
+ </sequence>
167
+ </complexType>
168
+ <complexType name="DesgloseFacturaType">
169
+ <sequence>
170
+ <element name="Sujeta" type="T:SujetaType" minOccurs="0" />
171
+ <element name="NoSujeta" type="T:NoSujetaType" minOccurs="0" />
172
+ </sequence>
173
+ </complexType>
174
+ <complexType name="SujetaType">
175
+ <sequence>
176
+ <element name="Exenta" type="T:ExentaType" minOccurs="0" />
177
+ <element name="NoExenta" type="T:NoExentaType" minOccurs="0" />
178
+ </sequence>
179
+ </complexType>
180
+ <complexType name="NoSujetaType">
181
+ <sequence>
182
+ <element name="DetalleNoSujeta" type="T:DetalleNoSujeta"
183
+ minOccurs="1" maxOccurs="2" />
184
+ </sequence>
185
+ </complexType>
186
+ <complexType name="DetalleNoSujeta">
187
+ <sequence>
188
+ <element name="Causa" type="T:CausaNoSujetaType"/>
189
+ <element name="Importe" type="T:ImporteSgn12.2Type"/>
190
+ </sequence>
191
+ </complexType>
192
+ <complexType name="ExentaType">
193
+ <sequence>
194
+ <element name="DetalleExenta" type="T:DetalleExentaType" minOccurs="1" maxOccurs="7" />
195
+ </sequence>
196
+ </complexType>
197
+ <complexType name="DetalleExentaType">
198
+ <sequence>
199
+ <element name="CausaExencion" type="T:CausaExencionType" />
200
+ <element name="BaseImponible" type="T:ImporteSgn12.2Type"/>
201
+ </sequence>
202
+ </complexType>
203
+ <complexType name="NoExentaType">
204
+ <sequence>
205
+ <element name="DetalleNoExenta" type="T:DetalleNoExentaType" minOccurs="1" maxOccurs="2" />
206
+ </sequence>
207
+ </complexType>
208
+ <complexType name="DetalleNoExentaType">
209
+ <sequence>
210
+ <element name="TipoNoExenta" type="T:TipoOperacionSujetaNoExentaType"/>
211
+ <element name="DesgloseIVA" type="T:DesgloseIVAType"/>
212
+ </sequence>
213
+ </complexType>
214
+ <complexType name="DesgloseIVAType">
215
+ <sequence>
216
+ <element name="DetalleIVA" type="T:DetalleIVAType" maxOccurs="6" />
217
+ </sequence>
218
+ </complexType>
219
+ <complexType name="DetalleIVAType">
220
+ <sequence>
221
+ <element name="BaseImponible" type="T:ImporteSgn12.2Type"/>
222
+ <element name="TipoImpositivo" type="T:Tipo3.2Type" minOccurs="0"/>
223
+ <element name="CuotaImpuesto" type="T:ImporteSgn12.2Type" minOccurs="0" />
224
+ <element name="TipoRecargoEquivalencia" type="T:Tipo3.2Type" minOccurs="0"/>
225
+ <element name="CuotaRecargoEquivalencia" type="T:ImporteSgn12.2Type" minOccurs="0"/>
226
+ <element name="OperacionEnRecargoDeEquivalenciaORegimenSimplificado" type="T:SiNoType" minOccurs="0"/>
227
+ </sequence>
228
+ </complexType>
229
+ <complexType name="EncadenamientoFacturaAnteriorType">
230
+ <sequence>
231
+ <element name="SerieFacturaAnterior" type="T:TextMax20Type" minOccurs="0"/>
232
+ <element name="NumFacturaAnterior" type="T:TextMax20Type"/>
233
+ <element name="FechaExpedicionFacturaAnterior" type="T:FechaType"/>
234
+ <element name="SignatureValueFirmaFacturaAnterior" type="T:TextMax100Type"/>
235
+ </sequence>
236
+ </complexType>
237
+ <complexType name="HuellaTBAI">
238
+ <sequence>
239
+ <element name="EncadenamientoFacturaAnterior" type="T:EncadenamientoFacturaAnteriorType" minOccurs="0"/>
240
+ <element name="Software" type="T:SoftwareFacturacionType"/>
241
+ <element name="NumSerieDispositivo" type="T:TextMax30Type" minOccurs="0"/>
242
+ </sequence>
243
+ </complexType>
244
+ <complexType name="SoftwareFacturacionType">
245
+ <sequence>
246
+ <element name="LicenciaTBAI" type="T:TextMax20Type"/>
247
+ <element name="EntidadDesarrolladora" type="T:EntidadDesarrolladoraType"/>
248
+ <element name="Nombre" type="T:TextMax120Type"/>
249
+ <element name="Version" type="T:TextMax20Type"/>
250
+ </sequence>
251
+ </complexType>
252
+ <complexType name="EntidadDesarrolladoraType">
253
+ <sequence>
254
+ <choice>
255
+ <element name="NIF" type="T:NIFType"/>
256
+ <element name="IDOtro" type="T:IDOtro"/>
257
+ </choice>
258
+ </sequence>
259
+ </complexType>
260
+ <simpleType name="NIFType">
261
+ <annotation>
262
+ <documentation >NIF: Secuencia de 9 dígitos o letras mayúsculas</documentation>
263
+ </annotation>
264
+ <restriction base="string">
265
+ <length value="9" />
266
+ <pattern
267
+ value="(([a-z|A-Z]{1}\d{7}[a-z|A-Z]{1})|(\d{8}[a-z|A-Z]{1})|([a-z|A-Z]{1}\d{8}))" />
268
+ </restriction>
269
+ <!-- ([A-Z]|\d){9} -->
270
+ </simpleType>
271
+ <simpleType name="FechaType">
272
+ <restriction base="string">
273
+ <length value="10" />
274
+ <pattern value="\d{2,2}-\d{2,2}-\d{4,4}"/>
275
+ </restriction>
276
+ </simpleType>
277
+ <simpleType name="HoraType">
278
+ <restriction base="string">
279
+ <pattern value="\d{2,2}:\d{2,2}:\d{2,2}"/>
280
+ </restriction>
281
+ </simpleType>
282
+ <!-- Tipo de 6 dígitos (3+2) "." como separador decimal -->
283
+ <simpleType name="Tipo3.2Type">
284
+ <restriction base="string">
285
+ <pattern value="\d{1,3}(\.\d{0,2})?"/>
286
+ </restriction>
287
+ </simpleType>
288
+ <!-- Importe de 15 dígitos (12+2) "." como separador decimal -->
289
+ <simpleType name="ImporteSgn12.2Type">
290
+ <restriction base="string">
291
+ <pattern value="(\+|-)?\d{1,12}(\.\d{0,2})?"/>
292
+ </restriction>
293
+ </simpleType>
294
+ <!-- Importe de 20 dígitos (12+8) "." como separador decimal -->
295
+ <simpleType name="ImporteSgn12.8Type">
296
+ <restriction base="string">
297
+ <pattern value="(\+|-)?\d{1,12}(\.\d{0,8})?"/>
298
+ </restriction>
299
+ </simpleType>
300
+ <!-- Cadena de 5 caracteres -->
301
+ <simpleType name="TextMax5Type">
302
+ <restriction base="string">
303
+ <maxLength value="5"/>
304
+ </restriction>
305
+ </simpleType>
306
+ <!-- Cadena de 10 caracteres -->
307
+ <simpleType name="TextMax10Type">
308
+ <restriction base="string">
309
+ <maxLength value="10"/>
310
+ </restriction>
311
+ </simpleType>
312
+ <!-- Cadena de 20 caracteres -->
313
+ <simpleType name="TextMax20Type">
314
+ <restriction base="string">
315
+ <maxLength value="20"/>
316
+ </restriction>
317
+ </simpleType>
318
+ <!-- Cadena de 30 caracteres -->
319
+ <simpleType name="TextMax30Type">
320
+ <restriction base="string">
321
+ <maxLength value="30"/>
322
+ </restriction>
323
+ </simpleType>
324
+ <!-- Cadena de 100 caracteres -->
325
+ <simpleType name="TextMax100Type">
326
+ <restriction base="string">
327
+ <maxLength value="100"/>
328
+ </restriction>
329
+ </simpleType>
330
+ <!-- Cadena de 120 caracteres -->
331
+ <simpleType name="TextMax120Type">
332
+ <restriction base="string">
333
+ <maxLength value="120"/>
334
+ </restriction>
335
+ </simpleType>
336
+ <!-- Cadena de 250 caracteres -->
337
+ <simpleType name="TextMax250Type">
338
+ <restriction base="string">
339
+ <maxLength value="250"/>
340
+ </restriction>
341
+ </simpleType>
342
+ <!-- Cadena de 500 caracteres -->
343
+ <simpleType name="TextMax500Type">
344
+ <restriction base="string">
345
+ <maxLength value="500"/>
346
+ </restriction>
347
+ </simpleType>
348
+ <!-- IDTicketBaiBertsioa - IDVersionTicketBai -->
349
+ <simpleType name="IDVersionTicketBaiType">
350
+ <restriction base="string">
351
+ <enumeration value="1.2"/>
352
+ </restriction>
353
+ </simpleType>
354
+ <!-- Egoitza herrialdeko identifikazio motak - Tipos de identificación en el país de residencia -->
355
+ <simpleType name="IDTypeType">
356
+ <restriction base="string">
357
+ <enumeration value="02">
358
+ <annotation>
359
+ <documentation >IFZ BEZ - NIF IVA</documentation>
360
+ </annotation>
361
+ </enumeration>
362
+ <enumeration value="03">
363
+ <annotation>
364
+ <documentation >Pasaportea - Pasaporte</documentation>
365
+ </annotation>
366
+ </enumeration>
367
+ <enumeration value="04">
368
+ <annotation>
369
+ <documentation >Egoitza dagoen herrialdeak edo lurraldeak emandako nortasun agiri ofiziala - Documento oficial de identificación expedido por el país o territorio de residencia</documentation>
370
+ </annotation>
371
+ </enumeration>
372
+ <enumeration value="05">
373
+ <annotation>
374
+ <documentation >Egoitza ziurtagiria - Certificado de residencia</documentation>
375
+ </annotation>
376
+ </enumeration>
377
+ <enumeration value="06">
378
+ <annotation>
379
+ <documentation >Beste frogagiri bat - Otro documento probatorio</documentation>
380
+ </annotation>
381
+ </enumeration>
382
+ </restriction>
383
+ </simpleType>
384
+ <!-- Zuzentzeko fakturaren kodea - Código de factura rectificativa -->
385
+ <simpleType name="ClaveTipoFacturaType">
386
+ <restriction base="string">
387
+ <enumeration value="R1">
388
+ <annotation>
389
+ <documentation >Faktura zuzentzailea: zuzenbidean oinarritutako akatsa eta BEZaren Foru Arauaren 80.artikuluko Bat, Bi eta Sei - Factura rectificativa: error fundado en derecho y Art. 80 Uno, Dos y Seis de la Norma Foral del IVA </documentation>
390
+ </annotation>
391
+ </enumeration>
392
+ <enumeration value="R2">
393
+ <annotation>
394
+ <documentation >Faktura zuzentzailea: BEZari buruzko Foru Arauko 80. artikuluko Hiru - Factura rectificativa: artículo 80 Tres de la Norma Foral del IVA </documentation>
395
+ </annotation>
396
+ </enumeration>
397
+ <enumeration value="R3">
398
+ <annotation>
399
+ <documentation >Faktura zuzentzailea: BEZari buruzko Foru Arauko 80. artikuluko Lau - Factura rectificativa: artículo 80 Cuatro de la Norma Foral del IVA </documentation>
400
+ </annotation>
401
+ </enumeration>
402
+ <enumeration value="R4">
403
+ <annotation>
404
+ <documentation >Faktura zuzentzailea: Gainerakoak - Factura rectificativa: Resto </documentation>
405
+ </annotation>
406
+ </enumeration>
407
+ <enumeration value="R5">
408
+ <annotation>
409
+ <documentation >Faktura zuzentzailea faktura erraztuetan - Factura rectificativa en facturas simplificadas </documentation>
410
+ </annotation>
411
+ </enumeration>
412
+ </restriction>
413
+ </simpleType>
414
+ <!-- Faktura zuzentzaile mota - Tipo de factura rectificativa -->
415
+ <simpleType name="ClaveTipoRectificativaType">
416
+ <restriction base="string">
417
+ <enumeration value="S">
418
+ <annotation>
419
+ <documentation >Ordezkatzeagatiko faktura zuzentzailea - Factura rectificativa por sustitución</documentation>
420
+ </annotation>
421
+ </enumeration>
422
+ <enumeration value="I">
423
+ <annotation>
424
+ <documentation >Ezberdintasunengatiko faktura zuzentzailea - Factura rectificativa por diferencias</documentation>
425
+ </annotation>
426
+ </enumeration>
427
+ </restriction>
428
+ </simpleType>
429
+ <!-- BEZaren araudi bereziaren gakoa eta zerga garrantziadun eragiketak - Clave de régimen especial de IVA y operaciones con trascendencia tributaria -->
430
+ <simpleType name="IdOperacionesTrascendenciaTributariaType">
431
+ <restriction base="string">
432
+ <enumeration value="01" >
433
+ <annotation>
434
+ <documentation>Erregimen orokorreko eragiketa eta hurrengo balioetan jaso gabe dagoen beste edozein kasu - Operación de régimen general y cualquier otro supuesto que no esté recogido en los siguientes valores</documentation>
435
+ </annotation>
436
+ </enumeration>
437
+ <enumeration value="02" >
438
+ <annotation>
439
+ <documentation>Esportazioa - Exportación</documentation>
440
+ </annotation>
441
+ </enumeration>
442
+ <enumeration value="03" >
443
+ <annotation>
444
+ <documentation>Erabilitako ondasunen, arte objektuen, zaharkinen eta bilduma objektuen araudi berezia aplikatzen zaien eragiketak - Operaciones a las que se aplique el régimen especial de bienes usados, objetos de arte, antigüedades y objetos de colección</documentation>
445
+ </annotation>
446
+ </enumeration>
447
+ <enumeration value="04" >
448
+ <annotation>
449
+ <documentation>Inbertsio urrearen araubide berezia - Régimen especial del oro de inversión</documentation>
450
+ </annotation>
451
+ </enumeration>
452
+ <enumeration value="05" >
453
+ <annotation>
454
+ <documentation >Bidaia-agentzien araubide berezia - Régimen especial de las agencias de viajes</documentation>
455
+ </annotation>
456
+ </enumeration>
457
+ <enumeration value="06" >
458
+ <annotation>
459
+ <documentation>BEZeko erakundeen multzoaren araudi berezia (maila aurreratua) - Régimen especial grupo de entidades en IVA (Nivel Avanzado)</documentation>
460
+ </annotation>
461
+ </enumeration>
462
+ <enumeration value="07" >
463
+ <annotation>
464
+ <documentation>Kutxa-irizpidearen araubide berezia - Régimen especial del criterio de caja</documentation>
465
+ </annotation>
466
+ </enumeration>
467
+ <enumeration value="08" >
468
+ <annotation>
469
+ <documentation>Ekoizpen, Zerbitzu eta Inportazioaren gaineko Zergari / Kanarietako Zeharkako Zerga Orokorrari lotutako eragiketak - Operaciones sujetas al IPSI/IGIC (Impuesto sobre la Producción, los Servicios y la Importación / Impuesto General Indirecto Canario)</documentation>
470
+ </annotation>
471
+ </enumeration>
472
+ <enumeration value="09" >
473
+ <annotation>
474
+ <documentation>Besteren izenean eta kontura ari diren bidai agentziek egindako zerbitzuen fakturazioa(Fakturazio Araudiko 3. xedapen gehigarria) - Facturación de las prestaciones de servicios de agencias de viaje que actúan como mediadoras en nombre y por cuenta ajena (disposición adicional 3ª del Reglamento de Facturación)</documentation>
475
+ </annotation>
476
+ </enumeration>
477
+ <enumeration value="10" >
478
+ <annotation>
479
+ <documentation>Hirugarrenen kontura kobratzea ordainsari profesionalak edo jabetza industrialetik eratorritako eskubideak, egilearenak edo bazkideen, bazkideen edo elkargokideen kontura kobratzeko eginkizun horiek betetzen dituzten sozietate, elkarte, elkargo profesional edo bestelako erakundeek egindakoak - Cobros por cuenta de terceros o terceras de honorarios profesionales o de derechos derivados de la propiedad industrial, de autor u otros por cuenta de sus socios, socias, asociados, asociadas, colegiados o colegiadas efectuados por sociedades, asociaciones, colegios profesionales u otras entidades que realicen estas funciones de cobro</documentation>
480
+ </annotation>
481
+ </enumeration>
482
+ <enumeration value="11" >
483
+ <annotation>
484
+ <documentation>Negozio lokala errentatzeko eragiketak, atxikipenari lotuak - Operaciones de arrendamiento de local de negocio sujetos a retención</documentation>
485
+ </annotation>
486
+ </enumeration>
487
+ <enumeration value="12" >
488
+ <annotation>
489
+ <documentation>Negozio lokala errentatzeko eragiketak, atxikipenari lotu gabeak - Operaciones de arrendamiento de local de negocio no sujetos a retención</documentation>
490
+ </annotation>
491
+ </enumeration>
492
+ <enumeration value="13" >
493
+ <annotation>
494
+ <documentation>Negozio lokala errentatzeko eragiketak, atxikipenari lotuak eta lotu gabeak - Operaciones de arrendamiento de local de negocio sujetas y no sujetas a retención</documentation>
495
+ </annotation>
496
+ </enumeration>
497
+ <enumeration value="14" >
498
+ <annotation>
499
+ <documentation>Hartzailea administrazio publiko bat denean ordaintzeke dauden BEZdun fakturak, obra ziurtagirietakoak - Factura con IVA pendiente de devengo en certificaciones de obra cuyo destinatario sea una Administración Pública</documentation>
500
+ </annotation>
501
+ </enumeration>
502
+ <enumeration value="15" >
503
+ <annotation>
504
+ <documentation>Segidako traktuko eragiketetan ordaintzeke dagoen BEZdun faktura - Factura con IVA pendiente de devengo en operaciones de tracto sucesivo</documentation>
505
+ </annotation>
506
+ </enumeration>
507
+ <enumeration value="51" >
508
+ <annotation>
509
+ <documentation>Baliokidetasun errekarguko eragiketak - Operaciones en recargo de equivalencia</documentation>
510
+ </annotation>
511
+ </enumeration>
512
+ <enumeration value="52" >
513
+ <annotation>
514
+ <documentation>Erregimen erraztuko eragiketak - Operaciones en régimen simplificado</documentation>
515
+ </annotation>
516
+ </enumeration>
517
+ <enumeration value="53" >
518
+ <annotation>
519
+ <documentation>BEZaren ondorioetarako enpresari edo profesionaltzat jotzen ez diren pertsona edo erakundeek egindako eragiketak - Operaciones realizadas por personas o entidades que no tengan la consideración de empresarios, empresarias o profesionales a efectos del IVA</documentation>
520
+ </annotation>
521
+ </enumeration>
522
+ </restriction>
523
+ </simpleType>
524
+ <!-- Lotutako eta salbuetsitako eragiketen salbuesteko kausa - Causa de exención de operaciones sujetas y exentas -->
525
+ <simpleType name="CausaExencionType">
526
+ <restriction base="string">
527
+ <enumeration value="E1">
528
+ <annotation>
529
+ <documentation >BEZaren Foru Arauaren 20. artikuluak salbuetsia - Exenta por el artículo 20 de la Norma Foral del IVA </documentation>
530
+ </annotation>
531
+ </enumeration>
532
+ <enumeration value="E2">
533
+ <annotation>
534
+ <documentation >BEZaren Foru Arauaren 21. artikuluak salbuetsia - Exenta por el artículo 21 de la Norma Foral del IVA </documentation>
535
+ </annotation>
536
+ </enumeration>
537
+ <enumeration value="E3">
538
+ <annotation>
539
+ <documentation >BEZaren Foru Arauaren 22. artikuluak salbuetsia - Exenta por el artículo 22 de la Norma Foral del IVA </documentation>
540
+ </annotation>
541
+ </enumeration>
542
+ <enumeration value="E4">
543
+ <annotation>
544
+ <documentation >BEZaren Foru Arauaren 23. eta 24. artikuluek salbuetsia - Exenta por el artículo 23 y 24 de la Norma Foral del IVA </documentation>
545
+ </annotation>
546
+ </enumeration>
547
+ <enumeration value="E5">
548
+ <annotation>
549
+ <documentation >BEZaren Foru Arauaren 25. artikuluak salbuetsia - Exenta por el artículo 25 de la Norma Foral del IVA </documentation>
550
+ </annotation>
551
+ </enumeration>
552
+ <enumeration value="E6">
553
+ <annotation>
554
+ <documentation >Beste arrazoi bategatik salbuetsia - Exenta por otra causa</documentation>
555
+ </annotation>
556
+ </enumeration>
557
+ </restriction>
558
+ </simpleType>
559
+ <!-- Salbuetsi gabeko mota - Tipo no exenta -->
560
+ <simpleType name="TipoOperacionSujetaNoExentaType">
561
+ <restriction base="string">
562
+ <enumeration value="S1">
563
+ <annotation>
564
+ <documentation >Subjektu pasiboaren inbertsiorik gabe - Sin inversión del sujeto pasivo</documentation>
565
+ </annotation>
566
+ </enumeration>
567
+ <enumeration value="S2">
568
+ <annotation>
569
+ <documentation >Subjektu pasiboaren inbertsioarekin - Con inversión del sujeto pasivo</documentation>
570
+ </annotation>
571
+ </enumeration>
572
+ </restriction>
573
+ </simpleType>
574
+ <!-- Hirugarren batek edo hartzaileak emandako faktura - Factura emitida por tercero o tercera o por destinatario o destinataria -->
575
+ <simpleType name="EmitidaPorTercerosType">
576
+ <restriction base="string">
577
+ <enumeration value="N">
578
+ <annotation>
579
+ <documentation>Hartzaileak berak emandako faktura - Factura emitida por el propio emisor o emisora</documentation>
580
+ </annotation>
581
+ </enumeration>
582
+ <enumeration value="T">
583
+ <annotation>
584
+ <documentation>Hirugarren batek egindako faktura - Factura emitida por tercero o tercera</documentation>
585
+ </annotation>
586
+ </enumeration>
587
+ <enumeration value="D">
588
+ <annotation>
589
+ <documentation>Eragiketaren hartzaileak emandako faktura - Factura emitida por el destinatario o la destinataria de la operación</documentation>
590
+ </annotation>
591
+ </enumeration>
592
+ </restriction>
593
+ </simpleType>
594
+ <simpleType name="SiNoType">
595
+ <restriction base="string">
596
+ <enumeration value="S"/>
597
+ <enumeration value="N"/>
598
+ </restriction>
599
+ </simpleType>
600
+ <!-- Ez lotzearen arrazoia - Causa de no sujeción -->
601
+ <simpleType name="CausaNoSujetaType">
602
+ <restriction base="string">
603
+ <enumeration value="OT">
604
+ <annotation>
605
+ <documentation>BEZaren Foru Arauaren 7. artikuluak lotu gabea Lotu gabeko beste kasu batzuk - No sujeto por el artículo 7 de la Norma Foral de IVA Otros supuestos de no sujeción</documentation>
606
+ </annotation>
607
+ </enumeration>
608
+ <enumeration value="RL">
609
+ <annotation>
610
+ <documentation>Lokalizazio arauengatik lotu gabe - No sujeto por reglas de localización</documentation>
611
+ </annotation>
612
+ </enumeration>
613
+ </restriction>
614
+ </simpleType>
615
+ <!-- Herrialdearen kodea - Código de país -->
616
+ <simpleType name="CountryType2">
617
+ <restriction base="string">
618
+ <enumeration value="AF"/>
619
+ <enumeration value="AL"/>
620
+ <enumeration value="DE"/>
621
+ <enumeration value="AD"/>
622
+ <enumeration value="AO"/>
623
+ <enumeration value="AI"/>
624
+ <enumeration value="AQ"/>
625
+ <enumeration value="AG"/>
626
+ <enumeration value="SA"/>
627
+ <enumeration value="DZ"/>
628
+ <enumeration value="AR"/>
629
+ <enumeration value="AM"/>
630
+ <enumeration value="AW"/>
631
+ <enumeration value="AU"/>
632
+ <enumeration value="AT"/>
633
+ <enumeration value="AZ"/>
634
+ <enumeration value="BS"/>
635
+ <enumeration value="BH"/>
636
+ <enumeration value="BD"/>
637
+ <enumeration value="BB"/>
638
+ <enumeration value="BE"/>
639
+ <enumeration value="BZ"/>
640
+ <enumeration value="BJ"/>
641
+ <enumeration value="BM"/>
642
+ <enumeration value="BY"/>
643
+ <enumeration value="BO"/>
644
+ <enumeration value="BA"/>
645
+ <enumeration value="BW"/>
646
+ <enumeration value="BV"/>
647
+ <enumeration value="BR"/>
648
+ <enumeration value="BN"/>
649
+ <enumeration value="BG"/>
650
+ <enumeration value="BF"/>
651
+ <enumeration value="BI"/>
652
+ <enumeration value="BT"/>
653
+ <enumeration value="CV"/>
654
+ <enumeration value="KY"/>
655
+ <enumeration value="KH"/>
656
+ <enumeration value="CM"/>
657
+ <enumeration value="CA"/>
658
+ <enumeration value="CF"/>
659
+ <enumeration value="CC"/>
660
+ <enumeration value="CO"/>
661
+ <enumeration value="KM"/>
662
+ <enumeration value="CG"/>
663
+ <enumeration value="CD"/>
664
+ <enumeration value="CK"/>
665
+ <enumeration value="KP"/>
666
+ <enumeration value="KR"/>
667
+ <enumeration value="CI"/>
668
+ <enumeration value="CR"/>
669
+ <enumeration value="HR"/>
670
+ <enumeration value="CU"/>
671
+ <enumeration value="TD"/>
672
+ <enumeration value="CZ"/>
673
+ <enumeration value="CL"/>
674
+ <enumeration value="CN"/>
675
+ <enumeration value="CY"/>
676
+ <enumeration value="CW"/>
677
+ <enumeration value="DK"/>
678
+ <enumeration value="DM"/>
679
+ <enumeration value="DO"/>
680
+ <enumeration value="EC"/>
681
+ <enumeration value="EG"/>
682
+ <enumeration value="AE"/>
683
+ <enumeration value="ER"/>
684
+ <enumeration value="SK"/>
685
+ <enumeration value="SI"/>
686
+ <enumeration value="ES"/>
687
+ <enumeration value="US"/>
688
+ <enumeration value="EE"/>
689
+ <enumeration value="ET"/>
690
+ <enumeration value="FO"/>
691
+ <enumeration value="PH"/>
692
+ <enumeration value="FI"/>
693
+ <enumeration value="FJ"/>
694
+ <enumeration value="FR"/>
695
+ <enumeration value="GA"/>
696
+ <enumeration value="GM"/>
697
+ <enumeration value="GE"/>
698
+ <enumeration value="GS"/>
699
+ <enumeration value="GH"/>
700
+ <enumeration value="GI"/>
701
+ <enumeration value="GD"/>
702
+ <enumeration value="GR"/>
703
+ <enumeration value="GL"/>
704
+ <enumeration value="GU"/>
705
+ <enumeration value="GT"/>
706
+ <enumeration value="GG"/>
707
+ <enumeration value="GN"/>
708
+ <enumeration value="GQ"/>
709
+ <enumeration value="GW"/>
710
+ <enumeration value="GY"/>
711
+ <enumeration value="HT"/>
712
+ <enumeration value="HM"/>
713
+ <enumeration value="HN"/>
714
+ <enumeration value="HK"/>
715
+ <enumeration value="HU"/>
716
+ <enumeration value="IN"/>
717
+ <enumeration value="ID"/>
718
+ <enumeration value="IR"/>
719
+ <enumeration value="IQ"/>
720
+ <enumeration value="IE"/>
721
+ <enumeration value="IM"/>
722
+ <enumeration value="IS"/>
723
+ <enumeration value="IL"/>
724
+ <enumeration value="IT"/>
725
+ <enumeration value="JM"/>
726
+ <enumeration value="JP"/>
727
+ <enumeration value="JE"/>
728
+ <enumeration value="JO"/>
729
+ <enumeration value="KZ"/>
730
+ <enumeration value="KE"/>
731
+ <enumeration value="KG"/>
732
+ <enumeration value="KI"/>
733
+ <enumeration value="KW"/>
734
+ <enumeration value="LA"/>
735
+ <enumeration value="LS"/>
736
+ <enumeration value="LV"/>
737
+ <enumeration value="LB"/>
738
+ <enumeration value="LR"/>
739
+ <enumeration value="LY"/>
740
+ <enumeration value="LI"/>
741
+ <enumeration value="LT"/>
742
+ <enumeration value="LU"/>
743
+ <enumeration value="XG"/>
744
+ <enumeration value="MO"/>
745
+ <enumeration value="MK"/>
746
+ <enumeration value="MG"/>
747
+ <enumeration value="MY"/>
748
+ <enumeration value="MW"/>
749
+ <enumeration value="MV"/>
750
+ <enumeration value="ML"/>
751
+ <enumeration value="MT"/>
752
+ <enumeration value="FK"/>
753
+ <enumeration value="MP"/>
754
+ <enumeration value="MA"/>
755
+ <enumeration value="MH"/>
756
+ <enumeration value="MU"/>
757
+ <enumeration value="MR"/>
758
+ <enumeration value="YT"/>
759
+ <enumeration value="UM"/>
760
+ <enumeration value="MX"/>
761
+ <enumeration value="FM"/>
762
+ <enumeration value="MD"/>
763
+ <enumeration value="MC"/>
764
+ <enumeration value="MN"/>
765
+ <enumeration value="ME"/>
766
+ <enumeration value="MS"/>
767
+ <enumeration value="MZ"/>
768
+ <enumeration value="MM"/>
769
+ <enumeration value="NA"/>
770
+ <enumeration value="NR"/>
771
+ <enumeration value="CX"/>
772
+ <enumeration value="NP"/>
773
+ <enumeration value="NI"/>
774
+ <enumeration value="NE"/>
775
+ <enumeration value="NG"/>
776
+ <enumeration value="NU"/>
777
+ <enumeration value="NF"/>
778
+ <enumeration value="NO"/>
779
+ <enumeration value="NC"/>
780
+ <enumeration value="NZ"/>
781
+ <enumeration value="IO"/>
782
+ <enumeration value="OM"/>
783
+ <enumeration value="NL"/>
784
+ <enumeration value="BQ"/>
785
+ <enumeration value="PK"/>
786
+ <enumeration value="PW"/>
787
+ <enumeration value="PA"/>
788
+ <enumeration value="PG"/>
789
+ <enumeration value="PY"/>
790
+ <enumeration value="PE"/>
791
+ <enumeration value="PN"/>
792
+ <enumeration value="PF"/>
793
+ <enumeration value="PL"/>
794
+ <enumeration value="PT"/>
795
+ <enumeration value="PR"/>
796
+ <enumeration value="QA"/>
797
+ <enumeration value="GB"/>
798
+ <enumeration value="RW"/>
799
+ <enumeration value="RO"/>
800
+ <enumeration value="RU"/>
801
+ <enumeration value="SB"/>
802
+ <enumeration value="SV"/>
803
+ <enumeration value="WS"/>
804
+ <enumeration value="AS"/>
805
+ <enumeration value="KN"/>
806
+ <enumeration value="SM"/>
807
+ <enumeration value="SX"/>
808
+ <enumeration value="PM"/>
809
+ <enumeration value="VC"/>
810
+ <enumeration value="SH"/>
811
+ <enumeration value="LC"/>
812
+ <enumeration value="ST"/>
813
+ <enumeration value="SN"/>
814
+ <enumeration value="RS"/>
815
+ <enumeration value="SC"/>
816
+ <enumeration value="SL"/>
817
+ <enumeration value="SG"/>
818
+ <enumeration value="SY"/>
819
+ <enumeration value="SO"/>
820
+ <enumeration value="LK"/>
821
+ <enumeration value="SZ"/>
822
+ <enumeration value="ZA"/>
823
+ <enumeration value="SD"/>
824
+ <enumeration value="SS"/>
825
+ <enumeration value="SE"/>
826
+ <enumeration value="CH"/>
827
+ <enumeration value="SR"/>
828
+ <enumeration value="TH"/>
829
+ <enumeration value="TW"/>
830
+ <enumeration value="TZ"/>
831
+ <enumeration value="TJ"/>
832
+ <enumeration value="PS"/>
833
+ <enumeration value="TF"/>
834
+ <enumeration value="TL"/>
835
+ <enumeration value="TG"/>
836
+ <enumeration value="TK"/>
837
+ <enumeration value="TO"/>
838
+ <enumeration value="TT"/>
839
+ <enumeration value="TN"/>
840
+ <enumeration value="TC"/>
841
+ <enumeration value="TM"/>
842
+ <enumeration value="TR"/>
843
+ <enumeration value="TV"/>
844
+ <enumeration value="UA"/>
845
+ <enumeration value="UG"/>
846
+ <enumeration value="UY"/>
847
+ <enumeration value="UZ"/>
848
+ <enumeration value="VU"/>
849
+ <enumeration value="VA"/>
850
+ <enumeration value="VE"/>
851
+ <enumeration value="VN"/>
852
+ <enumeration value="VG"/>
853
+ <enumeration value="VI"/>
854
+ <enumeration value="WF"/>
855
+ <enumeration value="YE"/>
856
+ <enumeration value="DJ"/>
857
+ <enumeration value="ZM"/>
858
+ <enumeration value="ZW"/>
859
+ <enumeration value="QU"/>
860
+ <enumeration value="XB"/>
861
+ <enumeration value="XU"/>
862
+ <enumeration value="XN"/>
863
+ </restriction>
864
+ </simpleType>
865
+ </schema>