Class: Spree::ReportLineItems::SalesTotal

Inherits:
Spree::ReportLineItem show all
Defined in:
app/models/spree/report_line_items/sales_total.rb

Instance Attribute Summary

Attributes inherited from Spree::ReportLineItem

#record, #report

Instance Method Summary collapse

Methods inherited from Spree::ReportLineItem

csv_headers, headers, #to_csv

Instance Method Details

#dateObject



16
17
18
# File 'app/models/spree/report_line_items/sales_total.rb', line 16

def date
  record.order.completed_at.strftime('%Y-%m-%d')
end

#orderObject



20
21
22
# File 'app/models/spree/report_line_items/sales_total.rb', line 20

def order
  record.order.number
end

#pre_tax_amountObject



36
37
38
# File 'app/models/spree/report_line_items/sales_total.rb', line 36

def pre_tax_amount
  record.display_pre_tax_amount
end

#productObject



24
25
26
# File 'app/models/spree/report_line_items/sales_total.rb', line 24

def product
  record.variant.descriptive_name
end

#promo_totalObject



32
33
34
# File 'app/models/spree/report_line_items/sales_total.rb', line 32

def promo_total
  record.display_promo_total
end

#shipment_totalObject



40
41
42
# File 'app/models/spree/report_line_items/sales_total.rb', line 40

def shipment_total
  record.display_shipping_cost
end

#tax_totalObject



44
45
46
# File 'app/models/spree/report_line_items/sales_total.rb', line 44

def tax_total
  record.display_tax_total
end

#totalObject



28
29
30
# File 'app/models/spree/report_line_items/sales_total.rb', line 28

def total
  Spree::Money.new(record.final_amount + record.shipping_cost, currency: record.currency)
end