Add order note at the end of both invoices following current UI patterns

Add translation for note title in invoice

Update invoice spec to also test for order note
This commit is contained in:
Nihal Mohammed
2022-08-10 21:47:22 +05:30
parent 4a3bd510a7
commit 53ee5c32eb
7 changed files with 21 additions and 4 deletions

View File

@@ -6,7 +6,6 @@ module Spree
include Rails.application.routes.url_helpers
include CablecarResponses
layout 'darkswarm'
rescue_from ActiveRecord::RecordNotFound, with: :render_404

View File

@@ -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 }
],

View File

@@ -77,3 +77,6 @@
= @order.distributor.invoice_text
= render 'spree/shared/payment'
- if @order.note.present?
= render partial: 'spree/shared/order_note'

View File

@@ -89,3 +89,6 @@
= @order.distributor.invoice_text
= render 'spree/shared/payment'
- if @order.note.present?
= render partial: 'spree/shared/order_note'

View File

@@ -0,0 +1,4 @@
%p.callout{style: "margin-top: 30px"}
%strong= t :additional_information
%p{style: "margin: 5px"}
= @order.note

View File

@@ -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:

View File

@@ -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