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

[FIX] Inscrição Estadual de Minas Gerais pode ser menor que 13. #45

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/erpbrasil/base/fiscal/ie.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,15 @@ def validar_mg(inscr_est):
inscr_est = re.sub("[^0-9]", "", inscr_est)

# verificando o tamanho da inscrição estadual
if len(inscr_est) != 13:
if len(inscr_est) not in [13, 11]:
return False

# Pega apenas os 11 primeiros dígitos da inscrição estadual e
# gera os dígitos verificadores
inscr_est = list(map(int, inscr_est))
nova_ie = inscr_est[:11]
if len(inscr_est) == 11:
nova_ie = inscr_est

nova_ie_aux = list(nova_ie)
nova_ie_aux.insert(3, 0)
Expand Down
Loading