mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #9554 from apricot12/9179-Note-on-invoices
Add order note at the end of both invoices following current UI patterns.
This commit is contained in:
@@ -6,7 +6,6 @@ module Spree
|
||||
include Rails.application.routes.url_helpers
|
||||
include CablecarResponses
|
||||
|
||||
|
||||
layout 'darkswarm'
|
||||
|
||||
rescue_from ActiveRecord::RecordNotFound, with: :render_404
|
||||
|
||||
@@ -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 }
|
||||
],
|
||||
|
||||
@@ -77,3 +77,6 @@
|
||||
= @order.distributor.invoice_text
|
||||
|
||||
= render 'spree/shared/payment'
|
||||
|
||||
- if @order.note.present?
|
||||
= render partial: 'spree/shared/order_note'
|
||||
|
||||
@@ -89,3 +89,6 @@
|
||||
= @order.distributor.invoice_text
|
||||
|
||||
= render 'spree/shared/payment'
|
||||
|
||||
- if @order.note.present?
|
||||
= render partial: 'spree/shared/order_note'
|
||||
|
||||
4
app/views/spree/shared/_order_note.html.haml
Normal file
4
app/views/spree/shared/_order_note.html.haml
Normal file
@@ -0,0 +1,4 @@
|
||||
%p.callout{style: "margin-top: 30px"}
|
||||
%strong= t :additional_information
|
||||
%p{style: "margin: 5px"}
|
||||
= @order.note
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user