For Pull from master
This commit is contained in:
@@ -70,13 +70,11 @@ class License
|
||||
# For Local System
|
||||
def detail_with_local_file()
|
||||
renewal_date_str = read_license("renewable_date")
|
||||
|
||||
if check_expiring(renewal_date_str)
|
||||
# return for all ok
|
||||
return 1
|
||||
else
|
||||
has_license = verify_license()
|
||||
|
||||
if has_license
|
||||
# return for expiring
|
||||
return 2
|
||||
@@ -137,23 +135,27 @@ class License
|
||||
api_token = read_license_no_decrypt("api_token")
|
||||
@params = { query: {lookup_type: "application", api_token: api_token} }
|
||||
response = self.class.get("/verify", @params)
|
||||
@varified = response.parsed_response
|
||||
|
||||
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
|
||||
if (@varified["status"])
|
||||
if (!check_expired(@varified["renewable_date"]))
|
||||
return true
|
||||
end
|
||||
else
|
||||
delete_license_file
|
||||
end
|
||||
rescue SocketError => e
|
||||
Rails.logger.debug "In Socket errror"
|
||||
return true
|
||||
rescue => e
|
||||
@varified = response.parsed_response
|
||||
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
|
||||
if (@varified["status"])
|
||||
if (!check_expired(@varified["renewable_date"]))
|
||||
return true
|
||||
end
|
||||
else
|
||||
delete_license_file
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
# Check Expired before 30 days
|
||||
def check_expiring(renewal_date_str)
|
||||
if !renewal_date_str.empty?
|
||||
renewal_date = DateTime.parse(renewal_date_str)
|
||||
renewal_date = DateTime.parse(renewal_date_str)
|
||||
renewal_date > Date.today.advance(:days => 30)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<tr>
|
||||
<td><%= link_to booking.booking_id, transactions_booking_path(booking) %></td>
|
||||
<td><%= link_to booking.sale_id, transactions_sale_path(booking.sale_id) rescue '-' %></td>
|
||||
<td><%= booking.dining_facility.name %></td>
|
||||
<td><%= booking.dining_facility.name rescue '' %></td>
|
||||
<td><%= booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></td>
|
||||
<td><%= booking.checkout_at.utc.getlocal.strftime("%I:%M %p") rescue '-' %></td>
|
||||
<td><%= booking.checkin_by rescue '-' %></td>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<tr>
|
||||
<td><%= @booking.booking_id%></td>
|
||||
<td><%= link_to @booking.sale_id, transactions_sale_path(booking.sale_id) rescue '-' %></td>
|
||||
<td><%= @booking.dining_facility.name %></td>
|
||||
<td><%= @booking.dining_facility.name rescue '' %></td>
|
||||
<td><%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></td>
|
||||
<td><%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") rescue '-' %></td>
|
||||
<td><%= @booking.checkin_by rescue '-' %></td>
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
<tr>
|
||||
<td><%= link_to order.order_id, transactions_order_path(order) %></td>
|
||||
<td><%= @dining.type %>-<%= @dining.name %></td>
|
||||
<td><%if !@dining.nil? %> <%= @dining.type %>-<%= @dining.name %> <% else %> <% end %></td>
|
||||
<td><%= order.waiters %></td>
|
||||
<td><%= order.order_type %></td>
|
||||
<td><%= order.customer.name rescue '-' %></td>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><%= @dining.type %>-<%= @dining.name %></td>
|
||||
<td><%if !@dining.nil? %> <%= @dining.type %>-<%= @dining.name %> <% else %> <% end %></td>
|
||||
<td> <%= @order.waiters rescue '-' %> </td>
|
||||
<td><%= @order.order_type %></td>
|
||||
<td><%= @order.customer.name rescue '-' %></td>
|
||||
|
||||
15
config/license.yml
Normal file
15
config/license.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
iv_key: f3ICP0M2HJLIeXURn3yv5A==
|
||||
shop_name: sx_license_test3
|
||||
email: aungmyo.zaw@code2lab.com
|
||||
telephone: 0099404923
|
||||
fax: 49494949432
|
||||
address: Yangon
|
||||
dbhost: m4ZCds3ANyqjqCgZVSTfRQ==
|
||||
dbschema: +mvY73HAjWqMrby9Zu+tBg==
|
||||
dbusername: UO2rBxhoSfDEKutK2OEL4A==
|
||||
dbpassword: sVpy+Lj6i3MpT+CjoJrDOw==
|
||||
api_token: srTutEOCzphDFOXQqVWnZwQDTXiHdzwzY
|
||||
app_token: pSzbojYfXLNpSLmhdNTfLCtxfzeUahO
|
||||
plan_sku: +53eC6oiOsBRxtBgVjyULw==
|
||||
renewable_date: hon6p5jvfirTFniaFrH0qw==
|
||||
plan_name: eaMIWzHlTnljCEkE2oxoHg==
|
||||
Reference in New Issue
Block a user