Only show Admin & Handling fees once on completed order form

This commit is contained in:
Rob Harrington
2017-05-05 15:28:01 +10:00
parent 08e391856c
commit c4fbcb19d0
3 changed files with 3 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ module CheckoutHelper
enterprise_fee_adjustments = adjustments.select { |a| a.originator_type == 'EnterpriseFee' && a.source_type != 'Spree::LineItem' }
adjustments.reject! { |a| a.originator_type == 'EnterpriseFee' && a.source_type != 'Spree::LineItem' }
unless exclude.include? :admin_and_handling
adjustments << Spree::Adjustment.new(label: 'Admin & Handling', amount: enterprise_fee_adjustments.sum(&:amount))
adjustments << Spree::Adjustment.new(label: I18n.t(:orders_form_admin), amount: enterprise_fee_adjustments.sum(&:amount))
end
adjustments

View File

@@ -43,7 +43,7 @@
%span.order-total.distribution-total= display_checkout_admin_and_handling_adjustments_total_for(@order)
%td
- checkout_adjustments_for(@order, exclude: [:line_item]).reject{ |a| a.amount == 0 }.reverse_each do |adjustment|
- checkout_adjustments_for(@order, exclude: [:line_item, :admin_and_handling]).reject{ |a| a.amount == 0 }.reverse_each do |adjustment|
%tr.order-adjustment
%td.text-right{:colspan => "3"}
= adjustment.label

View File

@@ -1045,7 +1045,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
orders_edit_checkout: Checkout
orders_form_empty_cart: "Empty cart"
orders_form_subtotal: Produce subtotal
orders_form_admin: Admin and handling
orders_form_admin: Admin & Handling
orders_form_total: Total
orders_oc_expired_headline: Orders have closed for this order cycle
orders_oc_expired_text: "Sorry, orders for this order cycle closed %{time} ago! Please contact your hub directly to see if they can accept late orders."