Giter Site home page Giter Site logo

lonelypx / nice-invoice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ayazshah2/nice-invoice

0.0 1.0 0.0 170 KB

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

Home Page: https://www.npmjs.com/package/nice-invoice

License: MIT License

nice-invoice's Introduction

Nice Invoice

An easy and quick way to create an invoice.

npmnpm

โญ Star us on Github โ€” it helps!

๐Ÿ“ฅ 5627 Downloads, Checkout on npm-stat.com

Preview - An example invoice

nice-invoice-2

Features

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

Using unkpg CDN:

<script src="https://unpkg.com/[email protected]/dist/index.js"></script>

How to use it?

Checkout article for instllation or 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

Change Log

You can see change logs by clicking on CHANGELOG.md file.

nice-invoice's People

Contributors

ayazshah2 avatar

Watchers

 avatar

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.