facho/fe/form.py: se adicionan mas elementos xml
FossilOrigin-Name: 6a923fcac4b5182f5e4954d35812c1efdedbc6f461a3376781293d2aa69cf030
This commit is contained in:
parent
1df99f4c9d
commit
b6d21aab96
@ -10,6 +10,19 @@ from datetime import datetime
|
|||||||
from .data.dian import codelist
|
from .data.dian import codelist
|
||||||
from . import fe
|
from . import fe
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Country:
|
||||||
|
code: str
|
||||||
|
name: str
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Address:
|
||||||
|
name: str
|
||||||
|
street: str = ''
|
||||||
|
city: str = ''
|
||||||
|
department: str = ''
|
||||||
|
country: Country = Country('CO', 'COLOMBIA')
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Party:
|
class Party:
|
||||||
name: str
|
name: str
|
||||||
@ -18,7 +31,7 @@ class Party:
|
|||||||
organization_code: str
|
organization_code: str
|
||||||
|
|
||||||
phone: str = ''
|
phone: str = ''
|
||||||
address: str = ''
|
address: Address= Address('')
|
||||||
email: str = ''
|
email: str = ''
|
||||||
legal_name: str = ''
|
legal_name: str = ''
|
||||||
legal_company_ident: str = ''
|
legal_company_ident: str = ''
|
||||||
@ -210,8 +223,13 @@ class DIANInvoiceXML(fe.FeXML):
|
|||||||
invoice.invoice_supplier.name)
|
invoice.invoice_supplier.name)
|
||||||
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationName',
|
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationName',
|
||||||
invoice.invoice_supplier.legal_name)
|
invoice.invoice_supplier.legal_name)
|
||||||
|
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationAddress/cbc:CityName', invoice.invoice_supplier.address.city)
|
||||||
|
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationAddress/cac:AddressLine/cbc:Line', invoice.invoice_supplier.address.street)
|
||||||
|
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationAddress/cac:Country/cbc:IdentificationCode', invoice.invoice_supplier.address.country.code)
|
||||||
|
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationAddress/cac:Country/cbc:name', invoice.invoice_supplier.address.country.name)
|
||||||
|
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationAddress/cac:Country/cac:AddressLine/cbc:Line', invoice.invoice_supplier.address.street)
|
||||||
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/fe:Party/fe:PhysicalLocation/fe:Address/cac:AddressLine/cbc:Line',
|
fexml.set_element('/fe:Invoice/fe:AccountingSupplierParty/fe:Party/fe:PhysicalLocation/fe:Address/cac:AddressLine/cbc:Line',
|
||||||
invoice.invoice_supplier.address)
|
invoice.invoice_supplier.address.street)
|
||||||
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/cac:PartyIdentification/cbc:ID',
|
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/cac:PartyIdentification/cbc:ID',
|
||||||
invoice.invoice_customer.ident)
|
invoice.invoice_customer.ident)
|
||||||
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/fe:PartyTaxScheme/cbc:TaxLevelCode',
|
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/fe:PartyTaxScheme/cbc:TaxLevelCode',
|
||||||
@ -224,8 +242,13 @@ class DIANInvoiceXML(fe.FeXML):
|
|||||||
invoice.invoice_customer.ident)
|
invoice.invoice_customer.ident)
|
||||||
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationName',
|
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationName',
|
||||||
invoice.invoice_customer.legal_name)
|
invoice.invoice_customer.legal_name)
|
||||||
|
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationAddress/cbc:CityName', invoice.invoice_customer.address.city)
|
||||||
|
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationAddress/cac:Country/cbc:IdentificationCode', invoice.invoice_customer.address.country.code)
|
||||||
|
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationAddress/cac:Country/cbc:Name', invoice.invoice_customer.address.country.name)
|
||||||
|
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationAddress/cac:AddressLine/cbc:Line', invoice.invoice_customer.address.street)
|
||||||
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/fe:PhysicalLocation/fe:Address/cac:AddressLine/cbc:Line',
|
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/fe:PhysicalLocation/fe:Address/cac:AddressLine/cbc:Line',
|
||||||
invoice.invoice_customer.address)
|
invoice.invoice_customer.address.street)
|
||||||
|
fexml.set_element('/fe:Invoice/fe:AccountingCustomerParty/fe:Party/fe:PartyLegalEntity/cbc:RegistrationAddress/cac:Country/cac:AddressLine/cbc:Line', invoice.invoice_customer.address.street)
|
||||||
|
|
||||||
fexml.set_element('/fe:Invoice/fe:LegalMonetaryTotal/cbc:LineExtensionAmount',
|
fexml.set_element('/fe:Invoice/fe:LegalMonetaryTotal/cbc:LineExtensionAmount',
|
||||||
invoice.invoice_legal_monetary_total.line_extension_amount,
|
invoice.invoice_legal_monetary_total.line_extension_amount,
|
||||||
|
@ -24,13 +24,15 @@ def simple_invoice_without_lines():
|
|||||||
name = 'facho-supplier',
|
name = 'facho-supplier',
|
||||||
ident = 123,
|
ident = 123,
|
||||||
responsability_code = 'No aplica',
|
responsability_code = 'No aplica',
|
||||||
organization_code = 'Persona Natural'
|
organization_code = 'Persona Natural',
|
||||||
|
address = form.Address(name='Test Building')
|
||||||
))
|
))
|
||||||
inv.set_customer(form.Party(
|
inv.set_customer(form.Party(
|
||||||
name = 'facho-customer',
|
name = 'facho-customer',
|
||||||
ident = 321,
|
ident = 321,
|
||||||
responsability_code = 'No aplica',
|
responsability_code = 'No aplica',
|
||||||
organization_code = 'Persona Natural'
|
organization_code = 'Persona Natural',
|
||||||
|
address = form.Address(name='Test Building')
|
||||||
))
|
))
|
||||||
return inv
|
return inv
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user