Browse Source
Setar timezone conforme data de emissao e adicionado campo dhSaiEnt
pull/109/head
leogregianin
5 years ago
No known key found for this signature in database
GPG Key ID: BBCE23B6DC23016D
1 changed files with
5 additions and
1 deletions
-
pynfe/processamento/serializacao.py
|
|
|
@ -532,7 +532,9 @@ class SerializacaoXML(Serializacao): |
|
|
|
# Ex.: NFe35080599999090910270550010000000011518005123 |
|
|
|
raiz.attrib['Id'] = nota_fiscal.identificador_unico |
|
|
|
|
|
|
|
tz = datetime.now().astimezone().strftime('%z') |
|
|
|
tz = nota_fiscal.data_emissao.strftime('%z') |
|
|
|
if not tz: |
|
|
|
tz = datetime.now().astimezone().strftime('%z') |
|
|
|
tz = "{}:{}".format(tz[:-2], tz[-2:]) |
|
|
|
|
|
|
|
# Dados da Nota Fiscal |
|
|
|
@ -544,6 +546,8 @@ class SerializacaoXML(Serializacao): |
|
|
|
etree.SubElement(ide, 'serie').text = nota_fiscal.serie |
|
|
|
etree.SubElement(ide, 'nNF').text = str(nota_fiscal.numero_nf) |
|
|
|
etree.SubElement(ide, 'dhEmi').text = nota_fiscal.data_emissao.strftime('%Y-%m-%dT%H:%M:%S') + tz |
|
|
|
if nota_fiscal.data_saida_entrada: |
|
|
|
etree.SubElement(ide, 'dhSaiEnt').text = nota_fiscal.data_saida_entrada.strftime('%Y-%m-%dT%H:%M:%S') + tz |
|
|
|
"""dhCont Data e Hora da entrada em contingência E B01 D 0-1 Formato AAAA-MM-DDThh:mm:ssTZD (UTC - Universal |
|
|
|
Coordinated Time) |
|
|
|
Exemplo: no formato UTC para os campos de Data-Hora, "TZD" pode ser -02:00 (Fernando de Noronha), -03:00 (Brasília) ou -04:00 (Manaus), no |
|
|
|
|