GithubHelp home page GithubHelp logo

spreehood / spree-html-invoice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vinsol-spree-contrib/spree-html-invoice

1.0 1.0 2.0 159 KB

Spree client side invoice printing

Ruby 34.87% CSS 13.56% HTML 51.56%

spree-html-invoice's Introduction

Spree-Html-Invoice

This extension provides a "Print Invoice" button on the Admin Orders view screen which opens a printable html page with the order details.

Try Spree Html Invoice for Spree 3-1 with direct deployment on Heroku:

Deploy

Try Spree Html Invoice for Spree 3-4 with direct deployment on Heroku:

Deploy

Try Spree Html Invoice for Spree 4-1 with direct deployment on Heroku:

Deploy

Installation

  1. Add this extension to your Gemfile with this line:

Spree > 3.3

  gem 'spree_html_invoice', git: 'https://github.com/vinsol-spree-contrib/spree-html-invoice', branch: 'master'

Spree <= 3.3

  gem 'spree_html_invoice', git: 'https://github.com/vinsol-spree-contrib/spree-html-invoice', branch: 'X-X-stable'

The branch option is important: it must match the version of Spree you're using. For example, use 3-0-stable if you're using Spree 3-0-stable or any 3.0.x version.

  1. Install the gem using Bundler:
  bundle install
  1. Configure your logo and footer text or more. It's easy as it's html.

Configuration

  1. Set the logo path preference to include your store / company logo.

    Spree::HtmlInvoice::Config.set(html_invoice_logo_path: <"company-logo.png">)

    Somewhere in your asset path

  2. Override any of the partial templates. they are address, footer, totals, header, thanks , and the line_items. The whole tanks is wrapped in a thanks hook, so replace or add at will.

  3. Set Spree::HtmlInvoice::Config.set(:suppress_anonymous_address) option to get blank addresses for anonymous email addresses (as created by my spree_last_address extension for empty/unknown user info)

  4. Enable packaging slips, by setting

Spree::HtmlInvoice::Config.set(print_buttons: "invoice,packaging_slip")  #comma separated list

Use above feature for your own template if you want. For each button_name, define a subsection with header, print, and thanks, in your locale.

Contributions welcome

Testing

Spree >= 3.1

For Building Dependencies:

appraisal install

The dummy app can be regenerated by using:

appraisal spree-3-1 rake test_app

This will run rake test_app using the dependencies configured for Spree 3.1. Similarly you can use spree-3-2 and spree-master for generating dummy applications using dependencies for Spree 3.2 and latest version of Spree

appraisal spree-3-1 rspec

This will run rspec using the dependencies configured for Spree 3.1. Similarly you can use spree-3-2 and spree-master to run rspec using dependencies for Spree 3.2 and latest version of Spree

Spree 3.0 and Spree 2.x

First bundle your dependencies, then run rake. rake will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using rake test_app.

bundle
bundle exec rspec spec

Contributing

  1. Fork the repo.
  2. Clone your repo.
  3. Run bundle install.
  4. Run bundle exec rake test_app to create the test application in spec/test_app.
  5. Make your changes.
  6. Ensure specs pass by running bundle exec rspec spec.
  7. Submit your pull request.

spree-html-invoice's People

Contributors

anitarao avatar five18pm avatar iloveitaly avatar jynti avatar limb avatar nishant-cyro avatar pdamer avatar pikender avatar poudelprakash avatar priyank-gupta avatar rishabhguptarishi avatar sakshat avatar sawangupta92 avatar shradhan avatar tanmay3011 avatar vinay-mittal avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

erpe rahul2103

spree-html-invoice's Issues

Dummy App cannot be created [NEEDS FIX]

bundle exec rake extension:test_app
rake aborted!
LoadError: cannot load such file --
/Users/prakash/.rbenv/versions/2.7.1/bin/bundle:23:in `load'
/Users/prakash/.rbenv/versions/2.7.1/bin/bundle:23:in `<main>'
Tasks: TOP => common:test_app
(See full trace by running task with --trace)

This issue also prevents running tests in this repo:

bundle exec rspec spec

An error occurred while loading ./spec/controllers/spree/admin/invoice_controller_spec.rb.
Failure/Error: require File.expand_path('../dummy/config/environment.rb',  __FILE__)

LoadError:
  cannot load such file -- /Users/prakash/workspaces/2020/ecom/spree-html-invoice/spec/dummy/config/environment.rb
# ./spec/spec_helper.rb:7:in `require'
# ./spec/spec_helper.rb:7:in `<top (required)>'
# ./spec/controllers/spree/admin/invoice_controller_spec.rb:1:in `require'
# ./spec/controllers/spree/admin/invoice_controller_spec.rb:1:in `<top (required)>'
No examples found.


Finished in 0.00003 seconds (files took 0.30152 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

Coverage report generated for RSpec to /Users/prakash/workspaces/2020/ecom/spree-html-invoice/coverage. 0 / 89 LOC (0.0%) covered.
SimpleCov failed with exit 1

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.