mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #10064 from abdellani/add_final_weight_to_occt_report_
Add final weight to occt report
This commit is contained in:
@@ -2866,6 +2866,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
report_header_delivery_postcode: Delivery Postcode
|
||||
report_header_bulk_unit_size: Bulk Unit Size
|
||||
report_header_weight: Weight
|
||||
report_header_final_weight_volume: Final (Weight/Volume)
|
||||
report_header_height: Height
|
||||
report_header_width: Width
|
||||
report_header_depth: Depth
|
||||
|
||||
@@ -64,6 +64,7 @@ module Reporting
|
||||
|
||||
order_number: proc { |line_items| line_items.first.order.number },
|
||||
date: proc { |line_items| line_items.first.order.completed_at.strftime("%F %T") },
|
||||
final_weight_volume: proc { |line_items| line_items.sum(&:final_weight_volume) },
|
||||
}
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
@@ -101,6 +102,14 @@ module Reporting
|
||||
}.values
|
||||
end
|
||||
|
||||
def default_params
|
||||
super.merge(
|
||||
{
|
||||
fields_to_hide: [:final_weight_volume]
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def row_header(row)
|
||||
|
||||
Reference in New Issue
Block a user