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"]

View File

@@ -125,9 +125,9 @@ class Crm::CustomersController < BaseCrmController
else
# @crm_customers.destroy
if params[:sale_id]
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer was successfully created. But '}
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer was successfully created. '}
else
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created. But ' }
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created. ' }
end
end
else

View File

@@ -20,6 +20,7 @@ class Transactions::OrdersController < ApplicationController
format.json { render json: @orders }
end
end
def show
@order = Order.find(params[:id])