From 33848dd34afd0be2eb4ec212f9b3ba3c7422ef90 Mon Sep 17 00:00:00 2001 From: Tiago Amaral Date: Mon, 9 Dec 2024 07:55:00 -0300 Subject: [PATCH] [fix] df ie validation and formatting --- src/erpbrasil/base/fiscal/ie.py | 3 +-- tests/test_fiscal_ie_formata.py | 14 ++++++++------ tests/test_fiscal_ie_validar.py | 2 ++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/erpbrasil/base/fiscal/ie.py b/src/erpbrasil/base/fiscal/ie.py index 6bae2df..08a3ab0 100644 --- a/src/erpbrasil/base/fiscal/ie.py +++ b/src/erpbrasil/base/fiscal/ie.py @@ -27,8 +27,7 @@ "df": { "tam": 13, "val_tam": 11, - "starts_with": "07", - "format": lambda x: "{0}-{1}.{2}/{3}-{4}".format( + "format": lambda x: "{0}.{1}.{2}/{3}-{4}".format( x[:2], x[2:5], x[5:8], x[8:11], x[11:13] ), }, diff --git a/tests/test_fiscal_ie_formata.py b/tests/test_fiscal_ie_formata.py index 1035293..df84d85 100644 --- a/tests/test_fiscal_ie_formata.py +++ b/tests/test_fiscal_ie_formata.py @@ -51,6 +51,7 @@ "0744409300183", "0748774800134", "0747987900103", + "0824761500136", ], "es": [ "082376123", @@ -210,12 +211,13 @@ "06.910859-5", ], "df": [ - "07-327.099/001-74", - "07-305.627/001-76", - "07-515.044/001-68", - "07-444.093/001-83", - "07-487.748/001-34", - "07-479.879/001-03", + "07.327.099/001-74", + "07.305.627/001-76", + "07.515.044/001-68", + "07.444.093/001-83", + "07.487.748/001-34", + "07.479.879/001-03", + "08.247.615/001-36", ], "es": [ "082.376.12-3", diff --git a/tests/test_fiscal_ie_validar.py b/tests/test_fiscal_ie_validar.py index 571c288..8a894a4 100644 --- a/tests/test_fiscal_ie_validar.py +++ b/tests/test_fiscal_ie_validar.py @@ -56,6 +56,7 @@ "0748774800131", "0747987900101", "07479879001010", + "0824761500137", ], "es": [ "082376121", @@ -279,6 +280,7 @@ "0744409300183", "0748774800134", "0747987900103", + "0824761500136", ], "es": [ "082376123",