update crm layout

This commit is contained in:
Aung Myo
2017-06-09 11:55:50 +06:30
parent 35277ac000
commit e2e8045d0f
13 changed files with 98 additions and 85 deletions

View File

@@ -1,4 +1,4 @@
class Crm::BookingsController < ApplicationController
class Crm::BookingsController < BaseCrmController
def update_booking
booking = Booking.find(params[:booking_id])

View File

@@ -1,4 +1,4 @@
class Crm::CustomersController < ApplicationController
class Crm::CustomersController < BaseCrmController
before_action :set_crm_customer, only: [:show, :edit, :update, :destroy]
# GET /crm/customers
@@ -8,18 +8,17 @@ class Crm::CustomersController < ApplicationController
filter = params[:filter]
if filter.nil?
@crm_custome = Customer.order("name").page(params[:page])
@crm_customers = Customer.order("name").page(params[:page])
#@products = Product.order("name").page(params[:page]).per(5)
else
@crm_custome = Customer.where("name LIKE ?", "%#{filter}%").order("name").page(params[:page])
@crm_customers = Customer.where("name LIKE ?", "%#{filter}%").order("name").page(params[:page])
end
@crm_customers = Kaminari.paginate_array(@crm_custome).page(params[:page]).per(5)
#@crm_customers = Customer.all
@crm_customer = Customer.new
# @membership = Customer.get_member_group
# if @membership["status"] == true
# @member_group = @membership["data"]
# end
@membership = Customer.get_member_group
if @membership["status"] == true
@member_group = @membership["data"]
end
respond_to do |format|
format.html # index.html.erb
format.json { render json: @crm_customers }
@@ -74,6 +73,7 @@ class Crm::CustomersController < ApplicationController
if response["status"] == true
puts "hhhhhhhhhhhhhhhhhh"
puts params[:sale_id]
puts response.to_json
customer = Customer.find(@crm_customers.customer_id)
status = customer.update_attributes(membership_id: response["customer_datas"]["id"])
if params[:sale_id] != 0

View File

@@ -1,4 +1,4 @@
class Crm::DiningQueuesController < ApplicationController
class Crm::DiningQueuesController < BaseCrmController
before_action :set_dining_queue, only: [:show, :edit, :update, :destroy]
# GET /crm/dining_queues

View File

@@ -5,7 +5,8 @@ class Crm::HomeController < BaseCrmController
@customer = Customer.all
from = Time.now.beginning_of_day.utc
to = Time.now.end_of_day.utc
@queue = DiningQueue.where('created_at BETWEEN ? AND ?', from, to)
@queue = DiningQueue.where('created_at BETWEEN ? AND ?', from, to).order('queue_no ASC')
# .where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to)
end