Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correções e melhorias diversas #315

Closed
wants to merge 7 commits into from

Conversation

betogd
Copy link

@betogd betogd commented Dec 18, 2023

FIX: Corrigido problema de exception com mensagem vazia quando o campo cliente.inscricao_estadualesta nulo e o indidacador_ie != 2 ou not client.isento_icms, tornando dificil a identificação doi problema.

FIX: NFC-e deve permitir informar apenas o CPF e o Nome, no entanto não estava sendo gerado o nome do destinatario caso informado.

FIX: removido validação incorreta onde não permitia PIS/COFINS para NFC-e

ADDED: adicionado tag EXTIPI na serialização do XML

REFACTORY: removido prop pis_situacao_tributaria não utilizada no objeto NotaFiscalProduto e adicionado pis_modalidade que é utilizado pela serialização, esta incongruencia gerava confusão na hora de informar os dados do pis.

Roberto Godinho added 6 commits December 18, 2023 09:00
FIX: Corrigido problema de exception com mensagem vazia quando o campo `cliente.inscricao_estadual`esta nulo e o `indidacador_ie` != 2 ou `not client.isento_icms`, tornando dificil a identificação doi problema.
FIX: NFC-e deve permitir informar apenas o CPF e o Nome, no entanto não estava sendo gerado o nome do destinatario caso informado.
FIX: removido validação incorreta onde não permitia PIS/COFINS para NFC-e
ADDED: adicionado tag EXTIPI na serialização do XML
REFACTORY: removido prop `pis_situacao_tributaria` não utilizada no objeto `NotaFiscalProduto` e adicionado `pis_modalidade` que é utilizado pela serialização, esta incongruencia gerava confusão na hora de informar os dados do pis.
REFACTORY: resolvido `TODO calcular impostos aproximados`, o sistema passará a totalizar os totais dos tributos informados para o produto.

REFACTORY: alterado `totais_tributos_aproximado`para readonly, este valor não deve ser informado para não acumular duas vezes os tributos.

TEST: Removido `totais_tributos_aproximado` para ficar de acordo com as alterações da NotaFiscal.
@betogd betogd changed the title FIX: vTotTrib não esta sendo formatado corretamente. correções e melhorias diversas Dec 19, 2023
@@ -158,8 +158,7 @@ def _serializar_cliente(
cliente.numero_documento
)
if not self._so_cpf:
if cliente.razao_social:
etree.SubElement(raiz, "xNome").text = cliente.razao_social
etree.SubElement(raiz, "xNome").text = cliente.razao_social
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isso aqui está errado, deve permitir preencher somente cpf sem nome.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ˆ Concordo.

@@ -401,8 +405,8 @@ def _serializar_produto_servico(
# Lei da transparencia
# Tributos aprox por item
if produto_servico.valor_tributos_aprox:
etree.SubElement(imposto, "vTotTrib").text = str(
produto_servico.valor_tributos_aprox
etree.SubElement(imposto, "vTotTrib").text = "{:.2f}".format(
Copy link
Member

@juniortada juniortada Jan 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valor total de tributos deve ser informado pelo emissor.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ˆ Mas está certo, a unica coisa que ele fez foi colocar a formatação padrão utilizada em outros valores decimais.

@juniortada
Copy link
Member

Existe PIS e COFINS para NFC-e?

Copy link
Collaborator

@felps-dev felps-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Muito boas alterações! Somente alguns comentários importantes.

Comment on lines +257 to +260
__totais_tributos_aproximado = Decimal()
@property
def totais_tributos_aproximado(self):
return self.__totais_tributos_aproximado
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Não entendi, por que foi feito isso?

Comment on lines -445 to -446
# TODO calcular impostos aproximados
# self.totais_tributos_aproximado += obj.tributos
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Não é a mesma coisa que antes?

@@ -813,7 +815,7 @@ class NotaFiscalProduto(Entidade):
# - PIS
# - PIS
# - Situacao tributaria (obrigatorio - seleciona de lista) - PIS_TIPOS_TRIBUTACAO
pis_situacao_tributaria = str()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Muito bem observado, isso aqui estava com o nome errado kkkk

@@ -158,8 +158,7 @@ def _serializar_cliente(
cliente.numero_documento
)
if not self._so_cpf:
if cliente.razao_social:
etree.SubElement(raiz, "xNome").text = cliente.razao_social
etree.SubElement(raiz, "xNome").text = cliente.razao_social
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ˆ Concordo.

@@ -190,7 +192,7 @@ def _serializar_cliente(
etree.SubElement(raiz, "indIEDest").text = "9"
elif (
cliente.indicador_ie == 2 or cliente.isento_icms
) or cliente.inscricao_estadual.upper() == "ISENTO":
) or (cliente.inscricao_estadual or '').upper() == "ISENTO":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acho que o certo é colocar um Throw se tentar colocar o inscricao_estadual como None OU no init da classe preencher ele como "" caso for None.

@@ -401,8 +405,8 @@ def _serializar_produto_servico(
# Lei da transparencia
# Tributos aprox por item
if produto_servico.valor_tributos_aprox:
etree.SubElement(imposto, "vTotTrib").text = str(
produto_servico.valor_tributos_aprox
etree.SubElement(imposto, "vTotTrib").text = "{:.2f}".format(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ˆ Mas está certo, a unica coisa que ele fez foi colocar a formatação padrão utilizada em outros valores decimais.

@felps-dev
Copy link
Collaborator

Existe PIS e COFINS para NFC-e?

Sim, são opcionais mas existem.

@juniortada
Copy link
Member

As alterações solicitadas não foram respondidas. Estou fechando este PR por enquanto.

@juniortada juniortada closed this Apr 27, 2024
@betogd
Copy link
Author

betogd commented Jun 13, 2024

Existe PIS e COFINS para NFC-e?

existe a criterio da UF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants