22 Commits

Author SHA1 Message Date
55d00f9005 Added sandbox to settings 2025-07-08 21:01:48 -04:00
eba3f529f8 Set version & requirements 2025-07-08 20:19:19 -04:00
19733c3f8c Added gem rexml 2025-06-16 23:41:30 -04:00
f22795ac90 Moved strings for notices to en.yml 2025-06-16 22:56:54 -04:00
166a9ee31b Removed has_many purchases, table doesn't exist anymore 2025-06-16 22:54:47 -04:00
4d85c24872 generate redirect_uri protocol based one site settings 2025-06-16 22:30:30 -04:00
43c7374c42 Load oauth key & secret when constructing client, not on application start up 2025-06-16 22:16:58 -04:00
60857e9dca generate redirect_uri protocol based one site settings 2025-06-16 22:15:42 -04:00
d38f0d6ac1 Merge branch 'master' of https://github.com/rickbarrette/redmine_qbo 2025-06-15 19:03:59 -04:00
f6da031e72 include Redmine::I18n 2025-06-15 18:59:00 -04:00
9779437c00 Log token refresh 2024-12-19 09:41:53 -05:00
1a37926628 Log error not info 2024-12-19 09:36:23 -05:00
dac9a7c756 Started Support for Redmine 6 2024-12-12 06:00:36 -05:00
9ac1261ed0 Sort by id not doc_number
This fixes the bug where documents were displayed out of order
2024-08-30 09:19:58 -04:00
9b69d3f728 Added link to customer profile for appointments 2024-08-26 11:00:50 -04:00
a5de879260 Fixed formatting 2024-08-26 08:41:56 -04:00
6464e1cbc6 Added actions 2024-08-26 07:58:40 -04:00
7f3a94229a Create Estimate 2024-08-26 07:58:05 -04:00
395e0117fb Update _actions.html.erb 2024-08-26 07:57:10 -04:00
e04d363e42 Added label for actions 2024-08-26 07:56:06 -04:00
3b6c0d4a70 Removed Action links 2024-08-26 07:52:27 -04:00
d1f6ccd9cb Create _actions.html.erb 2024-08-26 07:51:38 -04:00
30 changed files with 134 additions and 106 deletions

View File

@@ -7,6 +7,7 @@ gem 'nhtsa_vin'
gem 'will_paginate'
gem 'rails-jquery-autocomplete'
gem 'jquery-ui-rails'
gem 'rexml'
group :assets do
gem 'coffee-rails'

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2022 rick barrette
#Copyright (c) 2024 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:
#
@@ -10,7 +10,6 @@
# This controller class will handle map management
class CustomersController < ApplicationController
unloadable
include AuthHelper
helper :issues

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2022 rick barrette
#Copyright (c) 2024 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:
#
@@ -8,7 +8,6 @@
#
#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 EstimateController < ApplicationController
unloadable
include AuthHelper

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2023 rick barrette
#Copyright (c) 2024 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:
#
@@ -8,7 +8,6 @@
#
#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 InvoiceController < ApplicationController
unloadable
include AuthHelper

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2023 rick barrette
#Copyright (c) 2016 - 2025 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:
#
@@ -9,7 +9,6 @@
#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 QboController < ApplicationController
unloadable
require 'openssl'
@@ -26,8 +25,8 @@ class QboController < ApplicationController
# Called when the user requests that Redmine to connect to QBO
#
def authenticate
redirect_uri = "https://" + Setting.host_name + qbo_oauth_callback_path
logger.info "redirect_uri: " + redirect_uri
redirect_uri = "#{Setting.protocol}://#{Setting.host_name + qbo_oauth_callback_path}"
logger.info "redirect_uri: #{redirect_uri}"
oauth2_client = Qbo.construct_oauth2_client
grant_url = oauth2_client.auth_code.authorize_url(redirect_uri: redirect_uri, response_type: "code", state: SecureRandom.hex(12), scope: "com.intuit.quickbooks.accounting")
redirect_to grant_url
@@ -40,7 +39,7 @@ class QboController < ApplicationController
if params[:state].present?
oauth2_client = Qbo.construct_oauth2_client
# use the state value to retrieve from your backend any information you need to identify the customer in your system
redirect_uri = "https://" + Setting.host_name + qbo_oauth_callback_path
redirect_uri = "#{Setting.protocol}://#{Setting.host_name + qbo_oauth_callback_path}"
if resp = oauth2_client.auth_code.get_token(params[:code], redirect_uri: redirect_uri)
# Remove the last authentication information
@@ -52,9 +51,9 @@ class QboController < ApplicationController
qbo.refresh_token!
if qbo.save!
redirect_to qbo_sync_path, :flash => { :notice => "Successfully connected to Quickbooks" }
redirect_to qbo_sync_path, :flash => { :notice => I18n.t(:label_connected) }
else
redirect_to plugin_settings_path(:redmine_qbo), :flash => { :error => "Error" }
redirect_to plugin_settings_path(:redmine_qbo), :flash => { :error => I18n.t(:label_error) }
end
end
@@ -66,9 +65,9 @@ class QboController < ApplicationController
i = Issue.find_by_id params[:id]
if i.customer
i.bill_time
redirect_to i, :flash => { :notice => "Successfully Billed #{i.customer.name}" }
redirect_to i, :flash => { :notice => I18n.t(:label_billed_success) + i.customer.name }
else
redirect_to i, :flash => { :error => "Cannot bill without a customer assigned" }
redirect_to i, :flash => { :error => I18n.t(:label_billing_error) }
end
end
@@ -153,6 +152,6 @@ class QboController < ApplicationController
ActiveRecord::Base.connection.close
end
redirect_to :home, :flash => { :notice => "Syncing Quickbooks" }
redirect_to :home, :flash => { :notice => I18n.t(:label_syncing) }
end
end

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2022 rick barrette
#Copyright (c) 2024 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:
#
@@ -10,7 +10,6 @@
# This controller class will handle map management
class VehiclesController < ApplicationController
unloadable
include AuthHelper

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2023 rick barrette
#Copyright (c) 2016 - 2025 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:
#
@@ -11,9 +11,6 @@
module QuickbooksOauth
extend ActiveSupport::Concern
OAUTH_CONSUMER_KEY = Setting.plugin_redmine_qbo['settingsOAuthConsumerKey']
OAUTH_CONSUMER_SECRET = Setting.plugin_redmine_qbo['settingsOAuthConsumerSecret']
#== Instance Methods
def perform_authenticated_request(&block)
@@ -21,7 +18,7 @@ module QuickbooksOauth
begin
yield oauth_access_token
rescue OAuth2::Error, Quickbooks::AuthorizationFailure => ex
Rails.logger.info("QuickbooksOauth.perform: #{ex.message}")
Rails.logger.error("QuickbooksOauth.perform: #{ex.message}")
# to prevent an infinite loop here keep a counter and bail out after N times...
attempts += 1
@@ -36,6 +33,7 @@ module QuickbooksOauth
end
def refresh_token!
Rails.logger.info("QuickbooksOauth.refresh_token!")
t = oauth_access_token
refreshed = t.refresh!
@@ -45,6 +43,8 @@ module QuickbooksOauth
oauth2_refresh_token_expires_at = 100.days.from_now
end
Rails.logger.info("QuickbooksOauth.refresh_token!: #{oauth2_refresh_token_expires_at}")
update!(
oauth2_access_token: refreshed.token,
oauth2_access_token_expires_at: Time.at(refreshed.expires_at),
@@ -68,12 +68,20 @@ module QuickbooksOauth
module ClassMethods
def construct_oauth2_client
oauth_consumer_key = Setting.plugin_redmine_qbo['settingsOAuthConsumerKey']
oauth_consumer_secret = Setting.plugin_redmine_qbo['settingsOAuthConsumerSecret']
# Are we are playing in the sandbox?
Quickbooks.sandbox_mode = Setting.plugin_redmine_qbo['sandbox'] ? true : false
logger.info "Sandbox mode: #{Quickbooks.sandbox_mode}"
options = {
site: "https://appcenter.intuit.com/connect/oauth2",
authorize_url: "https://appcenter.intuit.com/connect/oauth2",
token_url: "https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer"
}
OAuth2::Client.new(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET, options)
OAuth2::Client.new(oauth_consumer_key, oauth_consumer_secret, options)
end
end

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2023 rick barrette
#Copyright (c) 2016 - 2025 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:
#
@@ -9,10 +9,8 @@
#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 Customer < ActiveRecord::Base
unloadable
has_many :issues
has_many :purchases
has_many :invoices
has_many :estimates
has_many :vehicles

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2022 rick barrette
#Copyright (c) 2024 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:
#
@@ -9,7 +9,7 @@
#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 CustomerToken < ActiveRecord::Base
unloadable
has_many :issues
validates_presence_of :issue_id
before_create :generate_token, :generate_expire_date

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2023 rick barrette
#Copyright (c) 2024 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:
#
@@ -9,7 +9,7 @@
#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 Employee < ActiveRecord::Base
unloadable
has_many :users
validates_presence_of :id, :name

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2023 rick barrette
#Copyright (c) 2024 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:
#
@@ -9,7 +9,6 @@
#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 Estimate < ActiveRecord::Base
unloadable
has_and_belongs_to_many :issues
belongs_to :customer

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2023 rick barrette
#Copyright (c) 2024 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:
#
@@ -9,7 +9,7 @@
#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 Invoice < ActiveRecord::Base
unloadable
has_and_belongs_to_many :issues
belongs_to :customer
validates_presence_of :doc_number, :id, :customer_id, :txn_date

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2023 rick barrette
#Copyright (c) 2016 - 2025 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:
#
@@ -9,9 +9,9 @@
#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 Qbo < ActiveRecord::Base
unloadable
include QuickbooksOauth
include Redmine::I18n
# Updates last sync time stamp
def self.update_time_stamp

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2022 rick barrette
#Copyright (c) 2024 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:
#
@@ -10,8 +10,6 @@
class Vehicle < ActiveRecord::Base
unloadable
belongs_to :customer
has_many :issues, :foreign_key => 'vehicles_id'

View File

@@ -0,0 +1,11 @@
<%= link_to t(:label_appointment), "https://calendar.google.com/calendar/render?action=TEMPLATE&text=#{@customer.name}+-&details=#{ link_to "Customer Details", "https://#{Setting.host_name}#{customer_path @customer.id}"}%0A#{@customer.primary_phone}&dates=#{Time.now.strftime("%Y%m%d")}T090000/#{Time.now.strftime("%Y%m%d")}T170000", target: :_blank %>
<br/>
<br/>
<%= link_to t(:label_create_estimate), "https://qbo.intuit.com/app/estimate?nameId=#{@customer.id}", target: :_blank %>
<br/>
<br/>
<%= button_to t(:label_edit_customer), edit_customer_path(@customer), method: :get%>

View File

@@ -42,10 +42,5 @@
</tr>
</tbody>
</table>
<div style="float: right;">
<%= button_to t(:label_edit_customer), edit_customer_path(customer), method: :get%>
<%= link_to t(:label_appointment), "https://calendar.google.com/calendar/render?action=TEMPLATE&text=#{customer.name}+-&details=#{customer.primary_phone}&dates=#{Time.now.strftime("%Y%m%d")}T090000/#{Time.now.strftime("%Y%m%d")}T170000", target: :_blank %>
</div>
<br/>
<br/>

View File

@@ -7,7 +7,22 @@
<h4><%=t(:label_details)%>:</h4>
<!-- Customer Info -->
<div class="splitcontent">
<div class="splitcontentleft">
<h4><%=t(:label_customer)%>:</h4>
<%= render :partial => 'customers/details', locals: {customer: @customer} %>
</div>
<div class="splitcontentleft">
<h4><%=t(:label_actions)%>:</h4>
<%= render :partial => 'customers/actions', locals: {customer: @customer} %>
</div>
</div>
<!-- QBO Info -->
<div class="splitcontent">
<div class="splitcontentleft">

View File

@@ -1,6 +1,6 @@
<% if @customer.present? %>
<% @customer.estimates.order(doc_number: :desc).each do |estimate| %>
<% @customer.estimates.order(id: :desc).each do |estimate| %>
<div class="row">
<b><%= link_to "##{estimate.doc_number}", estimate_path(estimate), target: :_blank %></b> <%= estimate.txn_date %>
</div>

View File

@@ -1,6 +1,6 @@
<% if @customer.present? %>
<% @customer.invoices.order(doc_number: :desc).each do |invoice| %>
<% @customer.invoices.order(id: :desc).each do |invoice| %>
<div class="row">
<b><%= link_to "##{invoice.doc_number}", invoice_path(invoice), target: :_blank %></b> <%= invoice.txn_date %>
</div>

View File

@@ -57,6 +57,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
</td>
</tr>
<tr>
<th><%=t(:label_sandbox)%></th>
<td>
<%= check_box_tag 'settings[sandbox]', @settings['sandbox'], @settings['sandbox'] %>
</td>
</tr>
<tr>
<th><%=t(:label_oauth_expires)%></th>
<td><%= if Qbo.exists? then Qbo.first.oauth2_access_token_expires_at end %>

View File

@@ -90,4 +90,7 @@ en:
label_oauth2_refresh_token_expires_at: "Refresh Token Expires At"
label_name: "Name"
label_appointment: "Add Appointment"
label_actions: "Actions"
label_create_estimate: "Create Estimate"
label_syncing: "Syncing Quickbooks"
label_sandbox: "Sandbox"

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2023 rick barrette
#Copyright (c) 2024 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:
#
@@ -9,7 +9,9 @@
#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 AddTxnDates < ActiveRecord::Migration[5.1]
def change
begin
add_column :qbo_invoices, :txn_date, :date
add_column :qbo_estimates, :txn_date, :date
@@ -45,6 +47,9 @@ class AddTxnDates < ActiveRecord::Migration[5.1]
}
}
end
rescue
logger.error "AddTxnDates Failed"
end
end
end

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2022 rick barrette
#Copyright (c) 2024 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:
#
@@ -10,6 +10,7 @@
class UpdateVehiclesTrim < ActiveRecord::Migration[5.1]
def change
begin
add_column :vehicles, :doors, :text
add_column :vehicles, :trim, :text
@@ -21,9 +22,11 @@ class UpdateVehiclesTrim < ActiveRecord::Migration[5.1]
vehicles.each { |vehicle|
vehicle.save!
}
}
end
rescue
logger.error "Failed to update vehicles"
end
end

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2023 rick barrette
#Copyright (c) 2016-2025 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:
#
@@ -22,11 +22,11 @@ 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 '2.1.1'
version '2025.7.1'
url 'https://github.com/rickbarrette/redmine_qbo'
author_url 'https://barrettefabrication.com'
settings :default => {'empty' => true}, :partial => 'qbo/settings'
requires_redmine :version_or_higher => '5.1.0'
requires_redmine :version_or_higher => '6.0.0'
# Add safe attributes for core models
Issue.safe_attributes 'customer_id'
@@ -39,9 +39,6 @@ Redmine::Plugin.register :redmine_qbo do
Project.safe_attributes 'customer_id'
Project.safe_attributes 'vehicle_id'
# We are playing in the sandbox
#Quickbooks.sandbox_mode = true
# set per_page globally
WillPaginate.per_page = 20

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2022 rick barrette
#Copyright (c) 2024 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:
#
@@ -15,7 +15,6 @@ module AttachmentsControllerPatch
def self.included(base)
base.class_eval do
unloadable # Send unloadable so it will not be unloaded in development
# check if login is globally required to access the application
def check_if_login_required

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2023 rick barrette
#Copyright (c) 2024 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:
#
@@ -21,7 +21,6 @@ module IssuePatch
# Same as typing in the class
base.class_eval do
unloadable # Send unloadable so it will not be unloaded in development
belongs_to :customer, primary_key: :id
belongs_to :customer_token, primary_key: :id
belongs_to :estimate, primary_key: :id

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2022 rick barrette
#Copyright (c) 2024 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:
#
@@ -23,7 +23,6 @@ module IssuesControllerPatch
def self.included(base)
base.class_eval do
unloadable # Send unloadable so it will not be unloaded in development
helper Helper
end

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2023 rick barrette
#Copyright (c) 2024 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:
#
@@ -16,10 +16,8 @@ module PdfPatch
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
unloadable # Send unloadable so it will not be unloaded in development
alias_method :issue_to_pdf, :issue_to_pdf_with_patch
alias_method :issue_to_pdf_with_patch, :issue_to_pdf
end
end

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2017 rick barrette
#Copyright (c) 2024 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:
#
@@ -21,7 +21,6 @@ module ProjectPatch
# Same as typing in the class
base.class_eval do
unloadable # Send unloadable so it will not be unloaded in development
belongs_to :customer, primary_key: :id
belongs_to :vehicle, primary_key: :id
end

View File

@@ -1,6 +1,6 @@
#The MIT License (MIT)
#
#Copyright (c) 2022 rick barrette
#Copyright (c) 2024 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:
#
@@ -20,7 +20,6 @@ module UserPatch
# Same as typing in the class
base.class_eval do
unloadable # Send unloadable so it will not be unloaded in development
belongs_to :employee, primary_key: :id
end
end