Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby
Branch: master
Pull request Compare This branch is 4 commits ahead, 15 commits behind petergebala:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
db/migrate
lib
script
spec
.gitignore
.rspec
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
Versionfile
spree_invoice_generator.gemspec

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

Something went wrong with that request. Please try again.