mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 84acf5f775 | |||
| 95301261c7 | |||
| 8b78e113f9 | |||
| 1c67328363 | |||
| 8f86220fef | |||
| fa2a6a2021 | |||
| b9e5ace6cd |
35
README.md
35
README.md
@@ -1,30 +1,41 @@
|
||||
#redmine_qbo
|
||||
#Redmine Quickbooks Online
|
||||
|
||||
##About
|
||||
|
||||
This is a simple plugin for Redmine to connect to Quickbooks Online
|
||||
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.
|
||||
|
||||
####How it works
|
||||
* A QBO customer and service item can now be assigned to an issue.
|
||||
* When a issue is closed, a new QBO Time Activity is created
|
||||
* A QBO customer and service item can be assigned to a redmine issue.
|
||||
* 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 rate will be the set be the service item
|
||||
|
||||
*Warning: * This is under heavy development
|
||||
|
||||
##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
|
||||
|
||||
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 '
|
||||
|
||||
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)
|
||||
2. Migrate your database
|
||||
|
||||
' 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
|
||||
|
||||
|
||||
BIN
Screenshots/plugin_config.png
Normal file
BIN
Screenshots/plugin_config.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 116 KiB |
BIN
Screenshots/plugin_issue_edit.png
Normal file
BIN
Screenshots/plugin_issue_edit.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 169 KiB |
BIN
Screenshots/plugin_issue_view.png
Normal file
BIN
Screenshots/plugin_issue_view.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 185 KiB |
BIN
Screenshots/plugin_top_menu.png
Normal file
BIN
Screenshots/plugin_top_menu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
BIN
Screenshots/plugin_user_edit.png
Normal file
BIN
Screenshots/plugin_user_edit.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 181 KiB |
@@ -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
|
||||
|
||||
@@ -19,7 +19,7 @@ class QboItem < ActiveRecord::Base
|
||||
service = Quickbooks::Service::Item.new(:company_id => qbo.realmId, :access_token => Qbo.get_auth_token)
|
||||
|
||||
# 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.name = item.name
|
||||
qbo_item.id = item.id
|
||||
|
||||
@@ -12,25 +12,25 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
<body>
|
||||
<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|%>
|
||||
<div>
|
||||
<%= f.label "Customers" %>
|
||||
<%= f.label "Customer Count:"+@qbo_customer_count.to_s%>
|
||||
<br/>
|
||||
<%= f.select :qbo_customer_id, QboCustomers.all.pluck(:name, :id), :selected => @selected_customer, include_blank: true %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= f.label "Items" %>
|
||||
<br/>
|
||||
<%= f.select :qbo_item_id, QboItem.all.pluck(:name, :id), :selected => @selected_item, include_blank: true %>
|
||||
</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/>
|
||||
<%= f.select :qbo_employee_id, QboEmployee.all.pluck(:name, :id), :selected => @selected_employee, include_blank: true %>
|
||||
</div>
|
||||
|
||||
2
init.rb
2
init.rb
@@ -18,7 +18,7 @@ Redmine::Plugin.register :redmine_qbo do
|
||||
name 'Redmine Quickbooks Online plugin'
|
||||
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'
|
||||
version '0.0.1'
|
||||
version '0.0.2'
|
||||
url 'https://github.com/rickbarrette/redmine_qbo'
|
||||
author_url 'http://rickbarrette.org'
|
||||
settings :default => {'empty' => true}, :partial => 'qbo/settings'
|
||||
|
||||
@@ -16,7 +16,7 @@ class IssuesFormHookListener < Redmine::Hook::ViewListener
|
||||
selected = ""
|
||||
|
||||
QboCustomers.update_all
|
||||
#QboItem.update_all
|
||||
QboItem.update_all
|
||||
|
||||
# Check to see if there is a quickbooks user attached to the issue
|
||||
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
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user