mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-04-02 16:21:58 -04:00
Refactor: Update QBO connection handling to use QboConnectionService for consistency across services and controllers
This commit is contained in:
@@ -65,7 +65,7 @@ class EstimateController < ApplicationController
|
||||
|
||||
# Renders the estimate PDF or redirects with an error if rendering fails.
|
||||
def render_pdf(estimate)
|
||||
pdf, ref = EstimatePdfService.new(qbo: Qbo.first).fetch_pdf(doc_ids: [estimate.id])
|
||||
pdf, ref = EstimatePdfService.new(qbo: QboConnectionService.current!).fetch_pdf(doc_ids: [estimate.id])
|
||||
send_data( pdf, filename: "estimate #{ref}.pdf", disposition: :inline, type: "application/pdf" )
|
||||
rescue StandardError => e
|
||||
log "PDF render failed for Estimate #{estimate&.id}: #{e.message}"
|
||||
|
||||
Reference in New Issue
Block a user