mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-09 01:14:23 -05:00
Added garbage colllection for instance variables
This commit is contained in:
@@ -22,8 +22,8 @@ class IssuesFormHookListener < Redmine::Hook::ViewListener
|
||||
# Check to see if there is a quickbooks user attached to the issue
|
||||
@selected_customer = context[:issue].qbo_customer.id if context[:issue].qbo_customer
|
||||
@selected_item = context[:issue].qbo_item.id if context[:issue].qbo_item
|
||||
@selected_invoice = context[:issue].qbo_invoice.id if context[:issue].qbo_invoice
|
||||
@selected_estimate = context[:issue].qbo_estimate.id if context[:issue].qbo_estimate
|
||||
@selected_invoice = context[:issue].qbo_invoice ? context[:issue].qbo_invoice.id : nil
|
||||
@selected_estimate = context[:issue].qbo_estimate ? context[:issue].qbo_estimate.id : nil
|
||||
|
||||
# Generate the drop down list of quickbooks customers
|
||||
@select_customer = context[:form].select :qbo_customer_id, QboCustomer.all.pluck(:name, :id), :selected => @selected_customer, include_blank: true
|
||||
|
||||
@@ -21,11 +21,13 @@ class IssuesShowHookListener < Redmine::Hook::ViewListener
|
||||
issue = context[:issue]
|
||||
|
||||
# Check to see if there is a quickbooks user attached to the issue
|
||||
@customer = issue.qbo_customer.name if issue.qbo_customer
|
||||
@customer = issue.qbo_customer ? issue.qbo_customer.name : nil
|
||||
|
||||
# Check to see if there is a quickbooks item attached to the issue
|
||||
@item = issue.qbo_item.name if issue.qbo_item
|
||||
@item = issue.qbo_item ? issue.qbo_item.name : nil
|
||||
|
||||
@estimate = nil
|
||||
@estimate_link = nil
|
||||
# Estimate Number
|
||||
if issue.qbo_estimate
|
||||
QboEstimate.update(issue.qbo_estimate.id)
|
||||
@@ -33,6 +35,8 @@ class IssuesShowHookListener < Redmine::Hook::ViewListener
|
||||
@estimate_link = link_to @estimate, "#{Redmine::Utils::relative_url_root }/qbo/estimate/#{issue.qbo_estimate.id}", :target => "_blank"
|
||||
end
|
||||
|
||||
@invoice = nil
|
||||
@invo = nil
|
||||
# Invoice Number
|
||||
if issue.qbo_invoice
|
||||
QboInvoice.update(issue.qbo_invoice.id)
|
||||
|
||||
Reference in New Issue
Block a user