correcion en valor de schemeAgencyName
facho/fe/form.py (PartyIdentification): nueva clase; FossilOrigin-Name: b2fb9d8073fd32d553bbd914a0c5c47d84ecdc566e2ed235e338a383023781df
This commit is contained in:
		| @@ -13,7 +13,7 @@ from contextlib import contextmanager | ||||
| from .data.dian import codelist | ||||
|  | ||||
| SCHEME_AGENCY_ATTRS = { | ||||
|     'schemeAgencyName': 'CO, DIAN (Direccion de Impuestos y Aduanas Nacionales)', | ||||
|     'schemeAgencyName': 'CO, DIAN (Dirección de Impuestos y Aduanas Nacionales)', | ||||
|     'schemeAgencyID': '195' | ||||
| } | ||||
|  | ||||
| @@ -248,7 +248,7 @@ class DianXMLExtensionAuthorizationProvider(FachoXMLExtension): | ||||
|     # RESOLUCION 0004: pagina 176 | ||||
|  | ||||
|     def build(self, fexml): | ||||
|         dian_path = '/fe:Invoice/ext:UBLExtensions/ext:ExtensionContent/sts:DianExtensions/sts:AuthorizationProvider/sts:AuthorizationProviderID' | ||||
|         dian_path = '/fe:Invoice/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/sts:DianExtensions/sts:AuthorizationProvider/sts:AuthorizationProviderID' | ||||
|         fexml.set_element(dian_path, '800197268') | ||||
|          | ||||
|         attrs = {'schemeID': '4', 'schemeName': '31'} | ||||
|   | ||||
| @@ -36,7 +36,21 @@ class Address: | ||||
|     department: str = '' | ||||
|     country: Country = Country('CO', 'COLOMBIA') | ||||
|  | ||||
|      | ||||
|  | ||||
| @dataclass | ||||
| class PartyIdentification: | ||||
|     number: str | ||||
|     dv: str | ||||
|  | ||||
|     def __str__(self): | ||||
|         return self.number | ||||
|  | ||||
|     def __eq__(self, other): | ||||
|         return str(self) == str(other) | ||||
|  | ||||
|     def full(self): | ||||
|         return "%s%s" % [self.number, self.dv] | ||||
|          | ||||
| @dataclass | ||||
| class Party: | ||||
|     name: str | ||||
| @@ -279,7 +293,15 @@ class DIANInvoiceXML(fe.FeXML): | ||||
|                           invoice.invoice_supplier.name) | ||||
|         fexml.set_element('/fe:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PhysicalLocation/cac:Address/cac:AddressLine/cbc:Line', | ||||
|                           invoice.invoice_supplier.address.street) | ||||
|          | ||||
|  | ||||
|  | ||||
|         supplier_company_id_attrs = fe.SCHEME_AGENCY_ATTRS.copy() | ||||
|         supplier_company_id_attrs.update({'schemeID': invoice.invoice_supplier.ident.dv, | ||||
|                                           'schemeName': '31'}) | ||||
|         fexml.set_element('/fe:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID', | ||||
|                           invoice.invoice_supplier.ident, | ||||
|                           **supplier_company_id_attrs) | ||||
|  | ||||
|         fexml.set_element('/fe:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID', | ||||
|                           invoice.invoice_supplier.ident, | ||||
|                           **fe.SCHEME_AGENCY_ATTRS) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user