Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into sqa-1804-001
This commit is contained in:
@@ -186,6 +186,7 @@ Add Kitchen Role of Employee
|
||||
|
||||
Add Base URL for DOEMAL
|
||||
1) settings/lookups => { type:order_reservation, name: BaseURL, value:'{doemal url}' }
|
||||
2) settings/lookups => { type:order_reservation, name: Token, value:'{doemal token}' }
|
||||
|
||||
* ToDo list
|
||||
|
||||
|
||||
@@ -184,11 +184,11 @@ puts items_arr.to_json
|
||||
|
||||
@status, @sale = Sale.request_bill(@order,current_user,current_login_employee)
|
||||
# for second display
|
||||
# if ENV["SERVER_MODE"] != 'cloud'
|
||||
if ENV["SERVER_MODE"] != 'cloud'
|
||||
|
||||
ActionCable.server.broadcast "second_display_channel",data: @sale,status:"sale"
|
||||
|
||||
# end
|
||||
end
|
||||
result = {:status=> @status, :data => @sale }
|
||||
render :json => result.to_json
|
||||
end
|
||||
|
||||
@@ -220,11 +220,14 @@ class OrderReservation < ApplicationRecord
|
||||
|
||||
def self.send_status_to_ordering(url,ref_no,status)
|
||||
base_url = 'https://api.doemal.com'
|
||||
token = '3T-tnlYtFJ-5Z1vY6XQqxQ'
|
||||
order_reservation = Lookup.collection_of("order_reservation")
|
||||
if !order_reservation.empty?
|
||||
order_reservation.each do |order_reserve|
|
||||
if order_reserve[0] == 'BaseURL'
|
||||
base_url = order_reserve[1]
|
||||
elsif order_reserve[0] == 'Token'
|
||||
token = order_reserve[1]
|
||||
end
|
||||
end
|
||||
else
|
||||
@@ -234,11 +237,12 @@ class OrderReservation < ApplicationRecord
|
||||
Rails.logger.debug "Doemal URL" + base_url
|
||||
post_url = base_url + url
|
||||
|
||||
|
||||
begin
|
||||
response = HTTParty.post(post_url,
|
||||
:body => { id: ref_no, status: status}.to_json,
|
||||
:headers => {
|
||||
'Authorization' => 'Token token=3T-tnlYtFJ-5Z1vY6XQqxQ',
|
||||
'Authorization' => 'Token token='+token,
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json; version=3'
|
||||
}, :timeout => 10
|
||||
|
||||
Reference in New Issue
Block a user