Giter VIP home page Giter VIP logo

invoice_generator's Introduction

Automate your invoice with python

Automatically generate print friendly invoices/bills using python. Sample pdf

Directions to use

Step 1 - Clone the repo or download the archive to you local system. Now head to "invoice_genarator" directory.

Step 2 - Install "reportlab" and "pillow" with following commands:

Run these commands in your terminal -

pip install reportlab

pip install pillow

or simply run

pip install requirements.txt

Step 3 - Now feed the data into the pdf.py file in array format.

That's it

Working

Data is converted into objects for simplicity.

# Sample Data 
item = ['Dell Keboard Wireless', 'Samsung RAM 4GB','Samsung SSD 480GB']
warrenty=[12,24,36]  # in months
unit_price = [700, 2400,4860]
qty = [1,2,1]
tax = [0,.18,.18]

objects = []
class Product:
    def __init__(self,item,warrenty,unit_price,tax,quantity):
        self.item = item
        self.unit_price = unit_price
        self.warrenty = warrenty
        self.tax = tax
        self.quantity = quantity
        self.t_price = unit_price*quantity

Some useful offsets for repositioning of elements.

# Y offsets - Global
y_offset = 0   # Header section (above Invoice,company) 
cust_offset = 50 #Customer section
table_offset = 0   #Table section
sub_total_y_offset = -5  # Subtotal/total section offset

# x-offsets in the table
unit_price_x_pos = 370  #Default 370
warrenty_x_pos = 280  #Default 280
qty_x_pos = 470  #Default 470
price_x_pos = 550  #Default 550

# y-offset for new entries is dynamically calculated.

Reference

For in-depth usage visit Documentation or for some extra recipies visit More.

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.