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
 | 
					from .data.dian import codelist
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SCHEME_AGENCY_ATTRS = {
 | 
					SCHEME_AGENCY_ATTRS = {
 | 
				
			||||||
    'schemeAgencyName': 'CO, DIAN (Direccion de Impuestos y Aduanas Nacionales)',
 | 
					    'schemeAgencyName': 'CO, DIAN (Dirección de Impuestos y Aduanas Nacionales)',
 | 
				
			||||||
    'schemeAgencyID': '195'
 | 
					    'schemeAgencyID': '195'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -248,7 +248,7 @@ class DianXMLExtensionAuthorizationProvider(FachoXMLExtension):
 | 
				
			|||||||
    # RESOLUCION 0004: pagina 176
 | 
					    # RESOLUCION 0004: pagina 176
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def build(self, fexml):
 | 
					    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')
 | 
					        fexml.set_element(dian_path, '800197268')
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        attrs = {'schemeID': '4', 'schemeName': '31'}
 | 
					        attrs = {'schemeID': '4', 'schemeName': '31'}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,6 +37,20 @@ class Address:
 | 
				
			|||||||
    country: Country = Country('CO', 'COLOMBIA')
 | 
					    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
 | 
					@dataclass
 | 
				
			||||||
class Party:
 | 
					class Party:
 | 
				
			||||||
    name: str
 | 
					    name: str
 | 
				
			||||||
@@ -280,6 +294,14 @@ class DIANInvoiceXML(fe.FeXML):
 | 
				
			|||||||
        fexml.set_element('/fe:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PhysicalLocation/cac:Address/cac:AddressLine/cbc:Line',
 | 
					        fexml.set_element('/fe:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PhysicalLocation/cac:Address/cac:AddressLine/cbc:Line',
 | 
				
			||||||
                          invoice.invoice_supplier.address.street)
 | 
					                          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',
 | 
					        fexml.set_element('/fe:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID',
 | 
				
			||||||
                          invoice.invoice_supplier.ident,
 | 
					                          invoice.invoice_supplier.ident,
 | 
				
			||||||
                          **fe.SCHEME_AGENCY_ATTRS)
 | 
					                          **fe.SCHEME_AGENCY_ATTRS)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user