Skip to content

Commit

Permalink
[FIX] Inscrição Estadual de Minas Gerais pode ser menor que 13.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbcosta committed Jan 26, 2024
1 parent 29c9178 commit 05cde3b
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit 05cde3b

Please sign in to comment.