This commit is contained in:
Myat Zin Wai Maw
2019-08-30 14:03:48 +06:30
parent 67793b282e
commit f0be0d19a1
7 changed files with 52 additions and 47 deletions

View File

@@ -56,7 +56,10 @@ class Reports::HourlySaleitemController < BaseReportController
@shift_data = sh
end
end
# @hourly_total_qty = @sale_data.group_by {|s| s.date_format }.collect{|key,qty| {"date" => key , "total_qty" => qty.sum{|d| d.qty.to_i}}}
@hourly_total_qty = @sale_data.group_by(&:date_format).map { |k,v|{"date" => k , "total_qty" => v.count }}
puts @hourly_total_qty.to_json
respond_to do |format|
format.html
format.xls