fixed hourly sale report

This commit is contained in:
NyanLinHtut
2019-10-09 10:05:46 +06:30
parent bcda6e98f0
commit 7c194f8438
3 changed files with 6 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ class Reports::DailysaleController < BaseReportController
@to = to
@payment_methods = PaymentMethodSetting.where("is_active='1'").pluck("payment_method")
# get printer info
@print_settings = PrintSetting.get_precision_delimiter()
respond_to do |format|

View File

@@ -27,8 +27,6 @@ class Reports::HourlySaleitemController < BaseReportController
account_type = params[:account_type]
@type = params[:sale_type]
@sale_data, @other_charges,@product, @discount_data , @cash_data , @card_data , @credit_data , @foc_data , @grand_total , @change_amount = Sale.get_by_hourly_items(shift_sale_range,shift, from, to, Sale::SALE_STATUS_COMPLETED,@type,account_type)
# logger.debug 'product>>>>>>>>>>>>>>>>>>>>>>>>>>'
# logger.debug @sale_data.group(:date_format)
@sale_taxes = Sale.get_separate_tax(shift_sale_range,shift,from,to,nil)
@@ -59,7 +57,7 @@ class Reports::HourlySaleitemController < BaseReportController
# @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