Update
This commit is contained in:
@@ -103,6 +103,12 @@ class Crm::CustomersController < BaseCrmController
|
||||
)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false}
|
||||
|
||||
rescue SocketError
|
||||
response = { status: false}
|
||||
end
|
||||
|
||||
if response["status"] == true
|
||||
@@ -179,6 +185,12 @@ end
|
||||
)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false}
|
||||
|
||||
rescue SocketError
|
||||
response = { status: false}
|
||||
end
|
||||
|
||||
if response["status"] == true
|
||||
@@ -211,6 +223,12 @@ end
|
||||
)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false}
|
||||
|
||||
rescue SocketError
|
||||
response = { status: false}
|
||||
end
|
||||
|
||||
if response["status"] == true
|
||||
|
||||
@@ -4,6 +4,7 @@ class Origami::ShiftsController < BaseOrigamiController
|
||||
end
|
||||
|
||||
def show
|
||||
puts current_user.id
|
||||
@shift = ShiftSale.current_open_shift(current_user.id)
|
||||
end
|
||||
|
||||
|
||||
@@ -31,6 +31,12 @@ class Customer < ApplicationRecord
|
||||
)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false}
|
||||
|
||||
rescue SocketError
|
||||
response = { status: false}
|
||||
end
|
||||
|
||||
return response;
|
||||
@@ -55,6 +61,12 @@ class Customer < ApplicationRecord
|
||||
)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false}
|
||||
|
||||
rescue SocketError
|
||||
response = { status: false}
|
||||
end
|
||||
|
||||
return response;
|
||||
|
||||
@@ -77,6 +77,12 @@ class SalePayment < ApplicationRecord
|
||||
)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false}
|
||||
|
||||
rescue SocketError
|
||||
response = { status: false}
|
||||
end
|
||||
return response;
|
||||
end
|
||||
@@ -110,6 +116,12 @@ class SalePayment < ApplicationRecord
|
||||
)
|
||||
rescue Net::OpenTimeout
|
||||
response = false
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false}
|
||||
|
||||
rescue SocketError
|
||||
response = { status: false}
|
||||
end
|
||||
else
|
||||
response = false;
|
||||
@@ -312,6 +324,12 @@ class SalePayment < ApplicationRecord
|
||||
}, :timeout => 10)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false}
|
||||
|
||||
rescue SocketError
|
||||
response = { status: false}
|
||||
end
|
||||
return response
|
||||
# puts response.to_json
|
||||
|
||||
@@ -21,7 +21,7 @@ class ShiftSale < ApplicationRecord
|
||||
#find open shift where is open today and is not closed and login by current cashier
|
||||
today_date = DateTime.now.strftime("%Y-%m-%d")
|
||||
puts today_date
|
||||
shift = ShiftSale.where("DATE(shift_started_at)= #{ today_date } and shift_started_at is not null and shift_closed_at is null and employee_id = #{current_user}").take
|
||||
shift = ShiftSale.where("TO_CHAR(shift_started_at, 'YYYY-MM-DD')=? and shift_started_at is not null and shift_closed_at is null and employee_id = #{current_user}", today_date).take
|
||||
|
||||
return shift
|
||||
#end
|
||||
|
||||
Reference in New Issue
Block a user