Class: Api::ReportsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/api/reports_controller.rb

Instance Method Summary collapse

Instance Method Details

#sales_totalObject



2
3
4
5
6
7
# File 'app/controllers/api/reports_controller.rb', line 2

def sales_total
 @search = Order.metasearch(params[:search])
  @item_total = @search.sum(:item_total)
    @adjustment_total = @search.sum(:adjustment_total)
    @sales_total = @search.sum(:total)
end