Estimate hours rule, linked issues, issue creation via redmine_qbo_billing

- An appointment's hours can't be less than its estimate's labor hours
  (checked when the estimate or hours change, so the quick status buttons
  still work on older appointments). Picking an estimate on the form, or
  arriving from an estimate page, raises the hours to match.
- The appointment page lists the issues linked to its estimate.
- Creating issues from an estimate moved to redmine_qbo_billing (now
  required): Create Issues from Estimate opens its page with this
  appointment's dates, technician, vehicle and project (via
  qbo_billing_issue_defaults). The builder, preview page, settings and rake
  task are removed here; the old settings stay registered so billing can
  read them until its own are saved.

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-30 23:11:33 -04:00
1 parent 3b753c1f35
commit fc503fca68
16 files changed
+135 -764

No files matched your search

@@ -48,6 +48,22 @@
<%= submit_tag l(:button_save) %>
<% end %>
<%# When an estimate is picked, the hours are raised to at least its labor hours %>
<%= javascript_tag do %>
$(function () {
var $estimate = $('#appointment_estimate_id');
var $hours = $('#customer_appointment_estimated_hours');
if (!$estimate.length || !$hours.length) return;
$estimate.on('change', function () {
if (!this.value) return;
$.getJSON('<%= j estimate_hours_customer_appointments_path %>', { estimate_id: this.value }).done(function (data) {
var hours = parseInt(data.hours, 10) || 0;
if (hours > (parseInt($hours.val(), 10) || 0)) $hours.val(hours);
});
});
});
<% end %>
<!-- Modal Container for Inline Customer Creation -->
<div id="new-customer-dialog" style="display:none;" title="<%= t(:label_new_customer, default: 'New Customer') %>">
<!-- The form will be dynamically loaded via JS or rendered here -->