This commit is contained in:
NyanLinHtut
2019-12-20 15:48:38 +06:30
parent 26edf23b46
commit 10c1ba12af
15 changed files with 709 additions and 100 deletions

View File

@@ -5,6 +5,9 @@ class Reports::HourlySaleitemController < BaseReportController
@account = Account.all
from, to = get_date_range_from_params
@start_time = params[:start_time]
@end_time = params[:end_time]
shift_sale_range = ''
shift = ''
@@ -24,9 +27,10 @@ class Reports::HourlySaleitemController < BaseReportController
end
end
filter = params[:filter]
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)
@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,filter,@start_time,@end_time)
@sale_taxes = Sale.get_separate_tax(shift_sale_range,shift,from,to,nil)
@@ -57,7 +61,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 }}
respond_to do |format|
format.html
format.xls