Printing/sending an invoice uses the same template for generating a pdf

This commit is contained in:
Rob Harrington
2015-11-18 10:02:51 +11:00
parent 75846a4d1f
commit 6268b7cc7e
3 changed files with 2 additions and 21 deletions

View File

@@ -82,7 +82,7 @@ Spree::Admin::OrdersController.class_eval do
end
def print
render pdf: "invoice-#{@order.number}", encoding: "UTF-8"
render pdf: "invoice-#{@order.number}", template: "spree/admin/orders/invoice", encoding: "UTF-8"
end
def update_distribution_charge

View File

@@ -1,19 +0,0 @@
= wicked_pdf_stylesheet_link_tag "mail/all"
%table{:width => "100%"}
%tbody
%tr
%td{ :align => "left" }
%h4
Order confirmation
%strong ##{@order.number}
%h5
#{@order.bill_address.firstname} #{@order.bill_address.lastname}
%strong= " <#{@order.email}>" if @order.email
= @order.bill_address.phone if @order.bill_address.phone
%h5= "Customer Code: #{@order.customer.code}"
= render 'spree/order_mailer/order_summary'
= render 'spree/order_mailer/payment'
= render 'spree/order_mailer/shipping'

View File

@@ -219,7 +219,7 @@ describe Spree::Admin::OrdersController do
before { controller.stub spree_current_user: distributor.owner }
it "should allow me to send order invoices" do
spree_get :print, params
expect(response).to render_template :print
expect(response).to render_template :invoice
end
end
end