No description, website, or topics provided.
Ruby
Pull request Compare This branch is 4 commits ahead, 15 commits behind petergebala:master.
Latest commit cb0f130 Oct 17, 2012 Thomas von Deyen Version 0.1.0
Permalink
Failed to load latest commit information.
app Ensures that the invoice is only created after order complete. Oct 17, 2012
config More robust config setting method. Jun 22, 2012
db/migrate Adding an invoice_number attribute and a configurable generation meth… Jun 13, 2012
lib Version 0.1.0 Oct 17, 2012
script first commit Feb 7, 2012
spec Add controller to app, and rake task for generating records Feb 10, 2012
.gitignore first commit Feb 7, 2012
.rspec first commit Feb 7, 2012
Gemfile Cleaning up the Gemfile, gemspec and adding a versionfile Jun 22, 2012
Gemfile.lock
LICENSE first commit Feb 7, 2012
README.md Actualize README.md Feb 14, 2012
Rakefile first commit Feb 7, 2012
Versionfile Basic model for invoice printings and some configuration stuff Feb 10, 2012
spree_invoice_generator.gemspec Cleaning up the Gemfile, gemspec and adding a versionfile Jun 22, 2012

README.md

SpreeInvoiceGenerator

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

Installation

Add to Gemfile:


 gem 'spree_invoice_generator'

Execute:


rails g spree_invoice_generator:install

Configuration:


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

In any model you can generate pdf string:


Spree::InvoicePrint.find_by_order_id('some id').try(:generate_pdf)

or:

Order.last.invoice_print.generate_pdf

or:

pdfs = []
User.last.invoice_prints.each { |e| pdfs << e.generate_pdf }

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