Redirect to QBO Sync after Authentication & reverse item order

This commit is contained in:
2016-01-09 23:13:24 -05:00
parent 6d357f27f9
commit b9e5ace6cd
3 changed files with 3 additions and 3 deletions

View File

@@ -54,7 +54,7 @@ class QboController < ApplicationController
qbo.reconnect_token_at = 5.months.from_now.utc
qbo.realmId = realm_id
if qbo.save!
redirect_to plugin_settings_path(:redmine_qbo), :flash => { :notice => "Successfully connected to Quickbooks" }
redirect_to qbo_sync_path, :flash => { :notice => "Successfully connected to Quickbooks" }
else
redirect_to plugin_settings_path(:redmine_qbo), :flash => { :error => "Error" }
end

View File

@@ -26,7 +26,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<div>
<%= f.label "Items" %>
<br/>
<%= f.select :qbo_item_id, QboItem.all.pluck(:name, :id), :selected => @selected_item, include_blank: true %>
<%= f.select :qbo_item_id, QboItem.all.pluck(:name, :id).reverse, :selected => @selected_item, include_blank: true %>
</div>
<div>

View File

@@ -28,7 +28,7 @@ class IssuesFormHookListener < Redmine::Hook::ViewListener
select_customer = context[:form].select :qbo_customer_id, QboCustomers.all.pluck(:name, :id), :selected => selected_customer, include_blank: true
# Generate the drop down list of quickbooks contacts
select_item = context[:form].select :qbo_item_id, QboItem.all.pluck(:name, :id), :selected => selected_item, include_blank: true
select_item = context[:form].select :qbo_item_id, QboItem.all.pluck(:name, :id).reverse, :selected => selected_item, include_blank: true
return "<p>#{select_customer}</p> <p>#{select_item}</p>"
end