change query in sale item report

This commit is contained in:
phyusin
2018-01-05 13:33:23 +06:30
parent 09db9656c5
commit ae6caefaa0
3 changed files with 9 additions and 7 deletions

View File

@@ -25,7 +25,7 @@ class Reports::SaleitemController < BaseReportController
@sale_data.each {|acc_cate| @account_cate_count[acc_cate.account_id] += 1}
@menu_cate_count = Hash.new {|hash, key| hash[key] = 0}
@sale_data.each {|cate| @menu_cate_count[cate.menu_category_id] += 1}
@sale_data.each {|cate| @menu_cate_count[cate.account_id] += 1}
@totalByAccount = Hash.new {|hash, key| hash[key] = 0}
@@ -64,6 +64,9 @@ class Reports::SaleitemController < BaseReportController
date_arr.push(str)
end
@totalByAccount = Hash.new {|hash, key| hash[key] = 0}
@sale_data.each {|acc| @totalByAccount[acc.account_id] += acc.grand_total}
out = {:status => 'ok', :message => date_arr}
respond_to do |format|