0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
This gem provides invoice pdf generation from a html template via wkhtmltopdf.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.1.5
~> 0.9.4
 Project Readme

SpreeInvoice

This gem provides model responsible for generating pdf from html file.

Basic Installation

  1. Add the following to your Gemfile
  gem 'spree_invoice', '~> 1.1.0'
  1. Run bundle install
  2. To copy and apply migrations run:
	rails g spree_invoice:install

Configuration

In file config/initializers/spree_invoice.rb please check your configuration for wkhtmltopdf bin path. For more see: wicked_pdf

Usage

  1. Print Invoice directly
	Spree::Invoice.find_by_order_id('some id').try(:generate_pdf)
  1. Print Invoice from order
	Order.last.invoice.generate_pdf
  1. Print Invoice from User
	pdfs = []
	User.last.invoices.each { |e| pdfs << e.generate_pdf }

You can also check how many times invoice was generated - column: counter

Copyright (c) 2012 [Damiano Giacomello], released under the New BSD License