Skip to content

Commit

Permalink
Code style changes for Customer Totals report
Browse files Browse the repository at this point in the history
  • Loading branch information
kristinalim committed Mar 24, 2019
1 parent 1eac070 commit 4c62a3c
Showing 1 changed file with 41 additions and 40 deletions.
81 changes: 41 additions & 40 deletions lib/open_food_network/orders_and_fulfillments_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,55 +102,56 @@ def rules
sort_by: proc { |full_name| full_name } } ]
when "order_cycle_customer_totals"
[ { group_by: proc { |line_item| line_item.order.distributor },
sort_by: proc { |distributor| distributor.name } },
sort_by: proc { |distributor| distributor.name } },
{ group_by: proc { |line_item| line_item.order },
sort_by: proc { |order| order.bill_address.full_name_reverse },
summary_columns: [
proc { |line_items| line_items.first.order.distributor.name },
proc { |line_items| line_items.first.order.bill_address.full_name },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| I18n.t('admin.reports.total') },
proc { |line_items| "" },
sort_by: proc { |order| order.bill_address.full_name_reverse },
summary_columns: [
proc { |line_items| line_items.first.order.distributor.name },
proc { |line_items| line_items.first.order.bill_address.full_name },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| I18n.t('admin.reports.total') },
proc { |line_items| "" },

proc { |line_items| "" },
proc { |line_items| line_items.sum(&:amount) },
proc { |line_items| line_items.sum(&:amount_with_adjustments) },
proc { |line_items| line_items.first.order.admin_and_handling_total },
proc { |line_items| line_items.first.order.ship_total },
proc { |line_items| line_items.first.order.payment_fee },
proc { |line_items| line_items.first.order.total },
proc { |line_items| line_items.first.order.paid? ? I18n.t(:yes) : I18n.t(:no) },
proc { |line_items| "" },
proc { |line_items| line_items.sum(&:amount) },
proc { |line_items| line_items.sum(&:amount_with_adjustments) },
proc { |line_items| line_items.first.order.admin_and_handling_total },
proc { |line_items| line_items.first.order.ship_total },
proc { |line_items| line_items.first.order.payment_fee },
proc { |line_items| line_items.first.order.total },
proc { |line_items| line_items.first.order.paid? ? I18n.t(:yes) : I18n.t(:no) },

proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },

proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },

proc { |line_items| line_items.first.order.special_instructions } ,
proc { |line_items| "" },

proc { |line_items| line_items.first.order.order_cycle.andand.name },
proc { |line_items| line_items.first.order.payments.first.andand.payment_method.andand.name },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| line_items.first.order.special_instructions } ,
proc { |line_items| "" },

proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" }
] },
proc { |line_items| line_items.first.order.order_cycle.andand.name },
proc { |line_items|
line_items.first.order.payments.first.andand.payment_method.andand.name
},
proc { |line_items| "" },
proc { |line_items| "" },

proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" },
proc { |line_items| "" }
] },
{ group_by: proc { |line_item| line_item.variant },
sort_by: proc { |variant| variant.full_name } },
sort_by: proc { |variant| variant.full_name } },
{ group_by: proc { |line_item| line_item.full_name },
sort_by: proc { |full_name| full_name } } ]
sort_by: proc { |full_name| full_name } } ]
else
[ { group_by: proc { |line_item| line_item.product.supplier },
sort_by: proc { |supplier| supplier.name } },
Expand Down

0 comments on commit 4c62a3c

Please sign in to comment.