From 78cfcd905fe8451989fd58b8c66735178a36b279 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Tue, 19 May 2020 22:26:26 +0100 Subject: [PATCH] Adapt more & and no & when using sum --- app/views/producer_mailer/order_cycle_report.html.haml | 4 ++-- app/views/producer_mailer/order_cycle_report.text.haml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/producer_mailer/order_cycle_report.html.haml b/app/views/producer_mailer/order_cycle_report.html.haml index 8acda45749..cc78f43ecd 100644 --- a/app/views/producer_mailer/order_cycle_report.html.haml +++ b/app/views/producer_mailer/order_cycle_report.html.haml @@ -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 diff --git a/app/views/producer_mailer/order_cycle_report.text.haml b/app/views/producer_mailer/order_cycle_report.text.haml index 4de8b60808..c322c3cac5 100644 --- a/app/views/producer_mailer/order_cycle_report.text.haml +++ b/app/views/producer_mailer/order_cycle_report.text.haml @@ -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}