update report and inventory layout design
This commit is contained in:
@@ -2,18 +2,21 @@ class Reports::CommissionController < BaseReportController
|
||||
# authorize_resource :class => false
|
||||
|
||||
def index
|
||||
from_date = DateTime.now.beginning_of_day.utc.getlocal
|
||||
to_date = DateTime.now.end_of_day.utc.getlocal
|
||||
unless params[:daterange].blank?
|
||||
from_date = Date.parse(params[:daterange].split(' - ')[0]).beginning_of_day.utc.getlocal
|
||||
to_date = Date.parse(params[:daterange].split(' - ')[1]).end_of_day.utc.getlocal
|
||||
@daterange = params[:daterange]
|
||||
end
|
||||
# from_date = DateTime.now.beginning_of_day.utc.getlocal
|
||||
# to_date = DateTime.now.end_of_day.utc.getlocal
|
||||
# unless params[:daterange].blank?
|
||||
# from_date = Date.parse(params[:daterange].split(' - ')[0]).beginning_of_day.utc.getlocal
|
||||
# to_date = Date.parse(params[:daterange].split(' - ')[1]).end_of_day.utc.getlocal
|
||||
# @daterange = params[:daterange]
|
||||
# end
|
||||
from_date, to_date = get_date_range_from_params
|
||||
|
||||
commissioner = params[:commissioner].to_i
|
||||
@com_id = commissioner
|
||||
@commissioner = Commissioner.active.all
|
||||
|
||||
@transaction = ProductCommission.get_transaction(from_date, to_date, commissioner)
|
||||
|
||||
@from = from_date
|
||||
@to = to_date
|
||||
|
||||
|
||||
Reference in New Issue
Block a user