mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-09 01:14:23 -05:00
Compare commits
6 Commits
2.1.1
...
74f7ba41df
| Author | SHA1 | Date | |
|---|---|---|---|
| 74f7ba41df | |||
| 4fb424faa8 | |||
| 63218e7f42 | |||
| 7f0bb3cae7 | |||
| ad7417c233 | |||
| cf0be2336b |
@@ -16,12 +16,15 @@ class EstimateController < ApplicationController
|
|||||||
skip_before_action :verify_authenticity_token, :check_if_login_required, :unless => proc {|c| session[:token].nil? }
|
skip_before_action :verify_authenticity_token, :check_if_login_required, :unless => proc {|c| session[:token].nil? }
|
||||||
|
|
||||||
def get_estimate
|
def get_estimate
|
||||||
# Force sync for estimate by doc number
|
# Force sync for estimate by doc number if not found
|
||||||
|
if Estimate.find_by_doc_number(params[:search]).nil?
|
||||||
begin
|
begin
|
||||||
Estimate.sync_by_doc_number(params[:search]) if params[:search]
|
Estimate.sync_by_doc_number(params[:search]) if params[:search]
|
||||||
rescue
|
rescue
|
||||||
logger.info "Estimate.find_by_doc_number failed"
|
logger.info "Estimate.find_by_doc_number failed"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
estimate = Estimate.find_by_id(params[:id]) if params[:id]
|
estimate = Estimate.find_by_id(params[:id]) if params[:id]
|
||||||
estimate = Estimate.find_by_doc_number(params[:search]) if params[:search]
|
estimate = Estimate.find_by_doc_number(params[:search]) if params[:search]
|
||||||
return estimate
|
return estimate
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ class QboController < ApplicationController
|
|||||||
|
|
||||||
# proceed if the request is good
|
# proceed if the request is good
|
||||||
if hash.eql? signature
|
if hash.eql? signature
|
||||||
|
Thread.new do
|
||||||
if request.headers['content-type'] == 'application/json'
|
if request.headers['content-type'] == 'application/json'
|
||||||
data = JSON.parse(data)
|
data = JSON.parse(data)
|
||||||
else
|
else
|
||||||
@@ -122,7 +123,8 @@ class QboController < ApplicationController
|
|||||||
|
|
||||||
# Record that last time we updated
|
# Record that last time we updated
|
||||||
Qbo.update_time_stamp
|
Qbo.update_time_stamp
|
||||||
|
ActiveRecord::Base.connection.close
|
||||||
|
end
|
||||||
# The webhook doesn't require a response but let's make sure we don't send anything
|
# The webhook doesn't require a response but let's make sure we don't send anything
|
||||||
render :nothing => true, status: 200
|
render :nothing => true, status: 200
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -44,6 +44,8 @@
|
|||||||
</table>
|
</table>
|
||||||
<div style="float: right;">
|
<div style="float: right;">
|
||||||
<%= button_to t(:label_edit_customer), edit_customer_path(customer), method: :get%>
|
<%= button_to t(:label_edit_customer), edit_customer_path(customer), method: :get%>
|
||||||
|
|
||||||
|
<%= link_to t(:label_appointment), "https://calendar.google.com/calendar/render?action=TEMPLATE&text=#{customer.name}+-&details=#{customer.primary_phone}&dates=#{Time.now.strftime("%Y%m%d")}T090000/#{Time.now.strftime("%Y%m%d")}T170000", target: :_blank %>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
@@ -3,4 +3,3 @@
|
|||||||
<%= submit_tag t(:label_search) %>
|
<%= submit_tag t(:label_search) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= button_to t(:label_new_customer), new_customer_path, method: :get%>
|
<%= button_to t(:label_new_customer), new_customer_path, method: :get%>
|
||||||
<%= button_to(t(:label_sync), qbo_sync_path, method: :get) if User.current.admin?%>
|
|
||||||
|
|||||||
@@ -89,4 +89,5 @@ en:
|
|||||||
label_hours: "Hours"
|
label_hours: "Hours"
|
||||||
label_oauth2_refresh_token_expires_at: "Refresh Token Expires At"
|
label_oauth2_refresh_token_expires_at: "Refresh Token Expires At"
|
||||||
label_name: "Name"
|
label_name: "Name"
|
||||||
|
label_appointment: "Add Appointment"
|
||||||
|
|
||||||
Reference in New Issue
Block a user