Skip to content

By using this package you can generate a dynamic pdf invoice easily.

Notifications You must be signed in to change notification settings

sarraf1996/nice-invoice

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nice Invoice

An easy and quick way to create an invoice.

npmnpm

Preview - An example invoice

nice-invoice-2

Features

  • Adjust Logo if available
  • Calculate price with quantity
  • Apply and calculate tax

How to use it

Following are quick steps for installing and using this package,

Step: 01

Install nice invoice package by following command.

npm i nice-invoice

Step: 02

Include package main class into your page

const niceInvoice = require("nice-invoice");

Step: 03

Store your invoice details into variable and then generate it.

const invoiceDetail = {
    shipping: {
      name: "Micheal",
      address: "1234 Main Street",
      city: "Dubai",
      state: "Dubai",
      country: "UAE",
      postal_code: 94111
    },
    items: [
      {
        item: "Chair",
        description: "Wooden chair",
        quantity: 1,
        price: 50.00, 
        tax: "10%"
      },
      {
        item: "Watch",
        description: "Wall watch for office",
        quantity: 2,
        price: 30.00,
        tax: "10%"
      },
      {
        item: "Water Glass Set",
        description: "Water glass set for office",
        quantity: 1,
        price: 35.00,
        tax: ""
      }
    ],
    subtotal: 156,
    total: 156,
    order_number: 1234222,
    header:{
        company_name: "Nice Invoice",
        company_logo: "logo.png",
        company_address: "Nice Invoice. 123 William Street 1th Floor New York, NY 123456"
    },
    footer:{
      text: "This is footer - you can add any text here"
    },
    currency_symbol:"$", 
    date: {
      billing_date: "08 August 2020",
      due_date: "10 September 2020",
    }
};

niceInvoice(invoiceDetail, 'your-invoice-name.pdf');

Optional Parameters

Following parameters you can leave it blank
company_logo: company_logo: "",
tax: tax: ""

Contributions

Contributions and suggestions are very welcome and wanted. I try to respond to pull requests within 24 hours, checkout How to contribute

About

By using this package you can generate a dynamic pdf invoice easily.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%