From c12d985f76aa19c6db8ecfc2578317857df0f707 Mon Sep 17 00:00:00 2001 From: sinergia Date: Fri, 17 May 2024 14:01:28 -0500 Subject: [PATCH] =?UTF-8?q?Fix:=20Se=20a=C3=B1ade=20condici=C3=B3n=20para?= =?UTF-8?q?=20Period=20in=20invoice.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- facho/fe/form_xml/invoice.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/facho/fe/form_xml/invoice.py b/facho/fe/form_xml/invoice.py index 3e6444f..b8f7270 100644 --- a/facho/fe/form_xml/invoice.py +++ b/facho/fe/form_xml/invoice.py @@ -662,11 +662,14 @@ class DIANInvoiceXML(fe.FeXML): listURI='http://www.dian.gov.co') fexml.set_element('./cbc:DocumentCurrencyCode', 'COP') fexml.set_element('./cbc:LineCountNumeric', len(invoice.invoice_lines)) - fexml.set_element('./cac:%sPeriod/cbc:StartDate' % (fexml.tag_document()), - invoice.invoice_period_start.strftime('%Y-%m-%d')) + if fexml.tag_document() == 'Invoice': + fexml.set_element('./cac:%sPeriod/cbc:StartDate' % ( + fexml.tag_document()), + invoice.invoice_period_start.strftime('%Y-%m-%d')) - fexml.set_element('./cac:%sPeriod/cbc:EndDate' % (fexml.tag_document()), - invoice.invoice_period_end.strftime('%Y-%m-%d')) + fexml.set_element('./cac:%sPeriod/cbc:EndDate' % ( + fexml.tag_document()), + invoice.invoice_period_end.strftime('%Y-%m-%d')) fexml.set_billing_reference(invoice) fexml.customize(invoice) fexml.set_supplier(invoice)