forked from akretion/nfelib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.sh
executable file
·142 lines (125 loc) · 8.54 KB
/
script.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#! /bin/sh
#DOWNLOAD_SCHEMAS=1
# Pacote de Liberação nº 9k (Novo leiaute da NF-e, NT 2023.001 v.1.20). Publicado em 11/04/2023
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n nfe -v v4_0 -u https://www.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=C9Qz1lqk6eo=
rm -rf nfelib/nfe/schemas
cp -rf /tmp/generated/nfe/schemas nfelib/nfe/schemas
fi
export XSDATA_SCHEMA="nfe" # se xsdata-odoo tiver instalado, ativa um patch do xsdata
# detalhes aqui https://github.com/akretion/nfelib/issues/40
xsdata generate --include-header nfelib/nfe/schemas/v4_0 --package nfelib.nfe.bindings.v4_0
unset XSDATA_SCHEMA
# Pacote de Liberação Distribuição de DF-e v1.02 (Atualizado em 25/10/16)
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n nfe_dist_dfe -v v1_0 -u https://www.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=n3Kn9%20YZNak=
rm -rf nfelib/nfe_dist_dfe/schemas
cp -rf /tmp/generated/nfe_dist_dfe/schemas nfelib/nfe_dist_dfe/schemas
fi
xsdata generate --include-header nfelib/nfe_dist_dfe/schemas/v1_0 --package nfelib.nfe_dist_dfe.bindings.v1_0
# Pacote de Liberação Evento Generico v1.01 (Atualizado em 30/05/2014)
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n nfe_evento_generico -v v1_0 -u http://hom.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=YaiBe2csOmA=
rm -rf nfelib/nfe_evento_generico/schemas
cp -rf /tmp/generated/nfe_evento_generico/schemas nfelib/nfe_evento_generico/schemas
fi
xsdata generate --include-header nfelib/nfe_evento_generico/schemas/v1_0 --package nfelib.nfe_evento_generico.bindings.v1_0
# Pacote de Liberação Evento Canc v1.01 (30/05/2014)
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n nfe_evento_cancel -v v1_0 -u http://hom.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=MtjAJ1Rurjc=
rm -rf nfelib/nfe_evento_cancel/schemas
cp -rf /tmp/generated/nfe_evento_cancel/schemas nfelib/nfe_evento_cancel/schemas
fi
xsdata generate --include-header nfelib/nfe_evento_cancel/schemas/v1_0 --package nfelib.nfe_evento_cancel.bindings.v1_0
# Pacote de Liberação Evento CCe v1.01 (30/05/2014)
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n nfe_evento_cce -v v1_0 -u https://www.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=P/FXaGiLKo0=
rm -rf nfelib/nfe_evento_cce/schemas
cp -rf /tmp/generated/nfe_evento_cce/schemas nfelib/nfe_evento_cce/schemas
fi
xsdata generate --include-header nfelib/nfe_evento_cce/schemas/v1_0 --package nfelib.nfe_evento_cce.bindings.v1_0
# Pacote de Liberação Evento Manifesta Destinatário v1.01 (30/05/2014)
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n nfe_evento_mde -v v1_0 -u https://www.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=y2nVL6/GFlU=
# mude o encoding desse arquivo xsd de iso-8859-1 para utf-8 e amaldiçoe o cara que usou iso-8859-1
iconv -f iso-8859-1 /tmp/generated/nfe_evento_mde/schemas/v1_0/retEnvConfRecebto_v1.00.xsd -t UTF-8 -o /tmp/generated/nfe_evento_mde/schemas/v1_0/retEnvConfRecebto_v1.00.xsd
rm -rf nfelib/nfe_evento_mdef/schemas
cp -rf /tmp/generated/nfe_evento_mde/schemas nfelib/nfe_evento_mde/schemas
fi
xsdata generate --include-header nfelib/nfe_evento_mde/schemas/v1_0 --package nfelib.nfe_evento_mde.bindings.v1_0
# Consulta Cadastro - Pacote de Liberação No. 6t (21/03/2014)
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n nfe_cons -v v2_0 -u https://www.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=/KLQ3Wi0ckY=
rm -rf /tmp/generated/nfe_cons/schemas/v2_0/*v2.00.xsd
rm -rf nfelib/nfe_cons/schemas
cp -rf /tmp/generated/nfe_cons/schemas nfelib/nfe_cons/schemas
fi
xsdata generate --include-header nfelib/nfe_cons/schemas/v2_0 --package nfelib.nfe_cons.bindings.v2_0
# Evento Ator Interessado na NF-e - Transportador. Publicado em 28/01/2021.
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n nfe_ator_interessado -v v1_0 -u https://www.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=ufthUw%20oQd8=
rm -rf nfelib/nfe_ator_interessado/schemas
cp -rf /tmp/generated/nfe_ator_interessado/schemas nfelib/nfe_ator_interessado/schemas
fi
xsdata generate --include-header nfelib/nfe_ator_interessado/schemas/v1_0 --package nfelib.nfe_ator_interessado.bindings.v1_0
# Evento Prévio de Emissão em Contingência (EPEC) - v1.01 (30/05/2014)
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n nfe_epec -v v1_0 -u https://www.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=HcoVPI2JvY0=
rm -rf nfelib/nfe_epec/schemas
cp -rf /tmp/generated/nfe_ator_interessado/schemas nfelib/nfe_epec/schemas
fi
# xsdata generate --include-header nfelib/nfe_epec/schemas/v1_0 --package nfelib.nfe_epec.bindings.v1_0
# fix the main two files with -ss single-package to avoid circular deps:
xsdata generate --include-header nfelib/nfe_epec/schemas/v1_0/e110140_v1.00.xsd -ss single-package --package=nfelib.nfe_epec.bindings.v1_0.e110140_v1_00
xsdata generate --include-header nfelib/nfe_epec/schemas/v1_0/leiauteEPEC_v1.00.xsd -ss single-package --package=nfelib.nfe_epec.bindings.v1_0.leiaute_epec_v1_00
# Evento Comprovante Entrega da NF-e . Publicado em 19/05/2021 (Atualizado em 15/06/2021)
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n nfe_entrega -v v1_0 -u https://www.nfe.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=2AWmHNFOCe8=
rm -rf nfelib/nfe_entrega/schemas
cp -rf /tmp/generated/nfe_entrega/schemas nfelib/nfe_entrega/schemas
fi
xsdata generate --include-header nfelib/nfe_entrega/schemas/v1_0 --package nfelib.nfe_entrega.bindings.v1_0
# CT-e - Pacote de Liberação 4.00a (ZIP) - (NT 2021.001) (Publicado em 30/01/2023) Atualizado em 28/04/2023
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n cte -v v4_0 -u https://www.cte.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=kNBS3lIIyOY=
rm -rf nfelib/cte/schemas
cp -rf /tmp/generated/cte/schemas nfelib/cte/schemas
fi
xsdata generate --include-header nfelib/cte/schemas/v4_0 --package nfelib.cte.bindings.v4_0
# CT-e - Web Service Distribuição de DF-e de Interesse dos Atores do CT-e
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n cte_dist_dfe -v v1_0 -u https://www.cte.fazenda.gov.br/portal/exibirArquivo.aspx?conteudo=l6I2ehbBicE=
rm -rf nfelib/cte_dist_dfe/schemas
cp -rf /tmp/generated/cte_dist_dfe/schemas nfelib/cte_dist_dfe/schemas
fi
xsdata generate --include-header nfelib/cte_dist_dfe/schemas/v1_0 --package nfelib.cte_dist_dfe.bindings.v1_0
# MDF-e - Manifesto Eletrônico de Documentos Fiscais - Schema NT 2021.002 (05/04/2021)
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n mdfe -v v3_0 -u https://mdfe-portal.svrs.rs.gov.br/MDFE/DownloadArquivoEstatico/?sistema=MDFE&tipoArquivo=2&nomeArquivo=PL_MDFe_300a_NT022021.zip
# NOTE this one was actually downloaded manually to /tmp/generated/mdfe/schemas/v3_0
rm -rf nfelib/mdfe/schemas
cp -rf /tmp/generated/mdfe/schemas nfelib/mdfe/schemas
fi
xsdata generate --include-header nfelib/mdfe/schemas/v3_0 --package nfelib.mdfe.bindings.v3_0
# MDF-e - Web Service Distribuição de DF-e de Interesse dos Atores do MDF-e
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n cte_dist_dfe -v v1_0 -u https://dfe-portal.svrs.rs.gov.br/MDFE/DownloadArquivoEstatico/?sistema=MDFE&tipoArquivo=2&nomeArquivo=PL_MDFeDistDFe_100.zip
rm -rf nfelib/mdfe_dist_dfe/schemas
cp -rf /tmp/generated/mdfe_dist_dfe/schemas nfelib/mdfe_dist_dfe/schemas
fi
xsdata generate --include-header nfelib/mdfe_dist_dfe/schemas/v1_0 --package nfelib.mdfe_dist_dfe.bindings.v1_0
# BP-e - Bilhete de Passagem Eletrônico - Schemas NT 2021.001 (26/01/2021)
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n bpe -v v1_0 -u https://dfe-portal.svrs.rs.gov.br/BPE/DownloadArquivoEstatico/?sistema=BPE&tipoArquivo=2&nomeArquivo=PL_BPe_100b_NT012021.zip
# NOTE this one was actually downloaded manually to /tmp/generated/bpe/schemas/v1_0
rm -rf nfelib/bpe/schemas
cp -rf /tmp/generated/bpe/schemas nfelib/bpe/schemas
fi
xsdata generate --include-header nfelib/bpe/schemas/v1_0 --package nfelib.bpe.bindings.v1_0
# NFS-e Pacote de esquemas XSD V1.00.02 - (16/09/2022)
if [$DOWNLOAD_SCHEMAS]; then
erpbrasil-edoc-gen-download-schema -n nfse -v v1_0 -u https://www.gov.br/nfse/pt-br/documentacao-tecnica/xsd_pl_nfse_1-00-producao.zip/@@download/file/XSD_PL_NFSe_1.00-Produ%C3%A7%C3%A3o.zip
rm -rf nfelib/nfse/schemas
cp -rf /tmp/generated/nfse/schemas nfelib/nfse/schemas
xsdata generate --include-header nfelib/nfse/schemas/v1_0 --package nfelib.nfse.bindings.v1_0
fi