diff --git a/app/models/spree/line_item_decorator.rb b/app/models/spree/line_item_decorator.rb index ba12d366be..9ce49eb67e 100644 --- a/app/models/spree/line_item_decorator.rb +++ b/app/models/spree/line_item_decorator.rb @@ -22,4 +22,14 @@ Spree::LineItem.class_eval do joins(:product). where('spree_products.supplier_id IN (?)', enterprises) } + + def amount_with_adjustments + # EnterpriseFee#create_locked_adjustment applies adjustments on line items to their parent order, + # so line_item.adjustments returns an empty array + amount + Spree::Adjustment.where(source_id: id).sum(&:amount) + end + + def display_amount_with_adjustments + Spree::Money.new(amount_with_adjustments, { :currency => currency }) + end end diff --git a/app/views/spree/order_mailer/confirm_email_for_customer.html.haml b/app/views/spree/order_mailer/confirm_email_for_customer.html.haml index 0de5b177d8..65b7a202d8 100644 --- a/app/views/spree/order_mailer/confirm_email_for_customer.html.haml +++ b/app/views/spree/order_mailer/confirm_email_for_customer.html.haml @@ -10,7 +10,7 @@ %p Thanks for shopping on %strong= "#{Spree::Config.site_name}." - Here are your order details from + Here are the details for you order from %strong= "#{@order.distributor.name}." %table.column{:align => "left"} %tr @@ -39,7 +39,8 @@ %td{:align => "right"} = item.quantity %td{:align => "right"} - = item.display_amount + = item.display_amount_with_adjustments + %tr %td{:colspan => "3"}   %tr