7 Commits
0.0.1 ... 0.0.2

11 changed files with 40 additions and 29 deletions

View File

@@ -1,30 +1,41 @@
#redmine_qbo #Redmine Quickbooks Online
##About A simple plugin for Redmine to connect to Quickbooks Online
This is a simple plugin for Redmine to connect to Quickbooks Online
The goal of this project is to allow redmine to connect with Quickbooks Online to create time activity entries for completed work when an issue is closed. The goal of this project is to allow redmine to connect with Quickbooks Online to create time activity entries for completed work when an issue is closed.
####How it works ####How it works
* A QBO customer and service item can now be assigned to an issue. * A QBO customer and service item can be assigned to a redmine issue.
* When a issue is closed, a new QBO Time Activity is created * A QBO employee can be assigned to a redmine user
* When a issue is closed, the following things happen:
- The plugin checks to see if the user assinged to the issue has a QBO employee assinged to them
- The plugin checks to see if the issue has a QBO customer & service item attached
- If the above statements are true, then a new QBO Time Activity is created
- The total time for the Time Activity will be total spent time. - The total time for the Time Activity will be total spent time.
- The rate will be the set be the service item - The rate will be the set be the service item
*Warning: * This is under heavy development
##Prerequisites ##Prerequisites
Sign up to become a developer for Intuit https://developer.intuit.com/ * Sign up to become a developer for Intuit https://developer.intuit.com/
* Create your own aplication to obtain your API keys
##The Install ##The Install
To install, clone into your plugin folder and migrate your database. Then navigate to the plugin configuration page (https://your.redmine.com/settings/plugin/redmine_qbo) and suppy your own OAuth key & secret. 1. To install, clone this repo into your plugin folder
After saving your key & secret, you need to click on the Authenticate link on the plugin configuration page to authenticate with QBO. ' git clone git@github.com:rickbarrette/redmine_qbo.git '
2. Migrate your database
Once you are authenticated with QBO, you need to synchronize your database with QBO by clicking the sync link in the Quickbooks top menu (https://your.redmine.com/redmine/qbo) ' rake redmine:plugins:migrate RAILS_ENV=production '
3. Navigate to the plugin configuration page (https://your.redmine.com/settings/plugin/redmine_qbo) and suppy your own OAuth key & secret.
4. After saving your key & secret, you need to click on the Authenticate link on the plugin configuration page to authenticate with QBO.
5. Enjoy
Note: Customers, Employees, and Service Items with automaticly update during normal usage of redmine i.e. a page refresh. You can also manualy force redmine to sync its database with QBO clicking the sync link in the Quickbooks top menu page (https://your.redmine.com/redmine/qbo)
##License ##License

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

View File

@@ -54,7 +54,7 @@ class QboController < ApplicationController
qbo.reconnect_token_at = 5.months.from_now.utc qbo.reconnect_token_at = 5.months.from_now.utc
qbo.realmId = realm_id qbo.realmId = realm_id
if qbo.save! 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 else
redirect_to plugin_settings_path(:redmine_qbo), :flash => { :error => "Error" } redirect_to plugin_settings_path(:redmine_qbo), :flash => { :error => "Error" }
end end

View File

@@ -19,7 +19,7 @@ class QboItem < ActiveRecord::Base
service = Quickbooks::Service::Item.new(:company_id => qbo.realmId, :access_token => Qbo.get_auth_token) service = Quickbooks::Service::Item.new(:company_id => qbo.realmId, :access_token => Qbo.get_auth_token)
# Update the item table # Update the item table
service.all.each { |item| service.find_by(:type, "Service").each { |item|
qbo_item = QboItem.find_or_create_by(id: item.id) qbo_item = QboItem.find_or_create_by(id: item.id)
qbo_item.name = item.name qbo_item.name = item.name
qbo_item.id = item.id qbo_item.id = item.id

View File

@@ -12,25 +12,25 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<body> <body>
<h1> Redmine Quickbooks</h1> <h1> Redmine Quickbooks</h1>
<p>Customer Count: <%= @qbo_customer_count %></p>
<p>Item Count: <%= @qbo_item_count %></p>
<p>Employee Count: <%= @qbo_employee_count %></P>
<%= form_for @qbo do |f|%> <%= form_for @qbo do |f|%>
<div> <div>
<%= f.label "Customers" %> <%= f.label "Customer Count:"+@qbo_customer_count.to_s%>
<br/> <br/>
<%= f.select :qbo_customer_id, QboCustomers.all.pluck(:name, :id), :selected => @selected_customer, include_blank: true %> <%= f.select :qbo_customer_id, QboCustomers.all.pluck(:name, :id), :selected => @selected_customer, include_blank: true %>
</div> </div>
<div> <br/>
<%= f.label "Items" %>
<br/>
<%= f.select :qbo_item_id, QboItem.all.pluck(:name, :id), :selected => @selected_item, include_blank: true %>
</div>
<div> <div>
<%= f.label "Employees" %> <%= f.label "Item Count: "+@qbo_item_count.to_s %>
<br/>
<%= f.select :qbo_item_id, QboItem.all.pluck(:name, :id).reverse, :selected => @selected_item, include_blank: true %>
</div>
<br/>
<div>
<%= f.label "Employee Count: "+@qbo_employee_count.to_s %>
<br/> <br/>
<%= f.select :qbo_employee_id, QboEmployee.all.pluck(:name, :id), :selected => @selected_employee, include_blank: true %> <%= f.select :qbo_employee_id, QboEmployee.all.pluck(:name, :id), :selected => @selected_employee, include_blank: true %>
</div> </div>
@@ -39,4 +39,4 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<br/> <br/>
<br/> <br/>
<%= link_to "Sync", qbo_sync_path %> <%= link_to "Sync", qbo_sync_path %>
</body> </body>

View File

@@ -18,7 +18,7 @@ Redmine::Plugin.register :redmine_qbo do
name 'Redmine Quickbooks Online plugin' name 'Redmine Quickbooks Online plugin'
author 'Rick Barrette' author 'Rick Barrette'
description 'This is a plugin for Redmine to intergrate with Quickbooks Online to allow for seamless intergration CRM and invoicing of completed issues' description 'This is a plugin for Redmine to intergrate with Quickbooks Online to allow for seamless intergration CRM and invoicing of completed issues'
version '0.0.1' version '0.0.2'
url 'https://github.com/rickbarrette/redmine_qbo' url 'https://github.com/rickbarrette/redmine_qbo'
author_url 'http://rickbarrette.org' author_url 'http://rickbarrette.org'
settings :default => {'empty' => true}, :partial => 'qbo/settings' settings :default => {'empty' => true}, :partial => 'qbo/settings'

View File

@@ -16,7 +16,7 @@ class IssuesFormHookListener < Redmine::Hook::ViewListener
selected = "" selected = ""
QboCustomers.update_all QboCustomers.update_all
#QboItem.update_all QboItem.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
if not context[:issue].qbo_customer_id.nil? then if not context[:issue].qbo_customer_id.nil? then
@@ -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 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 # 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>" return "<p>#{select_customer}</p> <p>#{select_item}</p>"
end end