Skip to content

Commit

Permalink
Merge pull request #45 from akretion/UPD-validar_inscricao_estadual_mg
Browse files Browse the repository at this point in the history
[FIX] Inscrição Estadual de Minas Gerais pode ser menor que 13.
  • Loading branch information
mileo authored Dec 10, 2024
2 parents b8da9ec + 05cde3b commit ef4324e
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 ef4324e

Please # to comment.