mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-09 09:24:23 -05:00
Update issues_form_hook_listener.rb
This commit is contained in:
@@ -21,11 +21,13 @@ class IssuesFormHookListener < Redmine::Hook::ViewListener
|
||||
selected_invoice = context[:issue].qbo_invoice ? context[:issue].qbo_invoice.id : nil
|
||||
selected_estimate = context[:issue].qbo_estimate ? context[:issue].qbo_estimate.id : nil
|
||||
|
||||
customer = Customer.find_by_id(selected_customer) if selected_customer
|
||||
vehicle = context[:issue].vehicles_id
|
||||
|
||||
# Generate the drop down list of quickbooks customers
|
||||
select_customer = f.select :customer_id, Customer.without_callback(:initialize, :after, :pull).all.pluck(:name, :id).sort, :selected => selected_customer, include_blank: true
|
||||
Customer.without_callback(:initialize, :after, :pull) do |c|
|
||||
customer = c.find_by_id(selected_customer) if selected_customer
|
||||
select_customer = f.select :customer_id, c.all.pluck(:name, :id).sort, :selected => selected_customer, include_blank: true
|
||||
end
|
||||
|
||||
# Generate the drop down list of quickbooks items
|
||||
select_item = f.select :qbo_item_id, QboItem.all.pluck(:name, :id).sort, :selected => selected_item, include_blank: true
|
||||
|
||||
Reference in New Issue
Block a user