Adapt more & and no & when using sum

This commit is contained in:
Luis Ramos
2020-05-19 22:26:26 +01:00
committed by Matt-Yorkley
parent 9bbef16804
commit 78cfcd905f
2 changed files with 3 additions and 3 deletions

View File

@@ -37,13 +37,13 @@
%td
#{raw(product_and_full_name)}
%td.text-right
#{line_items.sum(:quantity)}
#{line_items.sum(&:quantity)}
%td.text-right
#{line_items.first.single_money}
%td.text-right
#{Spree::Money.new(line_items.sum(&:total), currency: line_items.first.currency) }
%td.tax.text-right
#{Spree::Money.new(line_items.sum(:included_tax), currency: line_items.first.currency) }
#{Spree::Money.new(line_items.sum(&:included_tax), currency: line_items.first.currency) }
%tr.total-row
%td
%td

View File

@@ -13,7 +13,7 @@ Orders summary
= t :producer_mail_order_text
\
- @grouped_line_items.each_pair do |product_and_full_name, line_items|
#{line_items.first.variant.sku} - #{raw(line_items.first.product.supplier.name)} - #{raw(product_and_full_name)} (QTY: #{line_items.sum(:quantity)}) @ #{line_items.first.single_money} = #{Spree::Money.new(line_items.sum(&:total), currency: line_items.first.currency)}
#{line_items.first.variant.sku} - #{raw(line_items.first.product.supplier.name)} - #{raw(product_and_full_name)} (QTY: #{line_items.sum(&:quantity)}) @ #{line_items.first.single_money} = #{Spree::Money.new(line_items.sum(&:total), currency: line_items.first.currency)}
\
\
#{t :total}: #{@total}