0.0
No commit activity in last 3 years
No release in over 3 years
InvoicedLite API Wrapper for Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
>= 5.8.4, ~> 5.8
~> 10.0

Runtime

~> 0.48.0
>= 1.8.3, ~> 1.8
= 1.0.5
 Project Readme

EasyInvoice

InvoicedLite API Wrapper for Ruby

Please look here for list of parameters: https://github.com/Invoiced/invoice-generator-api

Installation

Add this line to your application's Gemfile:

gem 'easy_invoice'

And then execute:

$ bundle

Or install it yourself as:

$ gem install easy_invoice

Usage

You can directly input options

options = {
    :from=>"Invoiced, Inc.", 
    :to=>"Parag", 
    :logo=>"https://invoiced.com/img/logo-invoice.png", 
    :number=>1,
    :items=>[
        {
            :name=>"Starter plan", 
            :quantity=>1, 
            :unit_cost=>99
        }
    ], 
    :notes=>"Thanks for your business!"
}
# Initialize Invoice
invoice = EasyInvoice::Invoice.new(options: options)
# Perform API call to retrieve pdf.
invoice.generate_pdf
# Pdf data is stored in invoice.pdf
invoice.pdf

Or you can define EasyInvoice::Template and EasyInvoice::Item and pass them into the initialization

template = EasyInvoice::Template.new({currency: "USD", header: "Custom Header"})
item = EasyInvoice::Item.new({name: "Item1", quantity: 5, unit_cost: "5"})

invoice = EasyInvoice::Invoice.new(template: template, items: [item])
invoice.generate_pdf
invoice.pdf