Subversion Repositories Integrator Subversion

Rev

Rev 182 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 espaco 1
<?xml version="1.0" encoding="UTF-8"?>
2
<xs:schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.portalfiscal.inf.br/nfe" targetNamespace="http://www.portalfiscal.inf.br/nfe" elementFormDefault="qualified" attributeFormDefault="unqualified">
3
        <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema_v1.01.xsd"/>
4
        <xs:include schemaLocation="tiposBasico_v1.03.xsd"/>
5
        <xs:complexType name="TEvento">
6
                <xs:annotation>
7
                        <xs:documentation>Tipo Evento</xs:documentation>
8
                </xs:annotation>
9
                <xs:sequence>
10
                        <xs:element name="infEvento">
11
                                <xs:complexType>
12
                                        <xs:sequence>
13
                                                <xs:element name="cOrgao" type="TCOrgaoIBGE">
14
                                                        <xs:annotation>
15
                                                                <xs:documentation>Código do órgão de recepção do Evento. Utilizar a Tabela do IBGE extendida, utilizar 91 para identificar o Ambiente Nacional</xs:documentation>
16
                                                        </xs:annotation>
17
                                                </xs:element>
18
                                                <xs:element name="tpAmb" type="TAmb">
19
                                                        <xs:annotation>
20
                                                                <xs:documentation>Identificação do Ambiente:
21
1 - Produção
22
2 - Homologação</xs:documentation>
23
                                                        </xs:annotation>
24
                                                </xs:element>
25
                                                <xs:choice>
26
                                                        <xs:annotation>
27
                                                                <xs:documentation>Identificação do  autor do evento</xs:documentation>
28
                                                        </xs:annotation>
29
                                                        <xs:element name="CNPJ" type="TCnpjOpc">
30
                                                                <xs:annotation>
31
                                                                        <xs:documentation>CNPJ</xs:documentation>
32
                                                                </xs:annotation>
33
                                                        </xs:element>
34
                                                        <xs:element name="CPF" type="TCpf">
35
                                                                <xs:annotation>
36
                                                                        <xs:documentation>CPF</xs:documentation>
37
                                                                </xs:annotation>
38
                                                        </xs:element>
39
                                                </xs:choice>
40
                                                <xs:element name="chNFe" type="TChNFe">
41
                                                        <xs:annotation>
42
                                                                <xs:documentation>Chave de Acesso da NF-e vinculada ao evento</xs:documentation>
43
                                                        </xs:annotation>
44
                                                </xs:element>
45
                                                <xs:element name="dhEvento" type="TDateTimeUTC">
46
                                                        <xs:annotation>
47
                                                                <xs:documentation>Data e Hora do Evento, formato UTC (AAAA-MM-DDThh:mm:ssTZD, onde TZD = +hh:mm ou -hh:mm)</xs:documentation>
48
                                                        </xs:annotation>
49
                                                </xs:element>
50
                                                <xs:element name="tpEvento">
51
                                                        <xs:annotation>
52
                                                                <xs:documentation>Tipo do Evento</xs:documentation>
53
                                                        </xs:annotation>
54
                                                        <xs:simpleType>
55
                                                                <xs:restriction base="xs:string">
56
                                                                        <xs:whiteSpace value="preserve"/>
57
                                                                        <xs:pattern value="[0-9]{6}"/>
58
                                                                        <xs:enumeration value="110111"/>
59
                                                                </xs:restriction>
60
                                                        </xs:simpleType>
61
                                                </xs:element>
62
                                                <xs:element name="nSeqEvento">
63
                                                        <xs:annotation>
64
                                                                <xs:documentation>Seqüencial do evento para o mesmo tipo de evento.  Para maioria dos eventos será 1, nos casos em que possa existir mais de um evento, como é o caso da carta de correção, o autor do evento deve numerar de forma seqüencial.</xs:documentation>
65
                                                        </xs:annotation>
66
                                                        <xs:simpleType>
67
                                                                <xs:restriction base="xs:string">
68
                                                                        <xs:whiteSpace value="preserve"/>
69
                                                                        <xs:pattern value="[1-9]|[1][0-9]{0,1}|20"/>
70
                                                                </xs:restriction>
71
                                                        </xs:simpleType>
72
                                                </xs:element>
73
                                                <xs:element name="verEvento">
74
                                                        <xs:annotation>
75
                                                                <xs:documentation>Versão do Tipo do Evento</xs:documentation>
76
                                                        </xs:annotation>
77
                                                        <xs:simpleType>
78
                                                                <xs:restriction base="xs:string">
79
                                                                        <xs:whiteSpace value="preserve"/>
80
                                                                        <xs:enumeration value="1.00"/>
81
                                                                </xs:restriction>
82
                                                        </xs:simpleType>
83
                                                </xs:element>
84
                                                <xs:element name="detEvento">
85
                                                        <xs:annotation>
86
                                                                <xs:documentation>Schema XML de validação do evento do cancelamento 1101111</xs:documentation>
87
                                                        </xs:annotation>
88
                                                        <xs:complexType>
89
                                                                <xs:sequence>
90
                                                                        <xs:element name="descEvento">
91
                                                                                <xs:annotation>
92
                                                                                        <xs:documentation>Descrição do Evento - “Cancelamento”</xs:documentation>
93
                                                                                </xs:annotation>
94
                                                                                <xs:simpleType>
95
                                                                                        <xs:restriction base="xs:string">
96
                                                                                                <xs:whiteSpace value="preserve"/>
97
                                                                                                <xs:enumeration value="Cancelamento"/>
98
                                                                                        </xs:restriction>
99
                                                                                </xs:simpleType>
100
                                                                        </xs:element>
101
                                                                        <xs:element name="nProt" type="TProt">
102
                                                                                <xs:annotation>
103
                                                                                        <xs:documentation>Número do Protocolo de Status da NF-e. 1 posição (1 – Secretaria de Fazenda Estadual 2 – Receita Federal); 2 posições ano; 10 seqüencial no ano.</xs:documentation>
104
                                                                                </xs:annotation>
105
                                                                        </xs:element>
106
                                                                        <xs:element name="xJust" type="TJust">
107
                                                                                <xs:annotation>
108
                                                                                        <xs:documentation>Justificativa do cancelamento</xs:documentation>
109
                                                                                </xs:annotation>
110
                                                                        </xs:element>
111
                                                                </xs:sequence>
112
                                                                <xs:attribute name="versao" use="required">
113
                                                                        <xs:simpleType>
114
                                                                                <xs:restriction base="xs:string">
115
                                                                                        <xs:whiteSpace value="preserve"/>
116
                                                                                        <xs:enumeration value="1.00"/>
117
                                                                                </xs:restriction>
118
                                                                        </xs:simpleType>
119
                                                                </xs:attribute>
120
                                                        </xs:complexType>
121
                                                </xs:element>
122
                                        </xs:sequence>
123
                                        <xs:attribute name="Id" use="required">
124
                                                <xs:annotation>
125
                                                        <xs:documentation>Identificador da TAG a ser assinada, a regra de formação do Id é:
126
“ID” + tpEvento +  chave da NF-e + nSeqEvento</xs:documentation>
127
                                                </xs:annotation>
128
                                                <xs:simpleType>
129
                                                        <xs:restriction base="xs:ID">
130
                                                                <xs:pattern value="ID[0-9]{52}"/>
131
                                                        </xs:restriction>
132
                                                </xs:simpleType>
133
                                        </xs:attribute>
134
                                </xs:complexType>
135
                        </xs:element>
136
                        <xs:element ref="ds:Signature"/>
137
                </xs:sequence>
138
                <xs:attribute name="versao" type="TVerEvento" use="required"/>
139
        </xs:complexType>
140
        <xs:complexType name="TRetEvento">
141
                <xs:annotation>
142
                        <xs:documentation>Tipo retorno do Evento</xs:documentation>
143
                </xs:annotation>
144
                <xs:sequence>
145
                        <xs:element name="infEvento">
146
                                <xs:complexType>
147
                                        <xs:sequence>
148
                                                <xs:element name="tpAmb" type="TAmb">
149
                                                        <xs:annotation>
150
                                                                <xs:documentation>Identificação do Ambiente:
151
1 - Produção
152
2 - Homologação</xs:documentation>
153
                                                        </xs:annotation>
154
                                                </xs:element>
155
                                                <xs:element name="verAplic" type="TVerAplic">
156
                                                        <xs:annotation>
157
                                                                <xs:documentation>Versão do Aplicativo que recebeu o Evento</xs:documentation>
158
                                                        </xs:annotation>
159
                                                </xs:element>
160
                                                <xs:element name="cOrgao" type="TCOrgaoIBGE">
161
                                                        <xs:annotation>
162
                                                                <xs:documentation>Código do órgão de recepção do Evento. Utilizar a Tabela do IBGE extendida, utilizar 91 para identificar o Ambiente Nacional</xs:documentation>
163
                                                        </xs:annotation>
164
                                                </xs:element>
165
                                                <xs:element name="cStat" type="TStat">
166
                                                        <xs:annotation>
167
                                                                <xs:documentation>Código do status da registro do Evento</xs:documentation>
168
                                                        </xs:annotation>
169
                                                </xs:element>
170
                                                <xs:element name="xMotivo" type="TMotivo">
171
                                                        <xs:annotation>
172
                                                                <xs:documentation>Descrição literal do status do registro do Evento</xs:documentation>
173
                                                        </xs:annotation>
174
                                                </xs:element>
175
                                                <xs:element name="chNFe" type="TChNFe" minOccurs="0">
176
                                                        <xs:annotation>
177
                                                                <xs:documentation>Chave de Acesso NF-e vinculada</xs:documentation>
178
                                                        </xs:annotation>
179
                                                </xs:element>
180
                                                <xs:element name="tpEvento" minOccurs="0">
181
                                                        <xs:annotation>
182
                                                                <xs:documentation>Tipo do Evento vinculado</xs:documentation>
183
                                                        </xs:annotation>
184
                                                        <xs:simpleType>
185
                                                                <xs:restriction base="xs:string">
186
                                                                        <xs:whiteSpace value="preserve"/>
187
                                                                        <xs:pattern value="[0-9]{6}"/>
188
                                                                </xs:restriction>
189
                                                        </xs:simpleType>
190
                                                </xs:element>
191
                                                <xs:element name="xEvento" minOccurs="0">
192
                                                        <xs:annotation>
193
                                                                <xs:documentation>Descrição do Evento</xs:documentation>
194
                                                        </xs:annotation>
195
                                                        <xs:simpleType>
196
                                                                <xs:restriction base="TString">
197
                                                                        <xs:minLength value="5"/>
198
                                                                        <xs:maxLength value="60"/>
199
                                                                </xs:restriction>
200
                                                        </xs:simpleType>
201
                                                </xs:element>
202
                                                <xs:element name="nSeqEvento" minOccurs="0">
203
                                                        <xs:annotation>
204
                                                                <xs:documentation>Seqüencial do evento</xs:documentation>
205
                                                        </xs:annotation>
206
                                                        <xs:simpleType>
207
                                                                <xs:restriction base="xs:string">
208
                                                                        <xs:whiteSpace value="preserve"/>
209
                                                                        <xs:pattern value="[1-9][0-9]{0,1}"/>
210
                                                                </xs:restriction>
211
                                                        </xs:simpleType>
212
                                                </xs:element>
213
                                                <xs:choice minOccurs="0">
214
                                                        <xs:annotation>
215
                                                                <xs:documentation>Identificação do  destinatário da NF-e</xs:documentation>
216
                                                        </xs:annotation>
217
                                                        <xs:element name="CNPJDest" type="TCnpjOpc">
218
                                                                <xs:annotation>
219
                                                                        <xs:documentation>CNPJ Destinatário</xs:documentation>
220
                                                                </xs:annotation>
221
                                                        </xs:element>
222
                                                        <xs:element name="CPFDest" type="TCpf">
223
                                                                <xs:annotation>
224
                                                                        <xs:documentation>CPF Destiantário</xs:documentation>
225
                                                                </xs:annotation>
226
                                                        </xs:element>
227
                                                </xs:choice>
228
                                                <xs:element name="emailDest" minOccurs="0">
229
                                                        <xs:annotation>
230
                                                                <xs:documentation>email do destinatário</xs:documentation>
231
                                                        </xs:annotation>
232
                                                        <xs:simpleType>
233
                                                                <xs:restriction base="TString">
234
                                                                        <xs:minLength value="1"/>
235
                                                                        <xs:maxLength value="60"/>
236
                                                                </xs:restriction>
237
                                                        </xs:simpleType>
238
                                                </xs:element>
239
                                                <xs:element name="dhRegEvento">
240
                                                        <xs:annotation>
241
                                                                <xs:documentation>Data e Hora de do recebimento do evento ou do registro do evento formato UTC AAAA-MM-DDThh:mm:ssTZD.</xs:documentation>
242
                                                        </xs:annotation>
243
                                                        <xs:simpleType>
244
                                                                <xs:restriction base="xs:string">
245
                                                                        <xs:whiteSpace value="preserve"/>
246
                                                                        <xs:pattern value="(((20(([02468][048])|([13579][26]))-02-29))|(20[0-9][0-9])-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\d)|(2[0-8])))|((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30)))))T(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d-0[1-4]:00"/>
247
                                                                </xs:restriction>
248
                                                        </xs:simpleType>
249
                                                </xs:element>
250
                                                <xs:element name="nProt" type="TProt" minOccurs="0">
251
                                                        <xs:annotation>
252
                                                                <xs:documentation>Número do protocolo de registro do evento</xs:documentation>
253
                                                        </xs:annotation>
254
                                                </xs:element>
255
                                        </xs:sequence>
256
                                        <xs:attribute name="Id" use="optional">
257
                                                <xs:simpleType>
258
                                                        <xs:restriction base="xs:ID">
259
                                                                <xs:pattern value="ID[0-9]{15}"/>
260
                                                        </xs:restriction>
261
                                                </xs:simpleType>
262
                                        </xs:attribute>
263
                                </xs:complexType>
264
                        </xs:element>
265
                        <xs:element ref="ds:Signature" minOccurs="0"/>
266
                </xs:sequence>
267
                <xs:attribute name="versao" type="TVerEvento" use="required"/>
268
        </xs:complexType>
269
        <xs:complexType name="TEnvEvento">
270
                <xs:annotation>
271
                        <xs:documentation> Tipo Lote de Envio</xs:documentation>
272
                </xs:annotation>
273
                <xs:sequence>
274
                        <xs:element name="idLote">
275
                                <xs:simpleType>
276
                                        <xs:restriction base="xs:string">
277
                                                <xs:whiteSpace value="preserve"/>
278
                                                <xs:pattern value="[0-9]{1,15}"/>
279
                                        </xs:restriction>
280
                                </xs:simpleType>
281
                        </xs:element>
282
                        <xs:element name="evento" type="TEvento" maxOccurs="20"/>
283
                </xs:sequence>
284
                <xs:attribute name="versao" type="TVerEnvEvento" use="required"/>
285
        </xs:complexType>
286
        <xs:complexType name="TRetEnvEvento">
287
                <xs:annotation>
288
                        <xs:documentation> Tipo Retorno de Lote de Envio</xs:documentation>
289
                </xs:annotation>
290
                <xs:sequence>
291
                        <xs:element name="idLote">
292
                                <xs:simpleType>
293
                                        <xs:restriction base="xs:string">
294
                                                <xs:whiteSpace value="preserve"/>
295
                                                <xs:pattern value="[0-9]{1,15}"/>
296
                                        </xs:restriction>
297
                                </xs:simpleType>
298
                        </xs:element>
299
                        <xs:element name="tpAmb" type="TAmb">
300
                                <xs:annotation>
301
                                        <xs:documentation>Identificação do Ambiente:
302
1 - Produção
303
2 - Homologação</xs:documentation>
304
                                </xs:annotation>
305
                        </xs:element>
306
                        <xs:element name="verAplic" type="TVerAplic">
307
                                <xs:annotation>
308
                                        <xs:documentation>Versão do Aplicativo que recebeu o Evento</xs:documentation>
309
                                </xs:annotation>
310
                        </xs:element>
311
                        <xs:element name="cOrgao" type="TCOrgaoIBGE">
312
                                <xs:annotation>
313
                                        <xs:documentation>Código do òrgao que registrou o Evento</xs:documentation>
314
                                </xs:annotation>
315
                        </xs:element>
316
                        <xs:element name="cStat" type="TStat">
317
                                <xs:annotation>
318
                                        <xs:documentation>Código do status da registro do Evento</xs:documentation>
319
                                </xs:annotation>
320
                        </xs:element>
321
                        <xs:element name="xMotivo" type="TMotivo">
322
                                <xs:annotation>
323
                                        <xs:documentation>Descrição literal do status do registro do Evento</xs:documentation>
324
                                </xs:annotation>
325
                        </xs:element>
326
                        <xs:element name="retEvento" type="TRetEvento" minOccurs="0" maxOccurs="20"/>
327
                </xs:sequence>
328
                <xs:attribute name="versao" type="TVerEnvEvento" use="required"/>
329
        </xs:complexType>
330
        <xs:complexType name="TProcEvento">
331
                <xs:annotation>
332
                        <xs:documentation>Tipo procEvento</xs:documentation>
333
                </xs:annotation>
334
                <xs:sequence>
335
                        <xs:element name="evento" type="TEvento"/>
336
                        <xs:element name="retEvento" type="TRetEvento"/>
337
                </xs:sequence>
338
                <xs:attribute name="versao" type="TVerEvento" use="required"/>
339
        </xs:complexType>
340
        <xs:simpleType name="TVerEnvEvento">
341
                <xs:annotation>
342
                        <xs:documentation>Tipo Versão do EnvEvento</xs:documentation>
343
                </xs:annotation>
344
                <xs:restriction base="xs:string">
345
                        <xs:whiteSpace value="preserve"/>
346
                        <xs:pattern value="1\.00"/>
347
                </xs:restriction>
348
        </xs:simpleType>
349
        <xs:simpleType name="TVerEvento">
350
                <xs:annotation>
351
                        <xs:documentation>Tipo Versão do Evento</xs:documentation>
352
                </xs:annotation>
353
                <xs:restriction base="xs:string">
354
                        <xs:whiteSpace value="preserve"/>
355
                        <xs:pattern value="1\.00"/>
356
                </xs:restriction>
357
        </xs:simpleType>
358
        <xs:simpleType name="TCOrgaoIBGE">
359
                <xs:annotation>
360
                        <xs:documentation>Tipo Código de orgão (UF da tabela do IBGE + 91 RFB)</xs:documentation>
361
                </xs:annotation>
362
                <xs:restriction base="xs:string">
363
                        <xs:whiteSpace value="preserve"/>
364
                        <xs:enumeration value="11"/>
365
                        <xs:enumeration value="12"/>
366
                        <xs:enumeration value="13"/>
367
                        <xs:enumeration value="14"/>
368
                        <xs:enumeration value="15"/>
369
                        <xs:enumeration value="16"/>
370
                        <xs:enumeration value="17"/>
371
                        <xs:enumeration value="21"/>
372
                        <xs:enumeration value="22"/>
373
                        <xs:enumeration value="23"/>
374
                        <xs:enumeration value="24"/>
375
                        <xs:enumeration value="25"/>
376
                        <xs:enumeration value="26"/>
377
                        <xs:enumeration value="27"/>
378
                        <xs:enumeration value="28"/>
379
                        <xs:enumeration value="29"/>
380
                        <xs:enumeration value="31"/>
381
                        <xs:enumeration value="32"/>
382
                        <xs:enumeration value="33"/>
383
                        <xs:enumeration value="35"/>
384
                        <xs:enumeration value="41"/>
385
                        <xs:enumeration value="42"/>
386
                        <xs:enumeration value="43"/>
387
                        <xs:enumeration value="50"/>
388
                        <xs:enumeration value="51"/>
389
                        <xs:enumeration value="52"/>
390
                        <xs:enumeration value="53"/>
391
                        <xs:enumeration value="91"/>
392
                </xs:restriction>
393
        </xs:simpleType>
394
</xs:schema>