incorporate show_customer_names_to_suppliers setting

This commit is contained in:
Ahmed Ejaz
2025-02-16 01:55:38 +05:00
parent 4bc578f38f
commit bc3917ebc1
2 changed files with 9 additions and 3 deletions

View File

@@ -159,6 +159,11 @@ module Spree
spree_current_user.can_manage_line_items_in_orders_only?
end
def display_value_for_producer(order, value)
return value unless distributor_allows_order_editing?(order)
order.distributor&.show_customer_names_to_suppliers ? value : t("admin.reports.hidden")
end
end
end
end

View File

@@ -34,10 +34,11 @@
%span.state{ class: order.shipment_state.to_s}
= t('js.admin.orders.shipment_states.' + order.shipment_state.to_s)
%td
%a{ href: "mailto:#{order.email}", target: "_blank" }
= order.email
- email_value = display_value_for_producer(order, order.email)
%a{ href: "mailto:#{email_value}", target: "_blank" }
= email_value
%td
= order&.bill_address&.full_name_for_sorting
= display_value_for_producer(order, order.bill_address&.full_name_for_sorting)
%td.align-left
%span
= order.display_total