examples/generate-invoice-invoice.py: nuevo archivo como ejemplo de script para comand generate-invoice
FossilOrigin-Name: f5f3ad522edec539de977de8b0479320c19e1e9e4af70b7839ee357ddb183597
This commit is contained in:
parent
95b79407a8
commit
14c36fc17c
41
examples/generate-invoice-invoice.py
Normal file
41
examples/generate-invoice-invoice.py
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import facho.fe.form as form
|
||||||
|
from facho.fe import fe
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
def extensions(inv):
|
||||||
|
security_code = fe.DianXMLExtensionSoftwareSecurityCode('', '123', inv.invoice_ident)
|
||||||
|
return [security_code]
|
||||||
|
|
||||||
|
def invoice():
|
||||||
|
inv = form.Invoice()
|
||||||
|
inv.set_period(datetime.now(), datetime.now())
|
||||||
|
inv.set_issue(datetime.now())
|
||||||
|
inv.set_ident('ABC123')
|
||||||
|
inv.set_supplier(form.Party(
|
||||||
|
name = 'facho-supplier',
|
||||||
|
ident = 123,
|
||||||
|
responsability_code = 'No aplica',
|
||||||
|
organization_code = 'Persona Natural'
|
||||||
|
))
|
||||||
|
inv.set_customer(form.Party(
|
||||||
|
name = 'facho-customer',
|
||||||
|
ident = 321,
|
||||||
|
responsability_code = 'No aplica',
|
||||||
|
organization_code = 'Persona Natural'
|
||||||
|
))
|
||||||
|
inv.add_invoice_line(form.InvoiceLine(
|
||||||
|
quantity = 1,
|
||||||
|
description = 'producto facho',
|
||||||
|
item_ident = 9999,
|
||||||
|
price_amount = 100.0,
|
||||||
|
tax = form.TaxTotal(
|
||||||
|
tax_amount = 0.0,
|
||||||
|
taxable_amount = 0.0,
|
||||||
|
subtotals = [
|
||||||
|
form.TaxSubTotal(
|
||||||
|
percent = 19.0,
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
))
|
||||||
|
return inv
|
Loading…
Reference in New Issue
Block a user