invoice: update usages in docs

This commit is contained in:
Richard Kubíček
2025-03-03 20:44:33 +01:00
parent a49aba6d46
commit 89536bcb83

View File

@@ -16,38 +16,35 @@ Functions:
- (none) - (none)
Usage: Usage:
import superfaktura.invoice >>> import superfaktura.invoice
>>> # Create an instance of Invoice
# Create an instance of Invoice >>> invoice = superfaktura.invoice.Invoice()
invoice = superfaktura.invoice.Invoice() >>> # Create an invoice
>>> invoice.add(
# Create an invoice invoice_model=InvoiceModel(
invoice.add( type=InvoiceType.INVOICE,
invoice=superfaktura.invoice.InvoiceModel( name="My First Invoice",
type=superfaktura.invoice.InvoiceType.PROFORMA, due=Date("2025-04-01"),
name="Invoice 3", invoice_currency=Currencies.EUR,
due=superfaktura.invoice.Date("2025-02-01"),
invoice_currency=superfaktura.invoice.Currencies.CZK,
header_comment="We invoice you for services", header_comment="We invoice you for services",
bank_accounts=[bank.default().as_dict()], bank_accounts=[bank.default().as_dict()],
), ),
items=[ items=[
superfaktura.invoice.InvoiceItem(name="Services", unit_price=100, quantity=1, InvoiceItem(
unit="ks", tax=21), name="Website Development", unit_price=1000.0, quantity=1, tax=20
superfaktura.invoice.InvoiceItem(name="SIM card", unit_price=50, quantity=1, ),
tax=21, unit="ks"), InvoiceItem(
superfaktura.invoice.InvoiceItem( name="Hosting Service (1 year)", unit_price=500.0, quantity=1, tax=20
name="SIM card 2", unit_price=75, quantity=1, tax=21, unit="ks"
), ),
], ],
contact=superfaktura.client_contacts.ClientContactModel( contact=ClientContactModel(
name="Richard Kubíček", name="John Doe",
email="kubicekr@eledio.com", email="john.doe@examle.com",
phone="+420 123 456 789", phone="+1 555-1234",
address="Jaroslava Foglara 861/1", address="123 Main Street, New York",
ico="123", ico="987654321",
update=True, update=True,
country_id=57, country_id=225,
), ),
) )
""" """
@@ -217,31 +214,32 @@ class Invoice(SuperFakturaAPI):
- update: Updates an existing invoice. - update: Updates an existing invoice.
Usage: Usage:
invoice = Invoice() >>> invoice = Invoice()
invoice.add( >>> invoice.add(
invoice=InvoiceModel( invoice_model=InvoiceModel(
type=InvoiceType.PROFORMA, type=InvoiceType.INVOICE,
name="Invoice 3", name="My First Invoice",
due=Date("2025-02-01"), due=Date("2025-04-01"),
invoice_currency=Currencies.CZK, invoice_currency=Currencies.EUR,
header_comment="We invoice you for services", header_comment="We invoice you for services",
bank_accounts=[bank.default().as_dict()], bank_accounts=[bank.default().as_dict()],
), ),
items=[ items=[
InvoiceItem(name="Services", unit_price=100, quantity=1, unit="ks", tax=21),
InvoiceItem(name="SIM card", unit_price=50, quantity=1, tax=21, unit="ks"),
InvoiceItem( InvoiceItem(
name="SIM card 2", unit_price=75, quantity=1, tax=21, unit="ks" name="Website Development", unit_price=1000.0, quantity=1, tax=20
),
InvoiceItem(
name="Hosting Service (1 year)", unit_price=500.0, quantity=1, tax=20
), ),
], ],
contact=ClientContactModel( contact=ClientContactModel(
name="Richard Kubíček", name="John Doe",
email="kubicekr@eledio.com", email="john.doe@examle.com",
phone="+420 123 456 789", phone="+1 555-1234",
address="Jaroslava Foglara 861/1", address="123 Main Street, New York",
ico="123", ico="987654321",
update=True, update=True,
country_id=57, country_id=225,
), ),
) )
""" """