Class: Spree::SalesPerformanceReport::Result::Observation
Instance Attribute Summary
#date, #hour, #reportable_keys
Instance Method Summary
collapse
#day_name, #describes?, #hour_name, #initialize, #month_name, #to_h
build_from_hash, build_from_list, #initialize, observation_fields, #to_h
Instance Method Details
#cost_price ⇒ Object
13
14
15
|
# File 'app/reports/spree/sales_performance_report.rb', line 13
def cost_price
@cost_price.to_f
end
|
#profit_loss ⇒ Object
21
22
23
|
# File 'app/reports/spree/sales_performance_report.rb', line 21
def profit_loss
@profit_loss.to_f
end
|
#profit_loss_percent ⇒ Object
25
26
27
28
|
# File 'app/reports/spree/sales_performance_report.rb', line 25
def profit_loss_percent
return (profit_loss * 100 / cost_price).round(2) unless cost_price.zero?
0.0
end
|
30
31
32
|
# File 'app/reports/spree/sales_performance_report.rb', line 30
def promotion_discount
@promotion_discount.to_f
end
|
#sale_price ⇒ Object
17
18
19
|
# File 'app/reports/spree/sales_performance_report.rb', line 17
def sale_price
@sale_price.to_f
end
|