Merge branch 'r-1902001-01' of gitlab.com:code2lab/SXRestaurant into r-1902001-01
This commit is contained in:
0
Can't open membership server }
Normal file
0
Can't open membership server }
Normal file
@@ -1,6 +1,6 @@
|
|||||||
class Crm::CustomersController < BaseCrmController
|
class Crm::CustomersController < BaseCrmController
|
||||||
load_and_authorize_resource except: [:create]
|
load_and_authorize_resource except: [:create]
|
||||||
before_action :set_crm_customer, only: [:show, :edit, :update, :destroy]
|
before_action :set_crm_customer, only: [:show, :edit, :update, :destroy,:sync]
|
||||||
|
|
||||||
# GET /crm/customers
|
# GET /crm/customers
|
||||||
# GET /crm/customers.json
|
# GET /crm/customers.json
|
||||||
@@ -8,6 +8,7 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
filter = params[:filter]
|
filter = params[:filter]
|
||||||
filter_card_no = params[:filter_card_no]
|
filter_card_no = params[:filter_card_no]
|
||||||
type = params[:type]
|
type = params[:type]
|
||||||
|
@customer_update_phone_email =false
|
||||||
if filter_card_no==""
|
if filter_card_no==""
|
||||||
@crm_customers = Customer.all
|
@crm_customers = Customer.all
|
||||||
elsif !filter_card_no.nil?
|
elsif !filter_card_no.nil?
|
||||||
@@ -16,25 +17,44 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
@crm_customers = Customer.all
|
@crm_customers = Customer.all
|
||||||
else
|
else
|
||||||
@crm_customers = Customer.search(filter)
|
@crm_customers = Customer.search(filter)
|
||||||
|
# paymal_customer = Customer.search_paypar_account_no(filter)
|
||||||
# search account no from paypar
|
# search account no from paypar
|
||||||
if !@crm_customers.present? && type == "card"
|
if type == "card"
|
||||||
response = Customer.search_paypar_account_no(filter)
|
|
||||||
if response["status"] == true
|
response = Customer.search_paypar_account_no(filter)
|
||||||
@crm_customers = Customer.new
|
if !@crm_customers.present?
|
||||||
@crm_customers.name = response["customer_data"]["name"]
|
if response["status"] == true
|
||||||
@crm_customers.contact_no = response["customer_data"]["phone"]
|
@crm_customers = Customer.new
|
||||||
@crm_customers.email = response["customer_data"]["email"]
|
@crm_customers.name = response["customer_data"]["name"]
|
||||||
@crm_customers.date_of_birth = response["customer_data"]["DOB"]
|
@crm_customers.contact_no = response["customer_data"]["phone"]
|
||||||
@crm_customers.nrc_no = response["customer_data"]["NRC"]
|
@crm_customers.email = response["customer_data"]["email"]
|
||||||
@crm_customers.address = response["customer_data"]["address"]
|
@crm_customers.date_of_birth = response["customer_data"]["DOB"]
|
||||||
@crm_customers.card_no = response["customer_data"]["customer_card_no"]
|
@crm_customers.nrc_no = response["customer_data"]["NRC"]
|
||||||
@crm_customers.paypar_account_no = filter
|
@crm_customers.address = response["customer_data"]["address"]
|
||||||
@crm_customers.membership_id = response["customer_data"]["id"]
|
@crm_customers.card_no = response["customer_data"]["customer_card_no"]
|
||||||
@crm_customers.membership_type = response["customer_data"]["member_group_id"]
|
@crm_customers.paypar_account_no = filter
|
||||||
@crm_customers.customer_type = "Dinein"
|
@crm_customers.membership_id = response["customer_data"]["id"]
|
||||||
@crm_customers.tax_profiles = ["1", "2"]
|
@crm_customers.membership_type = response["customer_data"]["member_group_id"]
|
||||||
@crm_customers.save
|
@crm_customers.customer_type = "Dinein"
|
||||||
@crm_customers = Customer.search(filter)
|
@crm_customers.tax_profiles = ["1", "2"]
|
||||||
|
@crm_customers.save
|
||||||
|
@crm_customers = Customer.search(filter)
|
||||||
|
flash[:notice]='Customer was successfully created.'
|
||||||
|
else
|
||||||
|
flash[:error]=response["message"]
|
||||||
|
end
|
||||||
|
else
|
||||||
|
@crm_customers.each do |customer|
|
||||||
|
if customer.contact_no != response["customer_data"]["phone"]
|
||||||
|
@customer_update_phone_email =true
|
||||||
|
end
|
||||||
|
if customer.email != response["customer_data"]["email"]
|
||||||
|
@customer_update_phone_email =true
|
||||||
|
end
|
||||||
|
if customer.name != response["customer_data"]["name"]
|
||||||
|
@customer_update_phone_email =true
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -69,6 +89,7 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
# if flash["errors"]
|
# if flash["errors"]
|
||||||
# @crm_customer.valid?
|
# @crm_customer.valid?
|
||||||
# end
|
# end
|
||||||
|
# puts @crm_customers.to_json
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
format.json { render json: @crm_customers }
|
format.json { render json: @crm_customers }
|
||||||
@@ -120,7 +141,91 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
def edit
|
def edit
|
||||||
@customer = Customer.find(params[:id])
|
@customer = Customer.find(params[:id])
|
||||||
end
|
end
|
||||||
|
def sync
|
||||||
|
@customer = Customer.find(params[:id])
|
||||||
|
respond_to do |format|
|
||||||
|
name = @customer.name
|
||||||
|
phone = @customer.contact_no
|
||||||
|
email = @customer.email
|
||||||
|
dob = @customer.date_of_birth
|
||||||
|
address = @customer.address
|
||||||
|
nrc = @customer.nrc_no
|
||||||
|
card_no = @customer.card_no
|
||||||
|
paypar_account_no = @customer.paypar_account_no
|
||||||
|
id = @crm_customer.membership_id
|
||||||
|
member_group_id = @customer.membership_type
|
||||||
|
if !id.present? && !member_group_id.nil?
|
||||||
|
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||||
|
memberaction = MembershipAction.find_by_membership_type("create_membership_customer")
|
||||||
|
merchant_uid = memberaction.merchant_account_id.to_s
|
||||||
|
auth_token = memberaction.auth_token.to_s
|
||||||
|
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||||
|
|
||||||
|
member_params = { name: name,phone: phone,email: email,
|
||||||
|
dob: dob,address: address,nrc:nrc,card_no:card_no,
|
||||||
|
member_group_id: member_group_id,
|
||||||
|
id:id,
|
||||||
|
merchant_uid:merchant_uid,auth_token:auth_token}.to_json
|
||||||
|
|
||||||
|
# Check for paypar account exists
|
||||||
|
# if paypar_account_no != nil || paypar_account_no != ''
|
||||||
|
if paypar_account_no.present?
|
||||||
|
member_params = { name: name,phone: phone,email: email,
|
||||||
|
dob: dob,address: address,nrc:nrc,card_no:card_no,
|
||||||
|
paypar_account_no: paypar_account_no,
|
||||||
|
member_group_id: member_group_id,
|
||||||
|
id:id,
|
||||||
|
merchant_uid:merchant_uid,auth_token:auth_token}.to_json
|
||||||
|
end
|
||||||
|
|
||||||
|
begin
|
||||||
|
response = HTTParty.post(url,
|
||||||
|
:body => member_params,
|
||||||
|
:headers => {
|
||||||
|
'Content-Type' => 'application/json',
|
||||||
|
'Accept' => 'application/json; version=3'
|
||||||
|
},
|
||||||
|
:timeout => 10
|
||||||
|
)
|
||||||
|
rescue Net::OpenTimeout
|
||||||
|
response = { status: false }
|
||||||
|
|
||||||
|
rescue OpenURI::HTTPError
|
||||||
|
response = { status: false}
|
||||||
|
|
||||||
|
rescue SocketError
|
||||||
|
response = { status: false}
|
||||||
|
end
|
||||||
|
customer = Customer.find(@crm_customer.customer_id)
|
||||||
|
Rails.logger.debug "--------Sync Member response -------"
|
||||||
|
Rails.logger.debug response.to_json
|
||||||
|
if response["status"] == true
|
||||||
|
|
||||||
|
status = customer.update_attributes(membership_id: response["customer_datas"]["id"],membership_type:member_group_id )
|
||||||
|
|
||||||
|
format.html { redirect_to crm_customers_path }
|
||||||
|
flash[:member_notice] ='Member was successfully synced'
|
||||||
|
else
|
||||||
|
# Check membership id and bind to user
|
||||||
|
if response["membership_id"] != nil
|
||||||
|
status = customer.update_attributes(membership_id: response["membership_id"],membership_type:member_group_id )
|
||||||
|
format.html { redirect_to crm_customers_path }
|
||||||
|
flash[:member_notice] ='Member was successfully synced'
|
||||||
|
else
|
||||||
|
status = customer.update_attributes(membership_type:member_group_id)
|
||||||
|
end
|
||||||
|
# When paypar account no not exist in paypar
|
||||||
|
if response["message"] == "Account does not exist."
|
||||||
|
customer.destroy
|
||||||
|
format.html { redirect_to crm_customers_path }
|
||||||
|
flash[:member_error] ='Member cannot created.Invalid Account.'
|
||||||
|
end
|
||||||
|
format.html { redirect_to crm_customers_path }
|
||||||
|
flash[:member_error] =response["message"]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
# POST /crm/customers
|
# POST /crm/customers
|
||||||
# POST /crm/customers.json
|
# POST /crm/customers.json
|
||||||
def create
|
def create
|
||||||
@@ -196,9 +301,11 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
status = customer.update_attributes(membership_id: response["customer_datas"]["id"],membership_type:member_group_id )
|
status = customer.update_attributes(membership_id: response["customer_datas"]["id"],membership_type:member_group_id )
|
||||||
|
|
||||||
if params[:sale_id]
|
if params[:sale_id]
|
||||||
format.html { redirect_to '/origami/'+params[:sale_id]+'/'+params[:type]+'/customers/'+params[:page], notice: 'Customer was successfully created.' }
|
format.html { redirect_to '/origami/'+params[:sale_id]+'/'+params[:type]+'/customers/'+params[:page] }
|
||||||
|
flash[:member_notice]='Member was successfully created.'
|
||||||
else
|
else
|
||||||
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created'}
|
format.html { redirect_to crm_customers_path }
|
||||||
|
flash[:member_notice]='Member was successfully created.'
|
||||||
end
|
end
|
||||||
# format.json { render :index, status: :created, location: @crm_customers }
|
# format.json { render :index, status: :created, location: @crm_customers }
|
||||||
else
|
else
|
||||||
@@ -207,24 +314,28 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
# Check membership id and bind to user
|
# Check membership id and bind to user
|
||||||
if response["membership_id"] != nil
|
if response["membership_id"] != nil
|
||||||
status = customer.update_attributes(membership_id: response["membership_id"],membership_type:member_group_id )
|
status = customer.update_attributes(membership_id: response["membership_id"],membership_type:member_group_id )
|
||||||
|
format.html { redirect_to crm_customers_path }
|
||||||
|
flash[:member_notice]='Member was successfully created.'
|
||||||
else
|
else
|
||||||
status = customer.update_attributes(membership_type:member_group_id)
|
status = customer.update_attributes(membership_type:member_group_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
# When paypar account no not exist in paypar
|
# When paypar account no not exist in paypar
|
||||||
if response["message"] == "Account has not exist."
|
if response["message"] == "Account does not exist."
|
||||||
customer.destroy
|
customer.destroy
|
||||||
if params[:sale_id]
|
if params[:sale_id]
|
||||||
format.html { redirect_to '/origami/'+params[:sale_id]+'/'+params[:type]+'/customers/'+params[:page], notice: 'Customer cannot created.' + response["message"]}
|
format.html { redirect_to '/origami/'+params[:sale_id]+'/'+params[:type]+'/customers/'+params[:page] }
|
||||||
|
flash[:member_error]='Member cannot created.Invalid Account.'
|
||||||
else
|
else
|
||||||
format.html { redirect_to crm_customers_path, notice: 'Customer cannot created.' + response["message"] }
|
format.html { redirect_to crm_customers_path }
|
||||||
|
flash[:member_error]='Member cannot created.Invalid Account.'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if params[:sale_id]
|
if params[:sale_id]
|
||||||
format.html { redirect_to '/origami/'+params[:sale_id]+'/'+params[:type]+'/customers/'+params[:page], notice: 'Customer was successfully created.' + response["message"]}
|
format.html { redirect_to '/origami/'+params[:sale_id]+'/'+params[:type]+'/customers/'+params[:page] }
|
||||||
|
flash[:member_notice]='Member was successfully created.' + response["message"]
|
||||||
else
|
else
|
||||||
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created.' }
|
format.html { redirect_to crm_customers_path }
|
||||||
|
# flash[:member_notice]='Member was successfully created.'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@@ -333,16 +444,19 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
|
|
||||||
status = customer.update_attributes(membership_id: response["customer_datas"]["id"],membership_type:member_group_id )
|
status = customer.update_attributes(membership_id: response["customer_datas"]["id"],membership_type:member_group_id )
|
||||||
|
|
||||||
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully updated'}
|
format.html { redirect_to crm_customers_path }
|
||||||
|
flash[:member_notice]='Member was successfully updated'
|
||||||
else
|
else
|
||||||
# Check membership id and bind to user
|
# Check membership id and bind to user
|
||||||
if response["membership_id"] != nil
|
if response["membership_id"] != nil
|
||||||
status = customer.update_attributes(membership_id: response["membership_id"],membership_type:member_group_id )
|
status = customer.update_attributes(membership_id: response["membership_id"],membership_type:member_group_id )
|
||||||
|
format.html { redirect_to crm_customers_path }
|
||||||
|
flash[:member_notice]='Member was successfully updated'
|
||||||
else
|
else
|
||||||
status = customer.update_attributes(membership_type:member_group_id)
|
status = customer.update_attributes(membership_type:member_group_id)
|
||||||
|
format.html { redirect_to crm_customers_path }
|
||||||
|
flash[:member_error]=response["message"]
|
||||||
end
|
end
|
||||||
|
|
||||||
format.html { redirect_to crm_customers_path, notice: response["error"] }
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||||
@@ -395,7 +509,8 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
else
|
else
|
||||||
status = customer.update_attributes(membership_type:member_group_id )
|
status = customer.update_attributes(membership_type:member_group_id )
|
||||||
end
|
end
|
||||||
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully updated.' }
|
format.html { redirect_to crm_customers_path }
|
||||||
|
flash[:member_notice] ='Member was successfully updated.'
|
||||||
format.json { render :show, status: :ok, location: @crm_customer }
|
format.json { render :show, status: :ok, location: @crm_customer }
|
||||||
else
|
else
|
||||||
customer = Customer.find(@crm_customer.customer_id)
|
customer = Customer.find(@crm_customer.customer_id)
|
||||||
@@ -405,7 +520,8 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
else
|
else
|
||||||
status = customer.update_attributes(membership_type:member_group_id )
|
status = customer.update_attributes(membership_type:member_group_id )
|
||||||
end
|
end
|
||||||
format.html { redirect_to crm_customers_path, notice: response["message"] }
|
format.html { redirect_to crm_customers_path }
|
||||||
|
flash[:member_error] =response["message"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@@ -438,6 +554,23 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def customer_update_phone_email
|
||||||
|
@customer = Customer.find(params[:id])
|
||||||
|
response = Customer.search_paypar_account_no(@customer.paypar_account_no)
|
||||||
|
if response["status"] == true
|
||||||
|
@customer.name =response["customer_data"]["name"]
|
||||||
|
@customer.contact_no =response["customer_data"]["phone"]
|
||||||
|
@customer.email =response["customer_data"]["email"]
|
||||||
|
@customer.save
|
||||||
|
respond_to do |format|
|
||||||
|
format.html { redirect_to crm_customers_path }
|
||||||
|
flash[:member_notice]='Membership was successfully updated'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
# Use callbacks to share common setup or constraints between actions.
|
# Use callbacks to share common setup or constraints between actions.
|
||||||
def set_crm_customer
|
def set_crm_customer
|
||||||
@@ -452,3 +585,4 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,26 @@ class Settings::MenuItemAttributesController < ApplicationController
|
|||||||
# DELETE /settings/menu_item_attributes/1
|
# DELETE /settings/menu_item_attributes/1
|
||||||
# DELETE /settings/menu_item_attributes/1.json
|
# DELETE /settings/menu_item_attributes/1.json
|
||||||
def destroy
|
def destroy
|
||||||
@settings_menu_item_attribute.destroy
|
item_attribute_id =@settings_menu_item_attribute.id
|
||||||
|
item_attribute_id_string=""+item_attribute_id.to_s+""
|
||||||
|
if @settings_menu_item_attribute.destroy
|
||||||
|
menu_items =MenuItem.all
|
||||||
|
menu_items.each do |item|
|
||||||
|
if item.item_attributes.include?(item_attribute_id)
|
||||||
|
item_update =item.item_attributes.reject { |i| i == item_attribute_id }
|
||||||
|
item.item_code =item.item_code
|
||||||
|
item.item_attributes =item_update
|
||||||
|
item.save
|
||||||
|
end
|
||||||
|
if item.item_attributes.include?(item_attribute_id_string)
|
||||||
|
item_update =item.item_attributes.reject { |i| i == item_attribute_id_string }
|
||||||
|
item.item_code =item.item_code
|
||||||
|
item.item_attributes =item_update
|
||||||
|
item.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
# @settings_menu_item_attribute.destroy
|
||||||
flash[:notice] = 'Menu item attribute was successfully destroyed.'
|
flash[:notice] = 'Menu item attribute was successfully destroyed.'
|
||||||
render :json => {:status=> "Success", :url => settings_menu_item_attributes_path }.to_json
|
render :json => {:status=> "Success", :url => settings_menu_item_attributes_path }.to_json
|
||||||
# respond_to do |format|
|
# respond_to do |format|
|
||||||
|
|||||||
@@ -55,7 +55,25 @@ class Settings::MenuItemOptionsController < ApplicationController
|
|||||||
# DELETE /settings/menu_item_options/1
|
# DELETE /settings/menu_item_options/1
|
||||||
# DELETE /settings/menu_item_options/1.json
|
# DELETE /settings/menu_item_options/1.json
|
||||||
def destroy
|
def destroy
|
||||||
@settings_menu_item_option.destroy
|
item_option_id =@settings_menu_item_option.id
|
||||||
|
item_option_id_string=""+item_option_id.to_s+""
|
||||||
|
if @settings_menu_item_option.destroy
|
||||||
|
menu_items =MenuItem.all
|
||||||
|
menu_items.each do |item|
|
||||||
|
if item.item_options.include?(item_option_id)
|
||||||
|
item_update =item.item_options.reject { |i| i == item_option_id }
|
||||||
|
item.item_code =item.item_code
|
||||||
|
item.item_options =item_update
|
||||||
|
item.save
|
||||||
|
end
|
||||||
|
if item.item_options.include?(item_option_id_string)
|
||||||
|
item_update =item.item_options.reject { |i| i == item_option_id_string }
|
||||||
|
item.item_code =item.item_code
|
||||||
|
item.item_options =item_update
|
||||||
|
item.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
flash[:notice] = 'Menu item option was successfully destroyed.'
|
flash[:notice] = 'Menu item option was successfully destroyed.'
|
||||||
render :json => {:status=> "Success", :url => settings_menu_item_options_path }.to_json
|
render :json => {:status=> "Success", :url => settings_menu_item_options_path }.to_json
|
||||||
# respond_to do |format|
|
# respond_to do |format|
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ class Settings::SimpleMenuItemsController < ApplicationController
|
|||||||
@settings_menu_item.item_sets = sets
|
@settings_menu_item.item_sets = sets
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@settings_menu_item.menu_category_id = params[:menu_category_id]
|
@settings_menu_item.menu_category_id = params[:menu_category_id]
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
|||||||
@@ -178,7 +178,8 @@ class SalePayment < ApplicationRecord
|
|||||||
def self.redeem(paypar_url,token,membership_id,received_amount,sale_id)
|
def self.redeem(paypar_url,token,membership_id,received_amount,sale_id)
|
||||||
# membership_actions_data = MembershipAction.find_by_membership_type("redeem");
|
# membership_actions_data = MembershipAction.find_by_membership_type("redeem");
|
||||||
membership_actions_data = PaymentMethodSetting.find_by_payment_method("Redeem")
|
membership_actions_data = PaymentMethodSetting.find_by_payment_method("Redeem")
|
||||||
|
puts "This is membership_actions_data"
|
||||||
|
puts membership_actions_data.to_json
|
||||||
if !membership_actions_data.nil?
|
if !membership_actions_data.nil?
|
||||||
|
|
||||||
url = paypar_url.to_s + membership_actions_data.gateway_url.to_s
|
url = paypar_url.to_s + membership_actions_data.gateway_url.to_s
|
||||||
|
|||||||
@@ -9,12 +9,27 @@
|
|||||||
</span>
|
</span>
|
||||||
</ul>
|
</ul>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<div class="row clearfix">
|
<div class="row clearfix">
|
||||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="body">
|
<div class="body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||||
|
<% if flash[:member_notice] %>
|
||||||
|
<div class="alert bg-green alert-dismissible" role="alert">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
|
<%= flash[:member_notice] %>
|
||||||
|
</div>
|
||||||
|
<% elsif flash[:member_error] %>
|
||||||
|
<div class="alert bg-red alert-dismissible" role="alert">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
|
<%= flash[:member_error] %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row p-l-20 p-t-20">
|
<div class="row p-l-20 p-t-20">
|
||||||
|
|
||||||
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||||
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
|
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
|
||||||
<div class="row clearfix">
|
<div class="row clearfix">
|
||||||
@@ -47,6 +62,7 @@
|
|||||||
<%end %>
|
<%end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||||
<%= paginate @crm_customers %>
|
<%= paginate @crm_customers %>
|
||||||
@@ -107,6 +123,12 @@
|
|||||||
</td>
|
</td>
|
||||||
<td><%= crm_customer.card_no rescue '-' %></td>
|
<td><%= crm_customer.card_no rescue '-' %></td>
|
||||||
<td>
|
<td>
|
||||||
|
<% if crm_customer.membership_id.nil? && !crm_customer.membership_type.nil? && !crm_customer.membership_type =="" && !crm_customer.paypar_account_no =="" && !crm_customer.paypar_account_no.nil? %>
|
||||||
|
<%= link_to t("views.btn.sync"), crm_customer_sync_path(crm_customer), :class => "btn btn-md bg-green waves-effect" %>
|
||||||
|
<% end %>
|
||||||
|
<% if @customer_update_phone_email %>
|
||||||
|
<%= link_to t("views.btn.update"), crm_customer_update_phone_email_path(crm_customer), :class => "btn btn-md bg-green waves-effect" %>
|
||||||
|
<% end %>
|
||||||
<%= link_to t("views.btn.show"), crm_customer_path(crm_customer), :class => "btn btn-md bg-blue waves-effect" %>
|
<%= link_to t("views.btn.show"), crm_customer_path(crm_customer), :class => "btn btn-md bg-blue waves-effect" %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -48,16 +48,16 @@
|
|||||||
<%
|
<%
|
||||||
if type == "notice"
|
if type == "notice"
|
||||||
color = "alert-success"
|
color = "alert-success"
|
||||||
elsif type == "error"
|
end
|
||||||
|
if type == "error"
|
||||||
color = "alert-danger"
|
color = "alert-danger"
|
||||||
else
|
|
||||||
color = "bg-black"
|
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
|
<% if flash["error"] || flash["notice"]%>
|
||||||
<p id="notify_message" class="hidden" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
|
<p id="notify_message" class="hidden" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
|
||||||
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
|
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
|
||||||
</p>
|
</p>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
|
|||||||
@@ -358,6 +358,8 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
namespace :crm do
|
namespace :crm do
|
||||||
root "home#index"
|
root "home#index"
|
||||||
resources :customers
|
resources :customers
|
||||||
|
get "/customers/:id/sync" => "customers#sync", as:"customer_sync"
|
||||||
|
get "/customers/:id/customer_update_phone_email" => "customers#customer_update_phone_email", as:"customer_update_phone_email"
|
||||||
resources :dining_queues
|
resources :dining_queues
|
||||||
post "update_booking", to: "bookings#update_booking", as: "update_booking" #assign and cancel
|
post "update_booking", to: "bookings#update_booking", as: "update_booking" #assign and cancel
|
||||||
get '/print/:id', to: "home#print_order" #print order for crm
|
get '/print/:id', to: "home#print_order" #print order for crm
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ queue_no_printer=PrintSetting.create({name: "Queue No", unique_code: "QueueNoPdf
|
|||||||
|
|
||||||
zone = Zone.create({id:1, name: "H1", is_active:true, created_by: "SYSTEM DEFAULT"})
|
zone = Zone.create({id:1, name: "H1", is_active:true, created_by: "SYSTEM DEFAULT"})
|
||||||
|
|
||||||
member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "https://staging.membership.paypar.ws",merchant_account_id:"pZBHXEFbGNj/G"})
|
member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "https://staging.membership.paymal.ws",merchant_account_id:"vWSsseoZCzxd6xcNf_uS"})
|
||||||
|
|
||||||
member_actions= MembershipAction.create([{membership_type:"get_account_balance",is_active:1,gateway_url:"/api/membership_campaigns/get_correspond_account_data",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G"},
|
member_actions= MembershipAction.create([{membership_type:"get_account_balance",is_active:1,gateway_url:"/api/membership_campaigns/get_correspond_account_data",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G"},
|
||||||
{membership_type:"redeem",is_active:1,gateway_url:"/api/membership_campaigns/redeem",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G"},
|
{membership_type:"redeem",is_active:1,gateway_url:"/api/membership_campaigns/redeem",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"pZBHXEFbGNj/G"},
|
||||||
|
|||||||
0
member_params,
Normal file
0
member_params,
Normal file
Reference in New Issue
Block a user