diff --git a/lib/open_food_network/order_and_distributor_report.rb b/lib/open_food_network/order_and_distributor_report.rb index b705c0cb16..570096cb23 100644 --- a/lib/open_food_network/order_and_distributor_report.rb +++ b/lib/open_food_network/order_and_distributor_report.rb @@ -92,7 +92,7 @@ module OpenFoodNetwork # @return [Array] def row_for(line_item, order) [ - order.created_at, + order.completed_at.strftime("%F %T"), order.id, order.bill_address.full_name, order.email, diff --git a/lib/open_food_network/sales_tax_report.rb b/lib/open_food_network/sales_tax_report.rb index 1ce3f860dd..874561c339 100644 --- a/lib/open_food_network/sales_tax_report.rb +++ b/lib/open_food_network/sales_tax_report.rb @@ -57,7 +57,7 @@ module OpenFoodNetwork totals = totals_of order.line_items shipping_cost = shipping_cost_for order - [order.number, order.created_at, totals[:items], totals[:items_total], + [order.number, order.completed_at.strftime("%F %T"), totals[:items], totals[:items_total], totals[:taxable_total], totals[:sales_tax], shipping_cost, order.shipping_tax, order.enterprise_fee_tax, order.total_tax, order.bill_address.full_name, order.distributor.andand.name] end diff --git a/spec/lib/open_food_network/order_and_distributor_report_spec.rb b/spec/lib/open_food_network/order_and_distributor_report_spec.rb index 9843aa81ac..5b9e564b21 100644 --- a/spec/lib/open_food_network/order_and_distributor_report_spec.rb +++ b/spec/lib/open_food_network/order_and_distributor_report_spec.rb @@ -38,7 +38,7 @@ module OpenFoodNetwork table = subject.table expect(table[0]).to eq([ - order.reload.created_at, + order.reload.completed_at.strftime("%F %T"), order.id, bill_address.full_name, order.email,