Add preview page for creating issues from an estimate

- "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
This commit is contained in:
Claude committed 2026-10-28 20:34:06 -04:00
1 parent 73115da2b9
commit 184c1e2464
15 files changed
+613 -92

No files matched your search

+5 -1
View File
@@ -19,6 +19,10 @@ Redmine::Plugin.register :redmine_qbo_calendar do
author_url 'https://barrettefabrication.com'
requires_redmine version_or_higher: '7.0.0'
# Item codes: which QBO estimate items can become issues (e.g. Labor, Alignments)
settings default: { 'item_codes' => "Labor", 'default_tracker_id' => '' },
partial: 'settings/qbo_calendar_settings'
# Add Holidays index to the Redmine Administration Menu
menu :admin_menu, :holidays, { controller: 'holidays', action: 'index' }, caption: :label_holiday_plural, html: { class: 'icon icon-list' }
@@ -35,7 +39,7 @@ Redmine::Plugin.register :redmine_qbo_calendar do
permission :add_customer_appointments, { customer_appointments: [:new, :create, :customer_options] }, global: true
permission :edit_customer_appointments, { customer_appointments: [:edit, :update, :customer_options] }, global: true
permission :delete_customer_appointments, { customer_appointments: [:destroy] }, global: true
permission :create_customer_appointment_issues, { customer_appointments: [:create_issues] }, global: true
permission :create_customer_appointment_issues, { customer_appointments: [:issues_preview, :create_issues] }, global: true
# Register top menu items
menu :top_menu, :calendar, { controller: :calendars, action: :show }, caption: :label_calendar, if: Proc.new {User.current.logged?}