mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Readded nil checks
This commit is contained in:
@@ -74,4 +74,10 @@ class QboController < ApplicationController
|
||||
|
||||
redirect_to qbo_path(:redmine_qbo), :flash => { :notice => "Successfully synced to Quickbooks" }
|
||||
end
|
||||
|
||||
def pdf
|
||||
@pdf = "#{base.url_for_resource('estimate')}/#{params['qbo_estimate_id']}/pdf"
|
||||
send_data @pdf, filename: "estimate.pdf", type: :pdf
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -21,18 +21,22 @@ class IssuesShowHookListener < Redmine::Hook::ViewListener
|
||||
issue = context[:issue]
|
||||
|
||||
# Check to see if there is a quickbooks user attached to the issue
|
||||
#unless context[:issue].qbo_customer_id.nil?
|
||||
unless issue.qbo_customer.nil?
|
||||
@customer = issue.qbo_customer.name
|
||||
#end
|
||||
end
|
||||
|
||||
# Check to see if there is a quickbooks item attached to the issue
|
||||
@item = issue.qbo_item.name
|
||||
unless issue.qbo_item.nil?
|
||||
@item = issue.qbo_item.name
|
||||
end
|
||||
|
||||
# Estimate Number
|
||||
unless (issue.qbo_estimate.nil?)
|
||||
QboEstimate.update(issue.qbo_estimate.id)
|
||||
@estimate = issue.qbo_estimate.doc_number
|
||||
end
|
||||
base = QboEstimate.get_base.service
|
||||
#base.initialize
|
||||
|
||||
return "<div class=\"attributes\">
|
||||
<div class=\"qbo_customer_id attribute\">
|
||||
@@ -47,9 +51,9 @@ class IssuesShowHookListener < Redmine::Hook::ViewListener
|
||||
|
||||
<div class=\"qbo_estimate_id attribute\">
|
||||
<div class=\"label\"><span>Estimate</span>:</div>
|
||||
<div class=\"value\">#{@estimate}</div>
|
||||
<div class=\"value\"><a href=\"</div>
|
||||
</div>
|
||||
</div>"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user