From 40a2347c1ba69a3539013265235a069f8828958c Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Sat, 1 Jul 2017 11:10:08 +0630 Subject: [PATCH] update report --- app/controllers/base_report_controller.rb | 9 +- app/controllers/crm/customers_controller.rb | 4 +- .../transactions/orders_controller.rb | 1 + .../_shift_sale_report_filter.html.erb | 86 +++++++++++++------ 4 files changed, 68 insertions(+), 32 deletions(-) diff --git a/app/controllers/base_report_controller.rb b/app/controllers/base_report_controller.rb index 28ba5c2b..12eeccd2 100644 --- a/app/controllers/base_report_controller.rb +++ b/app/controllers/base_report_controller.rb @@ -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"] diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index d31ee280..2f5b25d2 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -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 diff --git a/app/controllers/transactions/orders_controller.rb b/app/controllers/transactions/orders_controller.rb index 8303780f..de4be3c3 100644 --- a/app/controllers/transactions/orders_controller.rb +++ b/app/controllers/transactions/orders_controller.rb @@ -20,6 +20,7 @@ class Transactions::OrdersController < ApplicationController format.json { render json: @orders } end end + def show @order = Order.find(params[:id]) diff --git a/app/views/reports/saleitem/_shift_sale_report_filter.html.erb b/app/views/reports/saleitem/_shift_sale_report_filter.html.erb index 7f95b6b9..c57c8be9 100644 --- a/app/views/reports/saleitem/_shift_sale_report_filter.html.erb +++ b/app/views/reports/saleitem/_shift_sale_report_filter.html.erb @@ -116,24 +116,6 @@ <% end %> - - - \ No newline at end of file