diff --git a/app/controllers/spree/orders_controller.rb b/app/controllers/spree/orders_controller.rb index d3297fe130..95e9390f9b 100644 --- a/app/controllers/spree/orders_controller.rb +++ b/app/controllers/spree/orders_controller.rb @@ -6,7 +6,6 @@ module Spree include Rails.application.routes.url_helpers include CablecarResponses - layout 'darkswarm' rescue_from ActiveRecord::RecordNotFound, with: :render_404 diff --git a/app/services/permitted_attributes/checkout.rb b/app/services/permitted_attributes/checkout.rb index 7020160df4..e9d486d969 100644 --- a/app/services/permitted_attributes/checkout.rb +++ b/app/services/permitted_attributes/checkout.rb @@ -12,9 +12,9 @@ module PermittedAttributes :email, :special_instructions, :existing_card_id, :shipping_method_id, { payments_attributes: [ - :payment_method_id, - { source_attributes: PermittedAttributes::PaymentSource.attributes } - ], + :payment_method_id, + { source_attributes: PermittedAttributes::PaymentSource.attributes } + ], ship_address_attributes: PermittedAttributes::Address.attributes, bill_address_attributes: PermittedAttributes::Address.attributes } ], diff --git a/app/views/spree/admin/orders/invoice.html.haml b/app/views/spree/admin/orders/invoice.html.haml index 55ad2104fb..d1dbc32264 100644 --- a/app/views/spree/admin/orders/invoice.html.haml +++ b/app/views/spree/admin/orders/invoice.html.haml @@ -77,3 +77,6 @@ = @order.distributor.invoice_text = render 'spree/shared/payment' + +- if @order.note.present? + = render partial: 'spree/shared/order_note' diff --git a/app/views/spree/admin/orders/invoice2.html.haml b/app/views/spree/admin/orders/invoice2.html.haml index b59992b084..c55a1f6637 100644 --- a/app/views/spree/admin/orders/invoice2.html.haml +++ b/app/views/spree/admin/orders/invoice2.html.haml @@ -89,3 +89,6 @@ = @order.distributor.invoice_text = render 'spree/shared/payment' + +- if @order.note.present? + = render partial: 'spree/shared/order_note' diff --git a/app/views/spree/shared/_order_note.html.haml b/app/views/spree/shared/_order_note.html.haml new file mode 100644 index 0000000000..1c7e20dbf0 --- /dev/null +++ b/app/views/spree/shared/_order_note.html.haml @@ -0,0 +1,4 @@ +%p.callout{style: "margin-top: 30px"} + %strong= t :additional_information + %p{style: "margin: 5px"} + = @order.note diff --git a/config/locales/en.yml b/config/locales/en.yml index c432924a03..271d7b545e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -187,6 +187,7 @@ en: cardholder_name: "Cardholder name" community_forum_url: "Community forum URL" customer_instructions: "Customer instructions" + additional_information: "Additional Information" devise: passwords: spree_user: diff --git a/spec/views/spree/admin/orders/invoice.html.haml_spec.rb b/spec/views/spree/admin/orders/invoice.html.haml_spec.rb index 7f945acfb1..2550fad578 100644 --- a/spec/views/spree/admin/orders/invoice.html.haml_spec.rb +++ b/spec/views/spree/admin/orders/invoice.html.haml_spec.rb @@ -79,4 +79,11 @@ describe "spree/admin/orders/invoice.html.haml" do expect(rendered).to have_content "Shipping: Pickup" expect(rendered).to_not have_content adas_address_display end + + it "displays order note on invoice when note is given" do + order.note = "Test note" + + render + expect(rendered).to have_content "Test note" + end end