From 05cde3b532bfe02edf76a6a73ccbad7e2104e048 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 22 Jan 2024 16:02:13 -0300 Subject: [PATCH] =?UTF-8?q?[FIX]=20Inscri=C3=A7=C3=A3o=20Estadual=20de=20M?= =?UTF-8?q?inas=20Gerais=20pode=20ser=20menor=20que=2013.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/erpbrasil/base/fiscal/ie.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/erpbrasil/base/fiscal/ie.py b/src/erpbrasil/base/fiscal/ie.py index 9374ff7..8236aa7 100644 --- a/src/erpbrasil/base/fiscal/ie.py +++ b/src/erpbrasil/base/fiscal/ie.py @@ -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)