forked from by-cx/InvoiceGenerator
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinvoice.py
38 lines (31 loc) · 1.29 KB
/
invoice.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# -*- coding: utf-8 -*-
from InvoiceGenerator.api import Invoice, Item, Client, Provider
from InvoiceGenerator.pdf import SimpleInvoice
import locale
locale.setlocale(locale.LC_ALL, '')
client = Client(name=u"Polidea Sp. z o.o.",
address1=u"Przeskok 2",
address2=u"00-032 Warszawa",
nip="7010185832")
provider = Provider(name=u"Polidea Sp. z o.o.",
address1=u"Przeskok 2",
address2=u"00-032 Warszawa",
nip="7010185832",
bank_name="Bank",
bank_account="11 2222 3333 4444 5555 6666 7777")
invoice_number = u"1/1/2015"
invoice_date = u"23.01.2015"
invoice = Invoice(client, provider, invoice_number, invoice_date)
invoice.add_item(Item(name=u"Usługa programistyczna\nusługa B która będzie bardzo długa",
count=1,
unit_price=1000,
tax=23))
invoice.add_item(Item(name=u"Usługa programistyczna 2",
count=1,
unit_price=1500,
tax=8))
invoice.add_item(Item(name=u"Usługa programistyczna 3",
count=1,
unit_price=12454,
tax=23))
pdf = SimpleInvoice(invoice, 'invoice.pdf')