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