Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spree Print Invoice Blank #93

Open
ChrisEstanol opened this issue Jul 23, 2015 · 3 comments
Open

Spree Print Invoice Blank #93

ChrisEstanol opened this issue Jul 23, 2015 · 3 comments

Comments

@ChrisEstanol
Copy link

I am using Spree 3.0.0, Spree Print Invoice gem and I have set it up in my gemfile using the branch: '3-0-stable'.

I have installed it with the command

bundle && exec rails g spree_print_invoice:install

I have a simple config/initializers/print_invoice.rb

Spree::PrintInvoice::Config.set(page_layout: :portrait,page_size: 'A4')
Spree::PrintInvoice::Config.set(print_buttons: 'invoice')
Spree::PrintInvoice::Config.set(store_pdf: true) # Default: tmp/order_prints

I have now in my admin configuration a Print Invoice Settings section as well as a print invoice button with each orders.

Here is the log when creating invoice:

Started GET "/admin/orders/R123456789.pdf?template=invoice" for ::1 at 2015-07-22 17:10:00 -0500
Processing by Spree::Admin::OrdersController#show as PDF
  Parameters: {"template"=>"invoice", "id"=>"R123456789"}
  Spree::Preference Load (0.3ms)  SELECT  "spree_preferences".* FROM "spree_preferences" WHERE "spree_preferences"."key" = $1 LIMIT 1  [["key", "spree/backend_configuration/locale"]]
  Spree::User Load (0.5ms)  SELECT  "spree_users".* FROM "spree_users" WHERE "spree_users"."deleted_at" IS NULL AND "spree_users"."id" = $1  ORDER BY "spree_users"."id" ASC LIMIT 1  [["id", 6]]
   (0.4ms)  SELECT COUNT(*) FROM "spree_roles" INNER JOIN "spree_roles_users" ON "spree_roles"."id" = "spree_roles_users"."role_id" WHERE "spree_roles_users"."user_id" = $1 AND "spree_roles"."name" = $2  [["user_id", 6], ["name", "admin"]]
  Spree::Order Load (0.6ms)  SELECT  "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."number" = $1  ORDER BY "spree_orders"."id" ASC LIMIT 1  [["number", "R123456789"]]
  Spree::Adjustment Load (0.5ms)  SELECT "spree_adjustments".* FROM "spree_adjustments" WHERE "spree_adjustments"."adjustable_type" = 'Spree::Order' AND "spree_adjustments"."adjustable_id" IN (1)  ORDER BY spree_adjustments.created_at ASC
  Rendered text template (0.0ms)
Sent data  (2.7ms)
Completed 200 OK in 18ms (Views: 2.5ms | ActiveRecord: 2.3ms)

The invoices are created into tmp/order_prints but they all are completely blanks. The pdf viewer of my browser is blocked on loading...
Anything I need to do in order to make it work?

@alexw23
Copy link

alexw23 commented Sep 1, 2015

👍

@mmintel
Copy link

mmintel commented Sep 4, 2015

Same here!

@mmintel
Copy link

mmintel commented Sep 7, 2015

hi there, my issue was solved after changing "next order number" from 0 to 1. maybe that helps you also?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants