Skip to content
This repository has been archived by the owner on Mar 12, 2023. It is now read-only.

Commit

Permalink
updating reports for Karin
Browse files Browse the repository at this point in the history
  • Loading branch information
ivar committed Jul 20, 2015
1 parent 9e64de1 commit c5e22de
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Expand Up @@ -268,7 +268,7 @@ GEM
slop (~> 3.4)
pry-rails (0.3.4)
pry (>= 0.9.10)
puma (2.12.1)
puma (2.12.2)
rabl (0.9.4.pre1)
activesupport (>= 2.3.14)
rack (1.5.5)
Expand Down Expand Up @@ -330,7 +330,7 @@ GEM
thor (~> 0.14)
sexp_processor (4.6.0)
slop (3.6.0)
spreadsheet (1.0.3)
spreadsheet (1.0.4)
ruby-ole (>= 1.0)
spring (1.3.6)
sprockets (2.12.4)
Expand Down
@@ -0,0 +1,7 @@
# This migration comes from spree (originally 20150707204155)
class EnableActsAsParanoidOnCalculators < ActiveRecord::Migration
def change
add_column :spree_calculators, :deleted_at, :datetime
add_index :spree_calculators, :deleted_at
end
end
4 changes: 3 additions & 1 deletion db/schema.rb
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20150623045647) do
ActiveRecord::Schema.define(version: 20150718195302) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -101,9 +101,11 @@
t.datetime "created_at"
t.datetime "updated_at"
t.text "preferences"
t.datetime "deleted_at"
end

add_index "spree_calculators", ["calculable_id", "calculable_type"], name: "index_spree_calculators_on_calculable_id_and_calculable_type", using: :btree
add_index "spree_calculators", ["deleted_at"], name: "index_spree_calculators_on_deleted_at", using: :btree
add_index "spree_calculators", ["id", "type"], name: "index_spree_calculators_on_id_and_type", using: :btree

create_table "spree_configurations", force: true do |t|
Expand Down
5 changes: 3 additions & 2 deletions lib/reporter.rb
Expand Up @@ -87,9 +87,10 @@ def event_title_format

def process_order(order)
order_rows = [[ "#{order.billing_address.last_name.titleize}, #{order.billing_address.first_name.titleize}","##{order.number}"]]
order_rows << [order.email, order.created_at.strftime('%y %m %d'), "#{order.billing_address.try(:city)} #{order.billing_address.try(:state).try(:abbr)}, #{order.billing_address.try(:country)}" ]
order_rows << [order.email, "#{order.billing_address.try(:city)} #{order.billing_address.try(:state).try(:abbr)}, #{order.billing_address.try(:country)}" ]
order_rows << [order.created_at.strftime('%y %m %d')]
order.line_items.each do |line_item|
order_rows << ['',line_item.product.name, line_item.sku, line_item.quantity, "$#{line_item.price}" ]
order_rows << ['', line_item.sku, line_item.quantity, "$#{line_item.price}" ]
end
order_rows
end
Expand Down

0 comments on commit c5e22de

Please sign in to comment.