diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 67f6cb46..eaf89c34 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -38,11 +38,11 @@ class ApplicationController < ActionController::Base end else # check for license file - if check_license - current_license(ENV["SX_PROVISION_URL"]) - else - redirect_to activate_path - end + # if check_license + # current_license(ENV["SX_PROVISION_URL"]) + # else + # redirect_to activate_path + # end end end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index db843aca..99c6d5f6 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -62,6 +62,9 @@ class HomeController < ApplicationController end def dashboard + # puts "date range =>" + # puts get_date_range_from_params + @shop = Shop.first today = DateTime.now.strftime('%Y-%m-%d') @@ -162,4 +165,20 @@ class HomeController < ApplicationController redirect_to reports_dailysale_index_path end end + + def get_date_range_from_params + from = params[:from] + to = params[:to] + + if from.present? && to.present? + f_date = DateTime.parse(from) + t_date = DateTime.parse(to) + f_time = Time.mktime(f_date.year,f_date.month,f_date.day,f_date.hour,f_date.min,f_date.sec) + t_time = Time.mktime(t_date.year,t_date.month,t_date.day,t_date.hour,t_date.min,t_date.sec) + from = f_time.beginning_of_day.utc.getlocal + to = t_time.end_of_day.utc.getlocal + end + + return from, to + end end diff --git a/app/views/home/dashboard.html.erb b/app/views/home/dashboard.html.erb index f935522b..d1a13775 100755 --- a/app/views/home/dashboard.html.erb +++ b/app/views/home/dashboard.html.erb @@ -67,11 +67,21 @@ -