Giter Site home page Giter Site logo

invoicegenerator's Introduction

InvoiceGenerator

This is library to generate a simple PDF invoice. It's based on ReportLab.

Installation

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.api import Invoice, Item, Client, Provider, Creator
    from InvoiceGenerator.pdf import SimpleInvoice

# choose en as language
os.environ["INVOICE_LANG"] = "en"

    client = Client('Client company')
    provider = Provider('My company', bank_account='2600420569/2010')
    creator = Creator('John Doe')

    invoice = Invoice(client, provider, creator)
    invoice.currency_locale = 'en_US.UTF-8'
    invoice.add_item(Item(32, 600, description="Item 1"))
    invoice.add_item(Item(60, 50, description="Item 2", tax=10))
    invoice.add_item(Item(50, 60, description="Item 3", tax=5))
    invoice.add_item(Item(5, 600, description="Item 4", tax=50))

    tmp_file = NamedTemporaryFile(delete=False)
    pdf = SimpleInvoice(invoice)
    pdf.gen(tmp_file.name, generate_qr_code=True)

Hacking

Fork the repository on github and write code. Make sure to add tests covering your code under /tests/. You can run tests using:

python setup.py test

Then propose your patch via a pull request.

Documentation is generated from doc/source/ using Sphinx:

python setup.py build_sphinx

Then head to doc/build/html/index.html.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.