se actualizan pruebas en base a ultimos cambios.
FossilOrigin-Name: 67daaf819131b0ea6408852d285c1874c818e178ca3f9a352a588c7a5d1a372f
This commit is contained in:
parent
11a781875d
commit
bd7e7a4918
@ -125,14 +125,15 @@ class DianXMLExtensionCUFE(FachoXMLExtension):
|
||||
class DianXMLExtensionSoftwareProvider(FachoXMLExtension):
|
||||
# RESOLUCION 0004: pagina 108
|
||||
|
||||
def __init__(self, nit, id_software: str):
|
||||
def __init__(self, nit, dv, id_software: str):
|
||||
self.nit = nit
|
||||
self.dv = dv
|
||||
self.id_software = id_software
|
||||
|
||||
def build(self, fexml):
|
||||
software_provider = fexml.fragment('/fe:Invoice/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/sts:DianExtensions/sts:SoftwareProvider')
|
||||
provider_id_attrs = SCHEME_AGENCY_ATTRS.copy()
|
||||
provider_id_attrs.update({'schemeID': self.nit.dv})
|
||||
provider_id_attrs.update({'schemeID': self.dv})
|
||||
software_provider.set_element('/sts:SoftwareProvider/sts:ProviderID', self.nit,
|
||||
**provider_id_attrs)
|
||||
software_provider.set_element('/sts:SoftwareProvider/sts:SoftwareID', self.id_software,
|
||||
|
@ -70,7 +70,7 @@ def test_dian_extension_invoice_authorization():
|
||||
def test_dian_extension_software_provider():
|
||||
nit = '123456789'
|
||||
id_software = 'ABCDASDF123'
|
||||
software_provider_extension = fe.DianXMLExtensionSoftwareProvider(nit, id_software)
|
||||
software_provider_extension = fe.DianXMLExtensionSoftwareProvider(nit, '', id_software)
|
||||
|
||||
xml = fe.FeXML('Invoice',
|
||||
'http://www.dian.gov.co/contratos/facturaelectronica/v1')
|
||||
@ -84,7 +84,7 @@ def test_dian_extension_authorization_provider():
|
||||
xml = fe.FeXML('Invoice',
|
||||
'http://www.dian.gov.co/contratos/facturaelectronica/v1')
|
||||
xml.add_extension(auth_provider_extension)
|
||||
dian_nit = xml.get_element_text('/fe:Invoice/ext:UBLExtensions/ext:ExtensionContent/sts:DianExtensions/sts:AuthorizationProvider/sts:AuthorizationProviderID')
|
||||
dian_nit = xml.get_element_text('/fe:Invoice/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/sts:DianExtensions/sts:AuthorizationProvider/sts:AuthorizationProviderID')
|
||||
assert dian_nit == '800197268'
|
||||
|
||||
|
||||
|
@ -23,15 +23,17 @@ def simple_invoice_without_lines():
|
||||
inv.set_payment_mean(form.PaymentMean(form.PaymentMean.DEBIT, '41', datetime.now(), '1234'))
|
||||
inv.set_supplier(form.Party(
|
||||
name = 'facho-supplier',
|
||||
ident = 123,
|
||||
responsability_code = 'ZZ',
|
||||
ident = form.PartyIdentification('123',''),
|
||||
responsability_code = form.Responsability(['ZZ']),
|
||||
responsability_regime_code = '48',
|
||||
organization_code = '1',
|
||||
address = form.Address(name='Test Building')
|
||||
))
|
||||
inv.set_customer(form.Party(
|
||||
name = 'facho-customer',
|
||||
ident = 321,
|
||||
responsability_code = 'ZZ',
|
||||
ident = form.PartyIdentification('321', ''),
|
||||
responsability_code = form.Responsability(['ZZ']),
|
||||
responsability_regime_code = '48',
|
||||
organization_code = '1',
|
||||
address = form.Address(name='Test Building')
|
||||
))
|
||||
@ -46,14 +48,16 @@ def simple_invoice():
|
||||
inv.set_payment_mean(form.PaymentMean(form.PaymentMean.DEBIT, '41', datetime.now(), ' 1234'))
|
||||
inv.set_supplier(form.Party(
|
||||
name = 'facho-supplier',
|
||||
ident = 123,
|
||||
responsability_code = 'ZZ',
|
||||
ident = form.PartyIdentification('123',''),
|
||||
responsability_code = form.Responsability(['ZZ']),
|
||||
responsability_regime_code = '48',
|
||||
organization_code = '1'
|
||||
))
|
||||
inv.set_customer(form.Party(
|
||||
name = 'facho-customer',
|
||||
ident = 321,
|
||||
responsability_code = 'ZZ',
|
||||
ident = form.PartyIdentification('321',''),
|
||||
responsability_code = form.Responsability(['ZZ']),
|
||||
responsability_regime_code = '48',
|
||||
organization_code = '1'
|
||||
))
|
||||
inv.add_invoice_line(form.InvoiceLine(
|
||||
@ -173,8 +177,8 @@ def test_invoice_cufe(simple_invoice_without_lines):
|
||||
simple_invoice = simple_invoice_without_lines
|
||||
simple_invoice.invoice_ident = '323200000129'
|
||||
simple_invoice.invoice_issue = datetime.strptime('2019-01-16 10:53:10-05:00', '%Y-%m-%d %H:%M:%S%z')
|
||||
simple_invoice.invoice_supplier.ident = '700085371'
|
||||
simple_invoice.invoice_customer.ident = '800199436'
|
||||
simple_invoice.invoice_supplier.ident = form.PartyIdentification('700085371', '')
|
||||
simple_invoice.invoice_customer.ident = form.PartyIdentification('800199436', '')
|
||||
simple_invoice.add_invoice_line(form.InvoiceLine(
|
||||
quantity = 1,
|
||||
description = 'producto',
|
||||
|
Loading…
Reference in New Issue
Block a user