From 197f73491a57bb7aaeee183c88bdf691ddd62025 Mon Sep 17 00:00:00 2001 From: "bit4bit@riseup.net" Date: Sun, 6 Sep 2020 01:27:22 +0000 Subject: [PATCH] FAK25 FossilOrigin-Name: 709fb7a90b64e7e984b3071b5fe1645dbf24868d846ea176ec91e396e9a08452 --- facho/fe/form.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/facho/fe/form.py b/facho/fe/form.py index 4b90284..e4d8e77 100644 --- a/facho/fe/form.py +++ b/facho/fe/form.py @@ -41,6 +41,7 @@ class Address: class PartyIdentification: number: str dv: str + type_fiscal: str def __str__(self): return self.number @@ -322,7 +323,7 @@ class DIANInvoiceXML(fe.FeXML): supplier_company_id_attrs = fe.SCHEME_AGENCY_ATTRS.copy() supplier_company_id_attrs.update({'schemeID': invoice.invoice_supplier.ident.dv, - 'schemeName': '31'}) + 'schemeName': invoice.invoice_supplier.ident.type_fiscal}) fexml.set_element('/fe:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID', invoice.invoice_supplier.ident, **supplier_company_id_attrs) @@ -358,9 +359,13 @@ class DIANInvoiceXML(fe.FeXML): invoice.invoice_customer.name) fexml.set_element('/fe:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PhysicalLocation/cac:Address/cac:AddressLine/cbc:Line', invoice.invoice_customer.address.street) + customer_company_id_attrs = fe.SCHEME_AGENCY_ATTRS.copy() + #DIAN 1.7.-2020: FAK25 + customer_company_id_attrs.update({'schemeID': invoice.invoice_customer.ident.dv, + 'schemeName': invoice.invoice_customer.ident.type_fiscal}) fexml.set_element('/fe:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID', invoice.invoice_customer.ident, - **fe.SCHEME_AGENCY_ATTRS) + **customer_company_id_attrs) fexml.set_element('/fe:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:RegistrationName', invoice.invoice_customer.legal_name) fexml.set_element('/fe:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:TaxLevelCode',