mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Removed @ from variables
This commit is contained in:
@@ -14,31 +14,31 @@ class IssuesFormHookListener < Redmine::Hook::ViewListener
|
|||||||
# Show a dropdown for quickbooks contacts
|
# Show a dropdown for quickbooks contacts
|
||||||
def view_issues_form_details_bottom(context={})
|
def view_issues_form_details_bottom(context={})
|
||||||
# Update the customer and item database
|
# Update the customer and item database
|
||||||
#QboCustomer.update_all
|
QboCustomer.update_all
|
||||||
#QboItem.update_all
|
#QboItem.update_all
|
||||||
#QboInvoice.update_all
|
QboInvoice.update_all
|
||||||
#QboEstimate.update_all
|
#QboEstimate.update_all
|
||||||
|
|
||||||
# Check to see if there is a quickbooks user attached to the issue
|
# Check to see if there is a quickbooks user attached to the issue
|
||||||
@selected_customer = context[:issue].qbo_customer ? context[:issue].qbo_customer.id : nil
|
selected_customer = context[:issue].qbo_customer ? context[:issue].qbo_customer.id : nil
|
||||||
@selected_item = context[:issue].qbo_item ? context[:issue].qbo_item.id : nil
|
selected_item = context[:issue].qbo_item ? context[:issue].qbo_item.id : nil
|
||||||
@selected_invoice = context[:issue].qbo_invoice ? context[:issue].qbo_invoice.id : nil
|
selected_invoice = context[:issue].qbo_invoice ? context[:issue].qbo_invoice.id : nil
|
||||||
@selected_estimate = context[:issue].qbo_estimate ? context[:issue].qbo_estimate.id : nil
|
selected_estimate = context[:issue].qbo_estimate ? context[:issue].qbo_estimate.id : nil
|
||||||
|
|
||||||
# Generate the drop down list of quickbooks customers
|
# Generate the drop down list of quickbooks customers
|
||||||
@select_customer = context[:form].select :qbo_customer_id, QboCustomer.all.pluck(:name, :id).sort, :selected => @selected_customer, include_blank: true
|
select_customer = context[:form].select :qbo_customer_id, QboCustomer.all.pluck(:name, :id).sort, :selected => selected_customer, include_blank: true
|
||||||
|
|
||||||
# Generate the drop down list of quickbooks items
|
# Generate the drop down list of quickbooks items
|
||||||
@select_item = context[:form].select :qbo_item_id, QboItem.all.pluck(:name, :id).sort, :selected => @selected_item, include_blank: true
|
select_item = context[:form].select :qbo_item_id, QboItem.all.pluck(:name, :id).sort, :selected => selected_item, include_blank: true
|
||||||
|
|
||||||
# Generate the drop down list of quickbooks invoices
|
# Generate the drop down list of quickbooks invoices
|
||||||
@select_invoice = context[:form].select :qbo_invoice_id, QboInvoice.all.pluck(:doc_number, :id).sort! {|x, y| y <=> x}, :selected => @selected_invoice, include_blank: true
|
select_invoice = context[:form].select :qbo_invoice_id, QboInvoice.all.pluck(:doc_number, :id).sort! {|x, y| y <=> x}, :selected => selected_invoice, include_blank: true
|
||||||
|
|
||||||
# Generate the drop down list of quickbooks extimates
|
# Generate the drop down list of quickbooks extimates
|
||||||
@select_estimate = context[:form].select :qbo_estimate_id, QboEstimate.all.pluck(:doc_number, :id).sort! {|x, y| y <=> x}, :selected => @selected_estimate, include_blank: true
|
select_estimate = context[:form].select :qbo_estimate_id, QboEstimate.all.pluck(:doc_number, :id).sort! {|x, y| y <=> x}, :selected => selected_estimate, include_blank: true
|
||||||
|
|
||||||
#@estimates_link = link_to qbo_update_estimates_path
|
#@estimates_link = link_to qbo_update_estimates_path
|
||||||
|
|
||||||
return "<p>#{@select_customer}</p> <p>#{@select_item}</p> <p>#{@select_invoice}</p> <p>#{@select_estimate} #{@estimates_link}</p>"
|
return "<p>#{select_customer}</p> <p>#{select_item}</p> <p>#{select_invoice}</p> <p>#{select_estimate}</p>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,46 +21,42 @@ class IssuesShowHookListener < Redmine::Hook::ViewListener
|
|||||||
issue = context[:issue]
|
issue = context[:issue]
|
||||||
|
|
||||||
# Check to see if there is a quickbooks user attached to the issue
|
# Check to see if there is a quickbooks user attached to the issue
|
||||||
@customer = issue.qbo_customer ? issue.qbo_customer.name : nil
|
customer = issue.qbo_customer ? issue.qbo_customer.name : nil
|
||||||
|
|
||||||
# Check to see if there is a quickbooks item attached to the issue
|
# Check to see if there is a quickbooks item attached to the issue
|
||||||
@item = issue.qbo_item ? issue.qbo_item.name : nil
|
item = issue.qbo_item ? issue.qbo_item.name : nil
|
||||||
|
|
||||||
@estimate = nil
|
|
||||||
@estimate_link = nil
|
|
||||||
# Estimate Number
|
# Estimate Number
|
||||||
if issue.qbo_estimate
|
if issue.qbo_estimate
|
||||||
@estimate = issue.qbo_estimate.doc_number
|
estimate = issue.qbo_estimate.doc_number
|
||||||
@estimate_link = link_to @estimate, "#{Redmine::Utils::relative_url_root }/qbo/estimate/#{issue.qbo_estimate.id}", :target => "_blank"
|
estimate_link = link_to estimate, "#{Redmine::Utils::relative_url_root }/qbo/estimate/#{issue.qbo_estimate.id}", :target => "_blank"
|
||||||
end
|
end
|
||||||
|
|
||||||
@invoice = nil
|
|
||||||
@invo = nil
|
|
||||||
# Invoice Number
|
# Invoice Number
|
||||||
if issue.qbo_invoice
|
if issue.qbo_invoice
|
||||||
@invoice = issue.qbo_invoice.doc_number
|
invoice = issue.qbo_invoice.doc_number
|
||||||
@invoice_link = link_to @invoice, "#{Redmine::Utils::relative_url_root }/qbo/invoice/#{issue.qbo_invoice.id}", :target => "_blank"
|
invoice_link = link_to invoice, "#{Redmine::Utils::relative_url_root }/qbo/invoice/#{issue.qbo_invoice.id}", :target => "_blank"
|
||||||
end
|
end
|
||||||
|
|
||||||
return "<div class=\"attributes\">
|
return "<div class=\"attributes\">
|
||||||
<div class=\"qbo_customer_id attribute\">
|
<div class=\"qbo_customer_id attribute\">
|
||||||
<div class=\"label\"><span>Customer</span>:</div>
|
<div class=\"label\"><span>Customer</span>:</div>
|
||||||
<div class=\"value\">#{@customer}</div>
|
<div class=\"value\">#{customer}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class=\"qbo_item_id attribute\">
|
<div class=\"qbo_item_id attribute\">
|
||||||
<div class=\"label\"><span>Item</span>:</div>
|
<div class=\"label\"><span>Item</span>:</div>
|
||||||
<div class=\"value\">#{@item}</div>
|
<div class=\"value\">#{item}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class=\"qbo_estimate_id attribute\">
|
<div class=\"qbo_estimate_id attribute\">
|
||||||
<div class=\"label\"><span>Estimate</span>:</div>
|
<div class=\"label\"><span>Estimate</span>:</div>
|
||||||
<div class=\"value\">#{@estimate_link}</div>
|
<div class=\"value\">#{estimate_link}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class=\"qbo_invoice_id attribute\">
|
<div class=\"qbo_invoice_id attribute\">
|
||||||
<div class=\"label\"><span>Invoice</span>:</div>
|
<div class=\"label\"><span>Invoice</span>:</div>
|
||||||
<div class=\"value\">#{@invoice_link}</div>
|
<div class=\"value\">#{invoice_link}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>"
|
</div>"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user