diff --git a/app/models/invoice/data_presenter/shipping_method.rb b/app/models/invoice/data_presenter/shipping_method.rb index 2d9ba86015..ed80c9ffa0 100644 --- a/app/models/invoice/data_presenter/shipping_method.rb +++ b/app/models/invoice/data_presenter/shipping_method.rb @@ -5,6 +5,10 @@ class Invoice class ShippingMethod < Invoice::DataPresenter::Base attributes :id, :name, :require_ship_address invoice_generation_attributes :id + + def category + I18n.t "invoice_shipping_category_#{require_ship_address ? 'delivery' : 'pickup'}" + end end end end diff --git a/app/views/spree/admin/orders/_invoice_table4.html.haml b/app/views/spree/admin/orders/_invoice_table4.html.haml index ffd413a4c9..6ec2fc0170 100644 --- a/app/views/spree/admin/orders/_invoice_table4.html.haml +++ b/app/views/spree/admin/orders/_invoice_table4.html.haml @@ -37,8 +37,8 @@ = item.display_amount_with_adjustments_and_with_taxes %tr %td - %strong= "#{t(:shipping)} " - = "( #{t(:invoice_shipping_type)} #{raw(@order.shipping_method.name)} )" + %strong= "#{@order.shipping_method.category} : " + = "(#{raw(@order.shipping_method.name)})" %td{:align => "right"} %td{:align => "right"} %td{:align => "right"} diff --git a/config/locales/en.yml b/config/locales/en.yml index 08cfddd3b9..9926da47b1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1996,7 +1996,8 @@ en: invoice_cancel_and_replace_invoice: "cancels and replaces invoice" tax_invoice: "TAX INVOICE" tax_total: "Total tax (%{rate}):" - invoice_shipping_type: "Type:" + invoice_shipping_category_delivery: "Delivery" + invoice_shipping_category_pickup: "Pickup" total_excl_tax: "Total (Excl. tax):" total_incl_tax: "Total (Incl. tax):" total_all_tax: "Total tax:" diff --git a/spec/system/admin/invoice_print_spec.rb b/spec/system/admin/invoice_print_spec.rb index 5e51aae36b..cdd126e208 100644 --- a/spec/system/admin/invoice_print_spec.rb +++ b/spec/system/admin/invoice_print_spec.rb @@ -546,8 +546,7 @@ describe ' expect(page).to have_content "#{enterprise_fee.name} fee by $104.35 15.0% $120.00" expect(page).to have_content "coordinator #{user1.enterprises.first.name}" # Shipping - expect(page).to have_content "Shipping ( Type: $91.41 10.0% $100.55" - expect(page).to have_content "#{shipping_method_name} )" + expect(page).to have_content "Delivery :(#{shipping_method_name}) $91.41 10.0% $100.55" # Tax totals expect(page).to have_content "Total tax (10.0%): $9.14 " \ "Total tax (15.0%): $15.65 Total tax (20.0%): $250.08" @@ -650,8 +649,7 @@ describe ' expect(page).to have_content "#{enterprise_fee.name} fee by $120.00 15.0% $138.00" expect(page).to have_content "coordinator #{user1.enterprises.first.name}" # Shipping - expect(page).to have_content "Shipping ( Type: $100.55 10.0% $110.61" - expect(page).to have_content "#{shipping_method_name} )" + expect(page).to have_content "Delivery :(#{shipping_method_name}) $100.55 10.0% $110.61" # Tax totals expect(page).to have_content "Total tax (10.0%): $10.06 " \ "Total tax (15.0%): $18.00 Total tax (20.0%): $300.09"