Fix: Raise error if no QBO configuration is found in sync jobs

This commit is contained in:
2026-02-28 17:58:11 -05:00
parent 9b07ae7073
commit 8303dec501
5 changed files with 5 additions and 5 deletions

View File

@@ -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 # 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) def perform(full_sync: false, id: nil)
qbo = Qbo.first qbo = Qbo.first
return unless qbo raise "No QBO configuration found" unless qbo
log "Starting #{full_sync ? 'full' : 'incremental'} sync for customer ##{id || 'all'}..." log "Starting #{full_sync ? 'full' : 'incremental'} sync for customer ##{id || 'all'}..."

View File

@@ -14,7 +14,7 @@ class EmployeeSyncJob < ApplicationJob
def perform(full_sync: false, id: nil) def perform(full_sync: false, id: nil)
qbo = Qbo.first qbo = Qbo.first
return unless qbo raise "No QBO configuration found" unless qbo
log "Starting #{full_sync ? 'full' : 'incremental'} sync for employee ##{id || 'all'}..." log "Starting #{full_sync ? 'full' : 'incremental'} sync for employee ##{id || 'all'}..."

View File

@@ -14,7 +14,7 @@ class EstimateSyncJob < ApplicationJob
def perform(full_sync: false, id: nil, doc_number: nil) def perform(full_sync: false, id: nil, doc_number: nil)
qbo = Qbo.first 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'}..." log "Starting #{full_sync ? 'full' : 'incremental'} sync for estimate ##{id || doc_number || 'all'}..."

View File

@@ -14,7 +14,7 @@ class InvoiceSyncJob < ApplicationJob
def perform(full_sync: false, id: nil) def perform(full_sync: false, id: nil)
qbo = Qbo.first qbo = Qbo.first
return unless qbo raise "No QBO configuration found" unless qbo
log "Starting #{full_sync ? 'full' : 'incremental'} sync for invoice ##{id || 'all'}..." log "Starting #{full_sync ? 'full' : 'incremental'} sync for invoice ##{id || 'all'}..."

View File

@@ -43,7 +43,7 @@ module RedmineQbo
return unless closed? return unless closed?
return unless customer.present? return unless customer.present?
return unless assigned_to&.employee_id.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}" log "Enqueuing billing for issue ##{id}"
BillIssueTimeJob.perform_later(id) BillIssueTimeJob.perform_later(id)