Fix two sum calls in checkout helper

This commit is contained in:
Luis Ramos
2020-10-14 10:19:44 +01:00
committed by Matt-Yorkley
parent 7472b7cc27
commit 974240fd4b

View File

@@ -26,7 +26,7 @@ module CheckoutHelper
def display_checkout_admin_and_handling_adjustments_total_for(order)
adjustments = order.adjustments.eligible.where('originator_type = ? AND source_type != ? ', 'EnterpriseFee', 'Spree::LineItem')
Spree::Money.new adjustments.sum(&:amount), currency: order.currency
Spree::Money.new adjustments.sum(:amount), currency: order.currency
end
def checkout_line_item_adjustments(order)
@@ -34,7 +34,7 @@ module CheckoutHelper
end
def checkout_subtotal(order)
order.item_total + checkout_line_item_adjustments(order).sum(&:amount)
order.item_total + checkout_line_item_adjustments(order).sum(:amount)
end
def display_checkout_subtotal(order)