mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Display line items in confirmation email with fees included in item totals
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user