update crm
This commit is contained in:
@@ -77,6 +77,7 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
dob = customer_params[:date_of_birth]
|
dob = customer_params[:date_of_birth]
|
||||||
address = customer_params[:address]
|
address = customer_params[:address]
|
||||||
nrc = customer_params[:nrc_no]
|
nrc = customer_params[:nrc_no]
|
||||||
|
card_no = customer_params[:card_no]
|
||||||
member_group_id = params[:member_group_id]
|
member_group_id = params[:member_group_id]
|
||||||
|
|
||||||
if !member_group_id.nil?
|
if !member_group_id.nil?
|
||||||
@@ -87,8 +88,9 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||||
|
|
||||||
begin
|
begin
|
||||||
response = HTTParty.post(url, :body => { name: name,phone: phone,email: email,
|
response = HTTParty.post(url,
|
||||||
dob: dob,address: address,nrc:nrc,
|
:body => {name: name,phone: phone,email: email,
|
||||||
|
dob: dob,address: address,nrc:nrc,card_no:card_no,
|
||||||
member_group_id: member_group_id,
|
member_group_id: member_group_id,
|
||||||
merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
@@ -149,10 +151,12 @@ end
|
|||||||
dob = customer_params[:date_of_birth]
|
dob = customer_params[:date_of_birth]
|
||||||
address = customer_params[:address]
|
address = customer_params[:address]
|
||||||
nrc = customer_params[:nrc_no]
|
nrc = customer_params[:nrc_no]
|
||||||
|
card_no = customer_params[:card_no]
|
||||||
id = @crm_customer.membership_id
|
id = @crm_customer.membership_id
|
||||||
member_group_id = params[:member_group_id]
|
member_group_id = params[:member_group_id]
|
||||||
|
|
||||||
if id.nil? && !member_group_id.nil?
|
if id.nil? && !member_group_id.nil?
|
||||||
|
|
||||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||||
memberaction = MembershipAction.find_by_membership_type("create_membership_customer")
|
memberaction = MembershipAction.find_by_membership_type("create_membership_customer")
|
||||||
merchant_uid = memberaction.merchant_account_id.to_s
|
merchant_uid = memberaction.merchant_account_id.to_s
|
||||||
@@ -160,9 +164,10 @@ end
|
|||||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||||
|
|
||||||
begin
|
begin
|
||||||
response = HTTParty.post(url, :body => { name: name,phone: phone,email: email,
|
response = HTTParty.post(url,
|
||||||
|
:body => { name: name,phone: phone,email: email,
|
||||||
dob: dob,address: address,nrc:nrc,
|
dob: dob,address: address,nrc:nrc,
|
||||||
member_group_id: member_group_id,
|
card_no:card_no,member_group_id: member_group_id,
|
||||||
merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
@@ -185,14 +190,16 @@ end
|
|||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||||
memberaction = MembershipAction.find_by_membership_type("update_membership_customer")
|
memberaction = MembershipAction.find_by_membership_type("update_membership_customer")
|
||||||
merchant_uid = memberaction.merchant_account_id.to_s
|
merchant_uid = memberaction.merchant_account_id.to_s
|
||||||
auth_token = memberaction.auth_token.to_s
|
auth_token = memberaction.auth_token.to_s
|
||||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||||
begin
|
begin
|
||||||
response = HTTParty.post(url, :body => { name: name,phone: phone,email: email,
|
response = HTTParty.post(url,
|
||||||
dob: dob,address: address,nrc:nrc,
|
:body => {name: name,phone: phone,email: email,
|
||||||
|
dob: dob,address: address,nrc:nrc,card_no:card_no,
|
||||||
id: id,member_group_id:member_group_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
id: id,member_group_id:member_group_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
|
|||||||
@@ -130,8 +130,10 @@ $(document).on('click',".customer_tr",function(){
|
|||||||
$('.selectpicker > option[value="'+data.membership_type+'"]').attr('selected','selected');
|
$('.selectpicker > option[value="'+data.membership_type+'"]').attr('selected','selected');
|
||||||
if (data.gender == 'Male') {
|
if (data.gender == 'Male') {
|
||||||
$('.male').prop( "checked", true )
|
$('.male').prop( "checked", true )
|
||||||
|
$('.female').prop( "checked", false )
|
||||||
}else{
|
}else{
|
||||||
$('.female').prop( "checked", true )
|
$('.female').prop( "checked", true )
|
||||||
|
$('.male').prop( "checked", false )
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data.salutation == 'Mr') {
|
if(data.salutation == 'Mr') {
|
||||||
@@ -152,7 +154,6 @@ $(document).on('click',".customer_tr",function(){
|
|||||||
|
|
||||||
$("#new_customer").attr('class', 'simple_form edit_customer');
|
$("#new_customer").attr('class', 'simple_form edit_customer');
|
||||||
var id = "edit_customer_"+customer_id;
|
var id = "edit_customer_"+customer_id;
|
||||||
alert(id)
|
|
||||||
$("#new_customer").attr('id', id);
|
$("#new_customer").attr('id', id);
|
||||||
|
|
||||||
$(".edit_customer").attr('id', id);
|
$(".edit_customer").attr('id', id);
|
||||||
|
|||||||
@@ -161,10 +161,10 @@
|
|||||||
<%= f.input :address, :class => "form-control col-md-6 address" %>
|
<%= f.input :address, :class => "form-control col-md-6 address" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<!-- <div class="form-group">
|
||||||
<label>Sr.No</label>
|
<label>Sr.No</label>
|
||||||
<input type="text" name="" value="<%=@count_customer%>" class="form-control" readonly="true">
|
<input type="text" name="" value="<%=@count_customer%>" class="form-control" readonly="true">
|
||||||
</div>
|
</div> -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Date Of Birth</label>
|
<label>Date Of Birth</label>
|
||||||
<%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%>
|
<%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%>
|
||||||
|
|||||||
@@ -129,8 +129,10 @@
|
|||||||
|
|
||||||
<div class="card-title row">
|
<div class="card-title row">
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
|
<%if @customer %>
|
||||||
<p class="hidden customer-id"><%= @customer.customer_id %></p>
|
<p class="hidden customer-id"><%= @customer.customer_id %></p>
|
||||||
<p>Customer : <%= @customer.name %></p>
|
<p>Customer : <%= @customer.name %></p>
|
||||||
|
<%end%>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -129,8 +129,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-title row customer_detail hide">
|
<div class="card-title row customer_detail hide">
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
|
<%if @customer %>
|
||||||
<p class="hidden customer-id"><%= @customer.customer_id %></p>
|
<p class="hidden customer-id"><%= @customer.customer_id %></p>
|
||||||
<p>Customer : <%= @customer.name %></p>
|
<p>Customer : <%= @customer.name %></p>
|
||||||
|
<%end%>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user