From c0f23264d5b993bd467eb7deda11f1e7849cd57e Mon Sep 17 00:00:00 2001 From: "alnus@disroot.org" Date: Sun, 6 Sep 2020 20:49:58 +0000 Subject: [PATCH] FAJ12 fix #19 FossilOrigin-Name: 1c829b83f5ba96a5156d1be233a1c91561f04a6e1cd6ef5237b677163a14f032 --- facho/fe/form.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/facho/fe/form.py b/facho/fe/form.py index 18d8914..5929258 100644 --- a/facho/fe/form.py +++ b/facho/fe/form.py @@ -28,6 +28,10 @@ class Country: code: str name: str +@dataclass +class CountrySubentity: + code: str + name: str @dataclass class Address: @@ -36,7 +40,7 @@ class Address: city: str = '' department: str = '' country: Country = Country('CO', 'Colombia') - + countrysubentity: CountrySubentity = CountrySubentity('05', 'Antioquia') @dataclass class PartyIdentification: @@ -326,6 +330,12 @@ class DIANInvoiceXML(fe.FeXML): #DIAN 1.7.-2020: FAJ09 fexml.set_element('/fe:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PhysicalLocation/cac:Address/cbc:ID', invoice.invoice_supplier.address.city) + #DIAN 1.7.-2020: FAJ11 + fexml.set_element('/fe:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PhysicalLocation/cac:Address/cac:Country/cbc:CountrySubentity', + invoice.invoice_supplier.address.countrysubentity.name) + #DIAN 1.7.-2020: FAJ12 + fexml.set_element('/fe:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PhysicalLocation/cac:Address/cac:Country/cbc:CountrySubentityCode', + invoice.invoice_supplier.address.countrysubentity.code) #DIAN 1.7.-2020: FAJ14 fexml.set_element('/fe:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PhysicalLocation/cac:Address/cac:AddressLine/cbc:Line', invoice.invoice_supplier.address.street)