mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-11-17 18:20:36 -05:00
Mark an estimate Accepted when issues are created from it
Creating issues from an estimate means the work is going ahead, so a pending estimate becomes Accepted in QuickBooks (sparse update with today's accepted date, like closing an estimate) and the local estimate is synced, so its status badge updates. Accepted, Closed, Converted and Rejected estimates are left alone. A failure is logged and doesn't affect the created issues. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
This commit is contained in:
4 files changed
+32
-1
No files matched your search
@@ -96,7 +96,10 @@ class QboEstimatesController < ApplicationController
|
||||
|
||||
if created.any?
|
||||
Redmine::Hook.call_hook(:qbo_billing_issues_created, { estimate: @estimate, issues: created, params: params })
|
||||
# The work is going ahead: a pending estimate becomes Accepted in QuickBooks
|
||||
accepted = RedmineQboBilling::EstimateWriter.accept(@estimate.id, user: User.current)
|
||||
flash[:notice] = l(:notice_estimate_issues_created, count: created.size)
|
||||
flash[:notice] += " #{l(:notice_estimate_accepted, number: @estimate.doc_number)}" if accepted
|
||||
redirect_to @return_path
|
||||
else
|
||||
# Rebuild the fields so the form keeps what was entered
|
||||
|
||||
Reference in new issue
Block a user