mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
12777: use unit_to_display method for variant unit
- This method prioritize display_as and after that considers options_text
This commit is contained in:
committed by
Sigmund Petersen
parent
0cf8f079e4
commit
983addff0d
@@ -2,5 +2,5 @@
|
||||
= "#{line_item.product.name}"
|
||||
- unless line_item.product.name.include? line_item.name_to_display
|
||||
%span= "- #{line_item.name_to_display}"
|
||||
- if line_item.options_text
|
||||
= "(#{line_item.options_text})"
|
||||
- if line_item.unit_to_display
|
||||
= "(#{line_item.unit_to_display})"
|
||||
|
||||
@@ -15,7 +15,7 @@ module Reporting
|
||||
customer_city: proc { |line_item| line_item.order.bill_address.city },
|
||||
sku: proc { |line_item| line_item.product.sku },
|
||||
item_name: proc { |line_item| line_item.product.name },
|
||||
variant: proc { |line_item| line_item.options_text },
|
||||
variant: proc { |line_item| line_item.unit_to_display },
|
||||
quantity: proc { |line_item| line_item.quantity },
|
||||
max_quantity: proc { |line_item| line_item.max_quantity },
|
||||
cost: proc { |line_item| line_item.price * line_item.quantity },
|
||||
|
||||
@@ -60,7 +60,7 @@ RSpec.describe Reporting::Reports::OrdersAndDistributors::Base do
|
||||
bill_address.city,
|
||||
line_item.product.sku,
|
||||
line_item.product.name,
|
||||
line_item.options_text,
|
||||
line_item.unit_to_display,
|
||||
line_item.quantity,
|
||||
line_item.max_quantity,
|
||||
line_item.price * line_item.quantity,
|
||||
|
||||
Reference in New Issue
Block a user