examples/generate-invoice-invoice.py: se actualiza fix #45
FossilOrigin-Name: f31372da32308fd90fee477c7afd6f2d925d23761c5e7cb6223c3c00ed6bc645
This commit is contained in:
parent
74ed9a22ac
commit
f0533dee5e
@ -3,38 +3,70 @@ from facho.fe import fe
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
def extensions(inv):
|
def extensions(inv):
|
||||||
security_code = fe.DianXMLExtensionSoftwareSecurityCode('', '123', inv.invoice_ident)
|
nit = form.PartyIdentification('nit', '5', '31')
|
||||||
cufe = fe.DianXMLExtensionCUFE(inv)
|
security_code = fe.DianXMLExtensionSoftwareSecurityCode('id software', 'pin', inv.invoice_ident)
|
||||||
return [security_code, cufe]
|
authorization_provider = fe.DianXMLExtensionAuthorizationProvider()
|
||||||
|
cufe = fe.DianXMLExtensionCUFE(inv, fe.DianXMLExtensionCUFE.AMBIENTE_PRUEBAS,
|
||||||
|
'clave tecnica')
|
||||||
|
software_provider = fe.DianXMLExtensionSoftwareProvider(nit, nit.dv, 'id software')
|
||||||
|
inv_authorization = fe.DianXMLExtensionInvoiceAuthorization('invoice autorization',
|
||||||
|
datetime(2019, 1, 19),
|
||||||
|
datetime(2030, 1, 19),
|
||||||
|
'SETP', 990000001, 995000000)
|
||||||
|
return [security_code, authorization_provider, cufe, software_provider, inv_authorization]
|
||||||
|
|
||||||
|
|
||||||
def invoice():
|
def invoice():
|
||||||
inv = form.Invoice()
|
inv = form.Invoice()
|
||||||
inv.set_period(datetime.now(), datetime.now())
|
inv.set_period(datetime.now(), datetime.now())
|
||||||
inv.set_issue(datetime.now())
|
inv.set_issue(datetime.now())
|
||||||
inv.set_ident('ABC123')
|
inv.set_ident('SETP990003033')
|
||||||
|
inv.set_operation_type('10')
|
||||||
inv.set_supplier(form.Party(
|
inv.set_supplier(form.Party(
|
||||||
name = 'facho-supplier',
|
legal_name = 'FACHO SOS',
|
||||||
ident = 123,
|
name = 'FACHO SOS',
|
||||||
responsability_code = 'No aplica',
|
ident = form.PartyIdentification('900579212', '5', '31'),
|
||||||
organization_code = 'Persona Natural'
|
responsability_code = form.Responsability(['O-07', 'O-09', 'O-14', 'O-48']),
|
||||||
|
responsability_regime_code = '48',
|
||||||
|
organization_code = '1',
|
||||||
|
email = "sdds@sd.com",
|
||||||
|
address = form.Address(
|
||||||
|
'', '', form.City('05001', 'Medellín'),
|
||||||
|
form.Country('CO', 'Colombia'),
|
||||||
|
form.CountrySubentity('05', 'Antioquia'))
|
||||||
))
|
))
|
||||||
inv.set_customer(form.Party(
|
inv.set_customer(form.Party(
|
||||||
|
legal_name = 'facho-customer',
|
||||||
name = 'facho-customer',
|
name = 'facho-customer',
|
||||||
ident = 321,
|
ident = form.PartyIdentification('999999999', '', '13'),
|
||||||
responsability_code = 'No aplica',
|
responsability_code = form.Responsability(['R-99-PN']),
|
||||||
organization_code = 'Persona Natural'
|
responsability_regime_code = '49',
|
||||||
|
organization_code = '2',
|
||||||
|
email = "sdds@sd.com",
|
||||||
|
address = form.Address(
|
||||||
|
'', '', form.City('05001', 'Medellín'),
|
||||||
|
form.Country('CO', 'Colombia'),
|
||||||
|
form.CountrySubentity('05', 'Antioquia'))
|
||||||
|
))
|
||||||
|
inv.set_payment_mean(form.PaymentMean(
|
||||||
|
id = '1',
|
||||||
|
code = '10',
|
||||||
|
due_at = datetime.now(),
|
||||||
|
payment_id = '1'
|
||||||
))
|
))
|
||||||
inv.add_invoice_line(form.InvoiceLine(
|
inv.add_invoice_line(form.InvoiceLine(
|
||||||
quantity = 1,
|
quantity = 1,
|
||||||
description = 'producto facho',
|
description = 'producto facho',
|
||||||
item_ident = 9999,
|
item = form.StandardItem('test', 9999),
|
||||||
price_amount = 100.0,
|
price = form.Price(
|
||||||
|
amount = form.Amount(100.00),
|
||||||
|
type_code = '01',
|
||||||
|
type = 'x'
|
||||||
|
),
|
||||||
tax = form.TaxTotal(
|
tax = form.TaxTotal(
|
||||||
tax_amount = 0.0,
|
|
||||||
taxable_amount = 0.0,
|
|
||||||
subtotals = [
|
subtotals = [
|
||||||
form.TaxSubTotal(
|
form.TaxSubTotal(
|
||||||
percent = 19.0,
|
percent = 19.00,
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user