mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-08-19 04:40:44 -04:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dfd3a641db | ||
|
|
75e5aeb668 | ||
|
|
ea29990cfa | ||
|
|
c31ec82e61 | ||
|
|
938f9d9f3b | ||
|
|
f2b0186ee2 | ||
|
|
9373963c94 | ||
|
|
396a56ceec | ||
|
|
b3c3006b56 | ||
|
|
576ca5a0a9 | ||
|
|
d18a0c180a | ||
|
|
baca0ed6c7 | ||
|
|
6bf84dd61a | ||
|
|
61b02831e3 | ||
|
|
7c79f2388a | ||
|
|
36267893bd |
@@ -89,17 +89,6 @@ Supported automation:
|
|||||||
|
|
||||||
Invoices containing an Issue reference (e.g. `#123`) automatically attach to the corresponding Issue.
|
Invoices containing an Issue reference (e.g. `#123`) automatically attach to the corresponding Issue.
|
||||||
|
|
||||||
### Custom Field Synchronization
|
|
||||||
|
|
||||||
Invoice custom fields can be mapped to Issue custom fields.
|
|
||||||
|
|
||||||
Example use case:
|
|
||||||
|
|
||||||
* Mileage In/Out recorded in Redmine
|
|
||||||
|
|
||||||
* Automatically synchronized to the QuickBooks invoice.
|
|
||||||
|
|
||||||
|
|
||||||
### Customer Synchronization
|
### Customer Synchronization
|
||||||
|
|
||||||
Customer records are automatically updated in the local database when changes occur in QuickBooks.
|
Customer records are automatically updated in the local database when changes occur in QuickBooks.
|
||||||
@@ -119,6 +108,8 @@ Available hooks:
|
|||||||
|
|
||||||
|Type|Hook|Note
|
|Type|Hook|Note
|
||||||
|--|--|--|
|
|--|--|--|
|
||||||
|
View Hook|:customer_actions_top, { customer: @customer }| Used to add action links to customer view
|
||||||
|
View Hook|:customer_actions_bottom, { customer: @customer} | Used to add action links to customer view
|
||||||
View Hook|:pdf_left, { issue: issue } | Used to add text to left side of PDF
|
View Hook|:pdf_left, { issue: issue } | Used to add text to left side of PDF
|
||||||
View Hook|:pdf_right, { issue: issue } | Used to add text to right side of PDF
|
View Hook|:pdf_right, { issue: issue } | Used to add text to right side of PDF
|
||||||
View Hook|:show_customer_view_right, { customer: customer } | Used to show partials on right side of customer view
|
View Hook|:show_customer_view_right, { customer: customer } | Used to show partials on right side of customer view
|
||||||
@@ -153,7 +144,7 @@ https://redmine.yourdomain.com/qbo/webhook
|
|||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
## 1\. Clone the Plugin
|
## 1. Clone the Plugin
|
||||||
|
|
||||||
Install the plugin into your Redmine plugins directory.
|
Install the plugin into your Redmine plugins directory.
|
||||||
|
|
||||||
@@ -168,7 +159,7 @@ Use a **tagged release** for stability.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 2\. Install Dependencies
|
## 2. Install Dependencies
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bundle install
|
bundle install
|
||||||
@@ -178,7 +169,7 @@ Required for **Redmine 6 / Rails 7 compatibility**.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 3\. Run Database Migrations
|
## 3. Run Database Migrations
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bundle exec rake redmine:plugins:migrate RAILS_ENV=production
|
bundle exec rake redmine:plugins:migrate RAILS_ENV=production
|
||||||
@@ -186,7 +177,7 @@ bundle exec rake redmine:plugins:migrate RAILS_ENV=production
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 4\. Restart Redmine
|
## 4. Restart Redmine
|
||||||
|
|
||||||
Restart your Redmine server so the plugin and hooks are loaded.
|
Restart your Redmine server so the plugin and hooks are loaded.
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ class Customer < QboBaseModel
|
|||||||
self.primary_key = :id
|
self.primary_key = :id
|
||||||
qbo_sync push: true
|
qbo_sync push: true
|
||||||
|
|
||||||
|
# Normalize the local database column :name
|
||||||
|
normalizes :name, with: ->(name) { name.to_s.strip.titleize }
|
||||||
|
|
||||||
acts_as_searchable columns: %w[name phone_number mobile_phone_number ],
|
acts_as_searchable columns: %w[name phone_number mobile_phone_number ],
|
||||||
scope: ->(_context) { left_joins(:project) },
|
scope: ->(_context) { left_joins(:project) },
|
||||||
date_column: :updated_at
|
date_column: :updated_at
|
||||||
@@ -61,8 +64,9 @@ class Customer < QboBaseModel
|
|||||||
|
|
||||||
# Updates Both local DB name & QBO display_name
|
# Updates Both local DB name & QBO display_name
|
||||||
def name=(s)
|
def name=(s)
|
||||||
details.display_name = s
|
super(s)
|
||||||
super
|
# Write the normalized value from Active Record to QBO details
|
||||||
|
details.display_name = self.name
|
||||||
end
|
end
|
||||||
|
|
||||||
# Normalizes phone numbers by removing non-digit characters. This method is called before validation to ensure that phone numbers are stored in a consistent format, which can help with searching and integration with external systems like QuickBooks Online.
|
# Normalizes phone numbers by removing non-digit characters. This method is called before validation to ensure that phone numbers are stored in a consistent format, which can help with searching and integration with external systems like QuickBooks Online.
|
||||||
|
|||||||
@@ -10,12 +10,16 @@
|
|||||||
|
|
||||||
class Estimate < QboBaseModel
|
class Estimate < QboBaseModel
|
||||||
|
|
||||||
has_and_belongs_to_many :issues
|
has_many :issues
|
||||||
belongs_to :customer
|
belongs_to :customer
|
||||||
validates_presence_of :doc_number, :id
|
validates_presence_of :doc_number, :id
|
||||||
self.primary_key = :id
|
self.primary_key = :id
|
||||||
qbo_sync push: false
|
qbo_sync push: false
|
||||||
|
|
||||||
|
def name
|
||||||
|
to_s
|
||||||
|
end
|
||||||
|
|
||||||
# returns a human readable string
|
# returns a human readable string
|
||||||
def to_s
|
def to_s
|
||||||
return self[:doc_number]
|
return self[:doc_number]
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#The MIT License (MIT)
|
||||||
|
#
|
||||||
|
#Copyright (c) 2016 - 2026 rick barrette
|
||||||
|
#
|
||||||
|
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
class EstimateService < ServiceBase
|
||||||
|
|
||||||
|
end
|
||||||
@@ -1,11 +1,15 @@
|
|||||||
<%= link_to t(:label_appointment), "https://calendar.google.com/calendar/render?action=TEMPLATE&text=#{@customer.name}+-&details=#{ link_to t(:customer_details), "https://#{Setting.host_name}#{customer_path @customer.id}"}%0A#{@customer.primary_phone}%3Cbr/%3E+&dates=#{Time.now.strftime("%Y%m%d")}T090000/#{Time.now.strftime("%Y%m%d")}T170000", target: :_blank, id: :appointment_link %>
|
<%= call_hook :customer_actions_top, { customer: @customer } %>
|
||||||
|
|
||||||
<br/>
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
<%= link_to t(:label_create_estimate), "https://qbo.intuit.com/app/estimate?nameId=#{@customer.id}", target: :_blank %>
|
<%= link_to t(:label_create_estimate), "https://qbo.intuit.com/app/estimate?nameId=#{@customer.id}", target: :_blank %>
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
<%= link_to t(:label_create_payment), "https://qbo.intuit.com/app/recvpayment?nameId=#{@customer.id}", target: :_blank %>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<%= call_hook :customer_actions_bottom, { customer: @customer } %>
|
||||||
|
|
||||||
<%= button_to t(:label_edit_customer), edit_customer_path(@customer), method: :get%>
|
<%= button_to t(:label_edit_customer), edit_customer_path(@customer), method: :get%>
|
||||||
|
|||||||
@@ -36,23 +36,19 @@
|
|||||||
<td>$<%= customer.balance %></td>
|
<td>$<%= customer.balance %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<% if customer.notes.present? %>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2"><h4><%=t(:field_notes)%></hr></th>
|
<th colspan="2"><h4><%= t(:field_notes) %></h4></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<pre id="note-display" style="text-align: left; white-space: pre-wrap; font-family: inherit;">
|
<div class="wiki">
|
||||||
<%= customer.notes %>
|
<%= textilizable(customer, :notes) %>
|
||||||
</pre>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<% end %>
|
||||||
<script>
|
|
||||||
const preElement = document.getElementById('note-display');
|
|
||||||
// This takes the text, trims the edges, and puts it back
|
|
||||||
preElement.textContent = preElement.textContent.trim();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -36,16 +36,13 @@
|
|||||||
<%=t(:field_notes)%>:
|
<%=t(:field_notes)%>:
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<p>
|
<p>
|
||||||
<%= content_tag :span, id: "issue_description_and_toolbar" do %>
|
|
||||||
<%= f.text_area :notes,
|
<%= f.text_area :notes,
|
||||||
cols: 60,
|
rows: 8,
|
||||||
rows: 10,
|
|
||||||
accesskey: accesskey(:edit),
|
|
||||||
class: 'wiki-edit',
|
class: 'wiki-edit',
|
||||||
no_label: true %>
|
style: 'width: 95%;',
|
||||||
<% end %>
|
id: 'customer_appointment_description' %>
|
||||||
|
<%= wikitoolbar_for 'customer_appointment_description' %>
|
||||||
</p>
|
</p>
|
||||||
<%= wikitoolbar_for :issue_description %>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,10 @@ en:
|
|||||||
label_closed_issues: "Closed Issues"
|
label_closed_issues: "Closed Issues"
|
||||||
label_connected: "Successfully connected to QuickBooks"
|
label_connected: "Successfully connected to QuickBooks"
|
||||||
label_create_estimate: "Create Estimate"
|
label_create_estimate: "Create Estimate"
|
||||||
|
label_create_payment: "Create Payment"
|
||||||
label_customer_count: "Customer Count"
|
label_customer_count: "Customer Count"
|
||||||
label_customer_link_expires: "This customer link expires in"
|
label_customer_link_expires: "This customer link expires in"
|
||||||
|
label_customer: "Customer"
|
||||||
label_customers: "Customers"
|
label_customers: "Customers"
|
||||||
label_delete: "Delete"
|
label_delete: "Delete"
|
||||||
label_deposit_into: "Deposit to Account"
|
label_deposit_into: "Deposit to Account"
|
||||||
@@ -49,6 +51,7 @@ en:
|
|||||||
label_error: "Error"
|
label_error: "Error"
|
||||||
label_estimate_404: "Estimate not found"
|
label_estimate_404: "Estimate not found"
|
||||||
label_estimate_count: "Estimate Count"
|
label_estimate_count: "Estimate Count"
|
||||||
|
label_estimate: "Estimate"
|
||||||
label_estimates: "Estimates"
|
label_estimates: "Estimates"
|
||||||
label_hours: "Hours"
|
label_hours: "Hours"
|
||||||
label_invoice_404: "Invoice not found"
|
label_invoice_404: "Invoice not found"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Redmine::Plugin.register :redmine_qbo do
|
|||||||
name 'Redmine QBO plugin'
|
name 'Redmine QBO plugin'
|
||||||
author 'Rick Barrette'
|
author 'Rick Barrette'
|
||||||
description 'A pluging for Redmine to connect with QuickBooks Online to create Time Activity Entries for billable hours logged when an Issue is closed'
|
description 'A pluging for Redmine to connect with QuickBooks Online to create Time Activity Entries for billable hours logged when an Issue is closed'
|
||||||
version '2026.3.16'
|
version '2026.8.1'
|
||||||
url 'https://github.com/rickbarrette/redmine_qbo'
|
url 'https://github.com/rickbarrette/redmine_qbo'
|
||||||
author_url 'https://barrettefabrication.com'
|
author_url 'https://barrettefabrication.com'
|
||||||
settings default: {empty: true}, partial: 'qbo/settings'
|
settings default: {empty: true}, partial: 'qbo/settings'
|
||||||
|
|||||||
@@ -16,9 +16,6 @@ module RedmineQbo
|
|||||||
# View User
|
# View User
|
||||||
def view_users_form(context={})
|
def view_users_form(context={})
|
||||||
|
|
||||||
# Update the users
|
|
||||||
#Employee.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 = context[:user]&.employee&.id
|
@selected = context[:user]&.employee&.id
|
||||||
|
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ module RedmineQbo
|
|||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
prepended do
|
prepended do
|
||||||
belongs_to :customer, class_name: 'Customer', foreign_key: :customer_id, optional: true
|
belongs_to :customer
|
||||||
belongs_to :customer_token, primary_key: :id, optional: true
|
belongs_to :customer_token
|
||||||
belongs_to :estimate, primary_key: :id, optional: true
|
belongs_to :estimate
|
||||||
has_and_belongs_to_many :invoices
|
has_and_belongs_to_many :invoices
|
||||||
|
|
||||||
before_save :titlize_subject
|
before_save :titlize_subject
|
||||||
|
|||||||
Reference in New Issue
Block a user