mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-15 23:57:48 +00:00
Disable violated cops in Order and Fulfillment report subtypes
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
# rubocop:disable Metrics/ClassLength
|
||||
module OpenFoodNetwork
|
||||
class OrdersAndFulfillmentsReport
|
||||
class CustomerTotalsReport
|
||||
@@ -11,6 +12,8 @@ module OpenFoodNetwork
|
||||
@context = context
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
def header
|
||||
[I18n.t(:report_header_hub), I18n.t(:report_header_customer), I18n.t(:report_header_email),
|
||||
I18n.t(:report_header_phone), I18n.t(:report_header_producer),
|
||||
@@ -33,7 +36,11 @@ module OpenFoodNetwork
|
||||
I18n.t(:report_header_billing_city), I18n.t(:report_header_billing_postcode),
|
||||
I18n.t(:report_header_billing_state)]
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
# rubocop:enable Metrics/MethodLength
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
def rules
|
||||
[
|
||||
{
|
||||
@@ -100,7 +107,13 @@ module OpenFoodNetwork
|
||||
}
|
||||
]
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
# rubocop:enable Metrics/MethodLength
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
# rubocop:disable Metrics/CyclomaticComplexity
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
# rubocop:disable Metrics/PerceivedComplexity
|
||||
def columns
|
||||
rsa = proc { |line_items| line_items.first.order.shipping_method.andand.delivery? }
|
||||
[
|
||||
@@ -171,6 +184,11 @@ module OpenFoodNetwork
|
||||
proc { |line_items| line_items.first.order.bill_address.andand.state }
|
||||
]
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
# rubocop:enable Metrics/CyclomaticComplexity
|
||||
# rubocop:enable Metrics/MethodLength
|
||||
# rubocop:enable Metrics/PerceivedComplexity
|
||||
end
|
||||
end
|
||||
end
|
||||
# rubocop:enable Metrics/ClassLength
|
||||
|
||||
@@ -17,6 +17,8 @@ module OpenFoodNetwork
|
||||
I18n.t(:report_header_shipping_method)]
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
def rules
|
||||
[
|
||||
{
|
||||
@@ -48,7 +50,10 @@ module OpenFoodNetwork
|
||||
}
|
||||
]
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
# rubocop:enable Metrics/MethodLength
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
def columns
|
||||
[proc { |line_items| line_items.first.order.distributor.name },
|
||||
proc { |line_items| line_items.first.variant.product.supplier.name },
|
||||
@@ -60,6 +65,7 @@ module OpenFoodNetwork
|
||||
proc { |_line_items| "" },
|
||||
proc { |_line_items| I18n.t(:report_header_shipping_method) }]
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,6 +18,8 @@ module OpenFoodNetwork
|
||||
I18n.t(:report_header_total_cost), I18n.t(:report_header_shipping_method)]
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
def rules
|
||||
[
|
||||
{
|
||||
@@ -48,7 +50,10 @@ module OpenFoodNetwork
|
||||
}
|
||||
]
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
# rubocop:enable Metrics/MethodLength
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
def columns
|
||||
[
|
||||
supplier_name,
|
||||
@@ -61,6 +66,7 @@ module OpenFoodNetwork
|
||||
proc { |_line_items| I18n.t(:report_header_shipping_method) }
|
||||
]
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -19,6 +19,7 @@ module OpenFoodNetwork
|
||||
I18n.t(:report_header_incoming_transport)]
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
def rules
|
||||
[
|
||||
{
|
||||
@@ -35,7 +36,9 @@ module OpenFoodNetwork
|
||||
}
|
||||
]
|
||||
end
|
||||
# rubocop:enable Metrics/MethodLength
|
||||
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
def columns
|
||||
[
|
||||
supplier_name,
|
||||
@@ -49,6 +52,7 @@ module OpenFoodNetwork
|
||||
proc { |_line_items| I18n.t(:report_header_incoming_transport) }
|
||||
]
|
||||
end
|
||||
# rubocop:enable Metrics/MethodLength
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user