mirror of
https://github.com/rickbarrette/redmine_qbo_vehicles.git
synced 2026-11-18 02:40:37 -05:00
Match the estimate's VIN with redmine_qbo's enhanced read; no VIN for new documents
- Vehicles::EstimateVehicle.vin uses RedmineQboBilling::EstimateWriter.vin_for, which includes QuickBooks' newer custom fields; the local estimate's details don't, so the VIN never matched and issues created from an estimate got no vehicle. - qbo_billing_default_vin only answers for work orders (no customer-vehicle fallback), so new estimates and invoices start blank. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
This commit is contained in:
3 files changed
+8
-15
No files matched your search
@@ -14,10 +14,11 @@ module Vehicles
|
||||
module EstimateVehicle
|
||||
module_function
|
||||
|
||||
# The VIN on the estimate, or nil
|
||||
# The VIN on the estimate, or nil. Read by redmine_qbo with QuickBooks' newer custom fields: the local
|
||||
# estimate's details leave them out, so a VIN field added recently in QuickBooks would never match.
|
||||
def vin(estimate)
|
||||
company = RedmineQboBilling::Company
|
||||
RedmineQboBilling::EstimateWriter.custom_value(estimate.details, company.vin_field, company::VIN_NAME).to_s.strip.presence
|
||||
return nil unless estimate
|
||||
RedmineQboBilling::EstimateWriter.vin_for(estimate.id)
|
||||
rescue StandardError
|
||||
nil
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user