mirror of
https://github.com/rickbarrette/redmine_qbo_calendar.git
synced 2026-11-17 13:50:36 -05:00
- "Create Issues from Estimate" now opens a preview listing each matching estimate line: include checkbox, subject (from the line description), tracker dropdown, template dropdown and estimated hours (from the line quantity) - Admins set which QBO item codes to look for (e.g. Labor, Alignments) and a default tracker in the plugin settings - Optional redmine_issue_templates support: templates supply the issue description; titles still come from the line description - New appointment_estimate_issues table records which issue came from which estimate line, so a line can't be turned into an issue twice; deleting the issue frees the line again - Creation is all-or-nothing; errors are shown on the preview page - Removes the old Labor-only create_issues_from_labor_lines code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
21 lines
1.4 KiB
Ruby
21 lines
1.4 KiB
Ruby
#The MIT License (MIT)
|
|
#
|
|
#Copyright (c) 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.
|
|
|
|
# Link between a QBO estimate line and the issue created from it.
|
|
class AppointmentEstimateIssue < ActiveRecord::Base
|
|
belongs_to :customer_appointment, optional: true
|
|
belongs_to :issue
|
|
|
|
validates :estimate_id, :line_id, presence: true
|
|
validates :line_id, uniqueness: { scope: :estimate_id }
|
|
|
|
before_create { self.created_on ||= Time.current }
|
|
end
|