Handle QuickBooks custom fields generically; no vehicle code left

redmine_qbo now works the same for any business; vehicle behaviour lives in redmine_qbo_vehicles.

- Every enabled QuickBooks text custom field gets a box on the estimate/invoice editor (the sales person
  is still filled in automatically). Forms keep custom_fields { field_id => value } instead of vin and
  mileage; Duplicate and Create invoice copy them all.
- Company: custom_field_matching(pattern) and editable_custom_fields; the VIN and Mileage name patterns
  are gone.
- Hooks are keyed by custom field id: qbo_billing_field_options (box suggestions) and
  qbo_billing_field_defaults (values for a document's work orders) replace the VIN hooks;
  qbo_billing_issue_values returns { field_id => { issue_id => value } }.
- Editor script API for plugins: window.qboEditor, the qbo:customer-changed and qbo:imported events, and
  the view_qbo_estimate_form_bottom hook to add a script. The VIN/mileage filling and the several-vehicle
  warning moved to redmine_qbo_vehicles.
- EstimateWriter.create_estimate(custom_fields:), custom_field_value and custom_field_values replace
  the vin/mileage arguments and vin_for.

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-31 11:34:10 -04:00
1 parent cb705d9525
commit 388ac915d7
14 files changed
+192 -164

No files matched your search

-3
View File
@@ -167,7 +167,6 @@ en:
label_subtotal: "Subtotal"
label_tax: "Tax"
label_taxable_subtotal: "Taxable subtotal"
label_vin: "VIN"
notice_estimate_saved_and_sent: "Estimate #%{number} saved in QuickBooks and emailed to %{email}"
notice_estimate_saved_in_quickbooks: "Estimate #%{number} saved in QuickBooks"
@@ -183,7 +182,6 @@ en:
text_estimate_send_needs_email: "Enter the customer's email to send it."
text_memo_is_private: "Internal, not shown to the customer"
text_no_sales_person_field: "QuickBooks isn't sharing a text custom field named Sales Person, so this isn't saved."
text_no_vin_field: "QuickBooks isn't sharing a text custom field named VIN."
text_quickbooks_custom_fields_found: "Custom fields QuickBooks shares with apps: %{fields}. QuickBooks only shares its first three text fields; a field it doesn't list in its settings shows up here once it's filled in on an estimate."
text_quickbooks_settings_unavailable: "QuickBooks' estimate settings couldn't be read, so custom fields and the default message are missing. Check the QuickBooks connection."
text_separate_emails_with_comma: "Separate emails with a comma"
@@ -254,7 +252,6 @@ en:
notice_invoice_sent: "Invoice #%{number} emailed to %{email}"
text_email_invoice_confirmation: "Email invoice #%{number} to %{email}?"
text_invoice_from_estimate: "Made from estimate #%{number}. The estimate is closed when the invoice is saved."
text_invoice_many_vehicles: "These work orders are for more than one vehicle:"
text_line_bills_time: "Bills a QuickBooks time activity; saving marks the time as billed"
text_replace_lines: "Tick the lines the time replaces (e.g. the estimate's labor lines). The time goes where the first ticked line is."