Fill the VIN on new estimates and invoices through a hook

New hook qbo_billing_default_vin, { customer:, issues: }: a blank estimate or invoice starts with the VIN
a plugin gives for the customer, and an invoice made from an estimate without a VIN gets the one for the
estimate's work orders. The editor only filled the VIN when the customer was changed or work orders were
imported, so pages opened with the customer already set started blank.

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 10:17:25 -04:00
1 parent 28538d4c7f
commit b84f39afce
4 files changed
+21 -1

No files matched your search

@@ -36,6 +36,7 @@ module RedmineQboBilling
customer_name: customer&.name,
email: customer_email(customer),
billing_address: customer_address(customer),
vin: RedmineQboBilling.default_vin(customer),
txn_date: user.today.iso8601,
expiration_date: default_expiration_date(user.today)&.iso8601,
sales_person: user.name,