menu alt name
This commit is contained in:
@@ -100,18 +100,22 @@ class Crm::CustomersController < BaseCrmController
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
},
|
||||
:timeout => 10
|
||||
:timeout => 100
|
||||
)
|
||||
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false}
|
||||
rescue HTTParty::Error
|
||||
response = {status: false, message: "Can't open embership server "}
|
||||
|
||||
rescue SocketError
|
||||
response = { status: false}
|
||||
end
|
||||
rescue Net::OpenTimeout
|
||||
|
||||
response = { status: false , message: "Can't open embership server "}
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false, message: "Can't open embership server "}
|
||||
|
||||
rescue SocketError
|
||||
response = { status: false, message: "Can't open embership server "}
|
||||
end
|
||||
if response["status"] == true
|
||||
customer = Customer.find(@crm_customers.customer_id)
|
||||
status = customer.update_attributes(membership_id: response["customer_datas"]["id"],membership_type:member_group_id )
|
||||
@@ -125,14 +129,14 @@ 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. '}
|
||||
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer was successfully created.' + response[:message]}
|
||||
else
|
||||
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created. ' }
|
||||
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created.' + response[:message] }
|
||||
end
|
||||
end
|
||||
else
|
||||
if params[:sale_id]
|
||||
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer was successfully created. '}
|
||||
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer was successfully created. noted'}
|
||||
else
|
||||
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created. ' }
|
||||
end
|
||||
@@ -231,7 +235,7 @@ end
|
||||
)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false}
|
||||
|
||||
|
||||
@@ -27,16 +27,19 @@ class Customer < ApplicationRecord
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
},
|
||||
:timeout => 10
|
||||
:timeout => 100
|
||||
)
|
||||
rescue HTTParty::Error
|
||||
response = {status: false, message: "Server Error"}
|
||||
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
response = { status: false , message: "Server Time out"}
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false}
|
||||
response = { status: false, message: "Can't connect server"}
|
||||
|
||||
rescue SocketError
|
||||
response = { status: false}
|
||||
response = { status: false, message: "Can't connect server"}
|
||||
end
|
||||
|
||||
return response;
|
||||
@@ -60,13 +63,13 @@ class Customer < ApplicationRecord
|
||||
:timeout => 10
|
||||
)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
|
||||
response = { status: false , message: "Server Time out"}
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false}
|
||||
response = { status: false, message: "Can't connect server"}
|
||||
|
||||
rescue SocketError
|
||||
response = { status: false}
|
||||
response = { status: false, message: "Can't connect server"}
|
||||
end
|
||||
|
||||
return response;
|
||||
|
||||
@@ -331,15 +331,15 @@ class SalePayment < ApplicationRecord
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
}, :timeout => 10)
|
||||
}, :timeout => 100)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
response = { status: false , message: "Server Time out"}
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false}
|
||||
response = { status: false, message: "Can't connect server"}
|
||||
|
||||
rescue SocketError
|
||||
response = { status: false}
|
||||
response = { status: false, message: "Can't connect server"}
|
||||
end
|
||||
return response
|
||||
# puts response.to_json
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<script>
|
||||
$('#close_cashier').on('click',function(){
|
||||
var amount = $('#closing_balance_amount').val();
|
||||
var shift_id = "<%= @shift.id %>"
|
||||
var shift_id = "<%= @shift.id rescue ""%>"
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_close_shift_path %>",
|
||||
data: "closing_balance="+ amount + "&shift_id="+ shift_id,
|
||||
|
||||
Reference in New Issue
Block a user