Class: Spree::ReportLineItems::SalesTotal
Instance Attribute Summary
#record, #report
Instance Method Summary
collapse
csv_headers, headers, #to_csv
Instance Method Details
#date ⇒ Object
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
|
#order ⇒ Object
20
21
22
|
# File 'app/models/spree/report_line_items/sales_total.rb', line 20
def order
record.order.number
end
|
#pre_tax_amount ⇒ Object
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
|
#product ⇒ Object
24
25
26
|
# File 'app/models/spree/report_line_items/sales_total.rb', line 24
def product
record.variant.descriptive_name
end
|
32
33
34
|
# File 'app/models/spree/report_line_items/sales_total.rb', line 32
def promo_total
record.display_promo_total
end
|
#shipment_total ⇒ Object
40
41
42
|
# File 'app/models/spree/report_line_items/sales_total.rb', line 40
def shipment_total
record.display_shipping_cost
end
|
#tax_total ⇒ Object
44
45
46
|
# File 'app/models/spree/report_line_items/sales_total.rb', line 44
def tax_total
record.display_tax_total
end
|
#total ⇒ Object
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
|