Compare commits

...

7 Commits

20 changed files with 12 additions and 100 deletions

View File

@@ -110,7 +110,7 @@ class CustomersController < ApplicationController
begin begin
@customer = Customer.find_by_id(params[:id]) @customer = Customer.find_by_id(params[:id])
if @customer.update(allowed_params) if @customer.update(allowed_params)
flash[:notice] = tv :notice_customer_updated flash[:notice] = t :notice_customer_updated
redirect_to @customer redirect_to @customer
else else
redirect_to edit_customer_path redirect_to edit_customer_path

View File

@@ -92,10 +92,10 @@ class QboController < ApplicationController
data = params.as_json data = params.as_json
end end
# Process the information # Process the information
entities = data['eventNotifications'][0]['dataChangeEvent'][:entities] entities = data['eventNotifications'][0]['dataChangeEvent']['entities']
entities.each do |entity| entities.each do |entity|
id = entity[:id].to_i id = entity['id'].to_i
name = entity[:name] name = entity['name']
logger.info "Casting #{name.constantize} to obj" logger.info "Casting #{name.constantize} to obj"
@@ -106,7 +106,7 @@ class QboController < ApplicationController
obj.destroy(entity['deletedId']) if entity['deletedId'] obj.destroy(entity['deletedId']) if entity['deletedId']
#Check to see if we are deleting a record #Check to see if we are deleting a record
if entity[:operation].eql? "Delete" if entity['operation'].eql? "Delete"
obj.destroy(id) obj.destroy(id)
#if not then update! #if not then update!
else else

View File

@@ -13,6 +13,7 @@ module AuthHelper
def require_user def require_user
return unless session[:token].nil? return unless session[:token].nil?
if !User.current.logged? if !User.current.logged?
flash[:error] = t :notice_forbidden
render_403 render_403
end end
end end
@@ -27,6 +28,7 @@ module AuthHelper
def check_permission(permission) def check_permission(permission)
if !allowed_to?(permission) if !allowed_to?(permission)
flash[:error] = t :notice_forbidden
render_403 render_403
end end
end end
@@ -34,6 +36,7 @@ module AuthHelper
def global_check_permission(permission) def global_check_permission(permission)
if !globaly_allowed_to?(permission) if !globaly_allowed_to?(permission)
flash[:error] = t :notice_forbidden
render_403 render_403
end end
end end

View File

@@ -1,4 +1,4 @@
<%= 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 %> <%= 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}&dates=#{Time.now.strftime("%Y%m%d")}T090000/#{Time.now.strftime("%Y%m%d")}T170000", target: :_blank %>
<br/> <br/>
<br/> <br/>

View File

View File

@@ -98,4 +98,5 @@ en:
notice_invoice_updated: "Invoice updated in Quickbooks" notice_invoice_updated: "Invoice updated in Quickbooks"
notice_invoice_not_found: "Invoice not found" notice_invoice_not_found: "Invoice not found"
notice_forbidden: "You do not have permission to access this resource" notice_forbidden: "You do not have permission to access this resource"
notice_issue_not_found: "Issue not found" notice_issue_not_found: "Issue not found"
customer_details: "Customer Details"

View File

@@ -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 '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 '2026.1.7' version '2026.1.8'
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'

View File

View File

@@ -1,8 +0,0 @@
require File.expand_path('../../test_helper', __FILE__)
class EstimateControllerTest < ActionController::TestCase
# Replace this with your real tests.
def test_truth
assert true
end
end

View File

@@ -1,8 +0,0 @@
require File.expand_path('../../test_helper', __FILE__)
class InvoiceControllerTest < ActionController::TestCase
# Replace this with your real tests.
def test_truth
assert true
end
end

View File

@@ -1,18 +0,0 @@
#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.
require File.expand_path('../../test_helper', __FILE__)
class QboControllerTest < ActionController::TestCase
# Replace this with your real tests.
def test_truth
assert true
end
end

View File

@@ -1,2 +0,0 @@
# Load the Redmine helper
require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper')

View File

@@ -1,9 +0,0 @@
require File.expand_path('../../test_helper', __FILE__)
class CustomerTokenTest < ActiveSupport::TestCase
# Replace this with your real tests.
def test_truth
assert true
end
end

View File

@@ -1,19 +0,0 @@
#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.
require File.expand_path('../../test_helper', __FILE__)
class QboCustomersTest < ActiveSupport::TestCase
# Replace this with your real tests.
def test_truth
assert true
end
end

View File

@@ -1,9 +0,0 @@
require File.expand_path('../../test_helper', __FILE__)
class EmployeeTest < ActiveSupport::TestCase
# Replace this with your real tests.
def test_truth
assert true
end
end

View File

@@ -1,19 +0,0 @@
#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.
require File.expand_path('../../test_helper', __FILE__)
class QboTest < ActiveSupport::TestCase
# Replace this with your real tests.
def test_truth
assert true
end
end