From 8303dec50143c0a5f452e88b7e6001daa31846fe Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Sat, 28 Feb 2026 17:58:11 -0500 Subject: [PATCH] Fix: Raise error if no QBO configuration is found in sync jobs --- app/jobs/customer_sync_job.rb | 2 +- app/jobs/employee_sync_job.rb | 2 +- app/jobs/estimate_sync_job.rb | 2 +- app/jobs/invoice_sync_job.rb | 2 +- lib/redmine_qbo/patches/issue_patch.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/jobs/customer_sync_job.rb b/app/jobs/customer_sync_job.rb index 313e0bf..2a1bc19 100644 --- a/app/jobs/customer_sync_job.rb +++ b/app/jobs/customer_sync_job.rb @@ -15,7 +15,7 @@ class CustomerSyncJob < ApplicationJob # Perform a full sync of all customers, or an incremental sync of only those updated since the last sync def perform(full_sync: false, id: nil) qbo = Qbo.first - return unless qbo + raise "No QBO configuration found" unless qbo log "Starting #{full_sync ? 'full' : 'incremental'} sync for customer ##{id || 'all'}..." diff --git a/app/jobs/employee_sync_job.rb b/app/jobs/employee_sync_job.rb index 49a6e04..eb7f33c 100644 --- a/app/jobs/employee_sync_job.rb +++ b/app/jobs/employee_sync_job.rb @@ -14,7 +14,7 @@ class EmployeeSyncJob < ApplicationJob def perform(full_sync: false, id: nil) qbo = Qbo.first - return unless qbo + raise "No QBO configuration found" unless qbo log "Starting #{full_sync ? 'full' : 'incremental'} sync for employee ##{id || 'all'}..." diff --git a/app/jobs/estimate_sync_job.rb b/app/jobs/estimate_sync_job.rb index c163f33..138e7d5 100644 --- a/app/jobs/estimate_sync_job.rb +++ b/app/jobs/estimate_sync_job.rb @@ -14,7 +14,7 @@ class EstimateSyncJob < ApplicationJob def perform(full_sync: false, id: nil, doc_number: nil) qbo = Qbo.first - return unless qbo + raise "No QBO configuration found" unless qbo log "Starting #{full_sync ? 'full' : 'incremental'} sync for estimate ##{id || doc_number || 'all'}..." diff --git a/app/jobs/invoice_sync_job.rb b/app/jobs/invoice_sync_job.rb index 5a1c41a..3829214 100644 --- a/app/jobs/invoice_sync_job.rb +++ b/app/jobs/invoice_sync_job.rb @@ -14,7 +14,7 @@ class InvoiceSyncJob < ApplicationJob def perform(full_sync: false, id: nil) qbo = Qbo.first - return unless qbo + raise "No QBO configuration found" unless qbo log "Starting #{full_sync ? 'full' : 'incremental'} sync for invoice ##{id || 'all'}..." diff --git a/lib/redmine_qbo/patches/issue_patch.rb b/lib/redmine_qbo/patches/issue_patch.rb index 590a697..b09170d 100644 --- a/lib/redmine_qbo/patches/issue_patch.rb +++ b/lib/redmine_qbo/patches/issue_patch.rb @@ -43,7 +43,7 @@ module RedmineQbo return unless closed? return unless customer.present? return unless assigned_to&.employee_id.present? - return unless Qbo.first + raise "No QBO configuration found" unless qbo.first log "Enqueuing billing for issue ##{id}" BillIssueTimeJob.perform_later(id)