Modules

InvoiceGenerator is made of four submodules:

InvoiceGenerator.api

class InvoiceGenerator.api.Address(summary, address='', city='', zip_code='', phone='', email='', bank_name='', bank_account='', bank_code='', note='', vat_id='', ir='', logo_filename='', vat_note='')

Bases: InvoiceGenerator.api.UnicodeProperty

Abstract address definition

Parameters:
  • summary – address header line - name of addressee or company name
  • address – line of the address with street and house number
  • city – city or part of the city
  • zip_code – zip code (PSČ in Czech)
  • phone
  • email
  • bank_name
  • bank_account – bank account number
  • bank_code
  • note – note that will be written on the invoice
  • vat_id – value added tax identification number (DIČ in czech)
  • ir – Taxpayer identification Number (IČO in czech)
  • logo_filename – path to the image of logo of the company
bank_account_str()

Returns bank account identifier with bank code after slash

class InvoiceGenerator.api.Client(summary, address='', city='', zip_code='', phone='', email='', bank_name='', bank_account='', bank_code='', note='', vat_id='', ir='', logo_filename='', vat_note='')

Bases: InvoiceGenerator.api.Address

Definition of client (recipient of the invoice) address.

bank_account_str()

Returns bank account identifier with bank code after slash

class InvoiceGenerator.api.Provider(summary, address='', city='', zip_code='', phone='', email='', bank_name='', bank_account='', bank_code='', note='', vat_id='', ir='', logo_filename='', vat_note='')

Bases: InvoiceGenerator.api.Address

Definition of prvider (subject, that issued the invoice) address.

bank_account_str()

Returns bank account identifier with bank code after slash

class InvoiceGenerator.api.Creator(name, stamp_filename='')

Bases: InvoiceGenerator.api.UnicodeProperty

Definition of creator of the invoice (ussually an accountant).

Parameters:
  • name – name of the issuer
  • stamp_filename – path to file with stamp (or subscription)
class InvoiceGenerator.api.Item(count, price, description='', unit='', tax=Decimal('0'))

Bases: object

Item on the invoice.

Parameters:
  • count – number of items or quantity associated with unit
  • price – price for unit
  • unit – unit in which it is measured (pieces, Kg, l)
  • tax – the tax rate under which the item falls (in percent)
count

Count or amount of the items.

count_tax()

Value of only tax that will be payed for the items.

description

Short description of the item.

price

Price for unit.

tax

Tax rate.

total

Total price for the items without tax.

total_tax

Total price for the items with tax.

unit

Unit.

class InvoiceGenerator.api.Invoice(client, provider, creator)

Bases: InvoiceGenerator.api.UnicodeProperty

Invoice definition

Parameters:
  • client (Client) – client of the invoice
  • creator (Creator) – creator of the invoice
  • provider (Provider) – provider of the invoice
add_item(item)

Add item to the invoice.

Parameters:item (Item class) – the new item
currency = u'K\u010d'

currency identifier (e.g. “$” or “Kč”)

currency_locale = 'cs_CZ.UTF-8'

currency_locale: locale according to which will be the written currency representations

date = None

date of exposure

difference_in_rounding

Difference between rounded price and real price.

generate_breakdown_vat()
generate_breakdown_vat_table()
iban = None

iban

items

Items on the invoice.

number = None

number or string used as the invoice identifier

payback = None

due date

paytype = None

textual description of type of payment

price

Total sum price without taxes.

price_tax

Total sum price including taxes.

rounding_result = False

round result to integers?

rounding_strategy = 'ROUND_HALF_EVEN'

Result rounding strategy (identifiers from decimal module). Default strategy for rounding in Python is bankers’ rounding, which means that half of the X.5 numbers are rounded down and half up. Use this parameter to set different rounding strategy.

specific_symbol = None

specific_symbol

swift = None

swift

taxable_date = None
taxable date
title = ''

title on the invoice

use_tax = False
variable_symbol = None

variable symbol associated with the payment

InvoiceGenerator.pdf

class InvoiceGenerator.pdf.SimpleInvoice(invoice)

Bases: InvoiceGenerator.pdf.BaseInvoice

Generator of simple invoice in PDF format

Parameters:invoice (Invoice) – the invoice
gen(filename, generate_qr_code=False)

Generate the invoice into file

Parameters:
  • filename (string or File) – file in which the PDF simple invoice will be written
  • generate_qr_code (boolean) – should be QR code included in the PDF?
class InvoiceGenerator.pdf.ProformaInvoice(invoice)

Bases: InvoiceGenerator.pdf.SimpleInvoice

class InvoiceGenerator.pdf.CorrectingInvoice(invoice)

Bases: InvoiceGenerator.pdf.SimpleInvoice

drawCorretion(TOP, LEFT)
gen(filename)

Generate the invoice into file

Parameters:filename (string or File) – file in which the PDF correcting invoice will be written

InvoiceGenerator.pohoda