mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Printing/sending an invoice uses the same template for generating a pdf
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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'
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user