update report

This commit is contained in:
Aung Myo
2017-07-01 11:10:08 +06:30
parent be781ff022
commit 40a2347c1b
4 changed files with 68 additions and 32 deletions

View File

@@ -34,7 +34,7 @@ class BaseReportController < ActionController::Base
to = params[:to]
day_ref = Time.now.utc.getlocal
if params[:report_type] == "daily_sale"
if params[:report_type] == "daily_sale" || params[:report_type] == "sale_item"
if from != "" && to != ""
@@ -86,9 +86,7 @@ class BaseReportController < ActionController::Base
else # end daily sale report
if period_type.to_i == 1
if params[:from] && params[:to]
if params[:from] != "" && params[:to] !=""
if params[:from] != "" && params[:to] !=""
f_date = DateTime.parse(params[:from])
t_date = DateTime.parse(params[:to])
@@ -99,8 +97,7 @@ class BaseReportController < ActionController::Base
else
from = day_ref.beginning_of_day.utc
to = day_ref.end_of_day.utc
end
end
end
else
case period.to_i
when PERIOD["today"]