forked from by-cx/InvoiceGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
43 lines (26 loc) · 965 Bytes
/
README
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
39
40
41
42
================
InvoiceGenerator
================
This is library to generate a simple PDF invoice. It's based on ReportLab.
Instalation
===========
Run this command as root::
pip install InvoiceGenerator
If you want upgrade to new version, add --upgrade flag.::
pip install InvoiceGenerator --upgrade
You can use setup.py from GitHub repository too.::
python setup.py install
Example
=======
Usage::
from tempfile import NamedTemporaryFile
from InvoiceGenerator.generator import Generator
from InvoiceGenerator.api import Invoice, Item, Client, Provider, Creator
from InvoiceGenerator.pdf import SimpleInvoice
invoice = Invoice(Client('Client company'), Provider('My company'), Creator('John Doe'))
invoice.add_item(Item(32, 600))
invoice.add_item(Item(60, 50, tax=10))
invoice.add_item(Item(50, 60, tax=5))
invoice.add_item(Item(5, 600, tax=50))
tmp_file = NamedTemporaryFile()
Generator(invoice).gen(tmp_file.name, SimpleInvoice)