mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-11-17 18:20:36 -05:00
Blank VIN on new documents; VIN from attached estimates; read estimate VINs with newer custom fields
- New estimates and invoices start with a blank VIN; picking a customer only fills the VIN box's suggestions. - Importing an estimate whose work orders give no VIN fills the invoice's VIN box with the estimate's own VIN (open estimates now carry it). - EstimateWriter.vin_for reads an estimate's VIN with QuickBooks' newer custom fields (cached a minute). The local Estimate's details leave those out, so plugins matching the estimate's VIN to a vehicle never found one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
This commit is contained in:
5 files changed
+40
-20
No files matched your search
@@ -123,7 +123,7 @@ Estimates and invoices keep their number, date, customer, total and **man-hours*
|
||||
* **Undo import** puts the lines back until the invoice is saved.
|
||||
* **An estimate is billed once**: an estimate that's on an invoice (linked to one, or closed) or was rejected can't be made into an invoice or imported, and its page shows the invoice it's billed on. This is checked against QuickBooks again when the invoice is saved, so an estimate invoiced meanwhile (in another tab, by someone else, or in QuickBooks) stops the save.
|
||||
* Time lines are linked to their time activities, so QuickBooks marks the time as billed. Estimates the invoice was made from, or imported into it, are linked and closed when it's saved.
|
||||
* **VIN and mileage from the work orders**: the issues behind an invoice are the ones its time lines and lineitems estimates name. When they're imported, the VIN box takes their vehicle's VIN and a **Mileage** box (shown when QuickBooks has a text custom field named like "Mileage") takes the highest value of the issues' Mileage custom field, both supplied by redmine_qbo_vehicles. With redmine_qbo_vehicles, an invoice whose work orders are for more than one vehicle isn't saved.
|
||||
* **VIN and mileage from the work orders**: the issues behind an invoice are the ones its time lines and lineitems estimates name. When they're imported, the VIN box takes their vehicle's VIN (or, for an imported estimate whose work orders give none, the estimate's own VIN) and a **Mileage** box (shown when QuickBooks has a text custom field named like "Mileage") takes the highest value of the issues' Mileage custom field, both supplied by redmine_qbo_vehicles. With redmine_qbo_vehicles, an invoice whose work orders are for more than one vehicle isn't saved.
|
||||
* **Sales person**: an invoice credits the sales person on the estimate it was made from (the first linked estimate that names one); if none does, the user who writes the invoice.
|
||||
* Invoices with a payment applied open read-only. The due date is left to QuickBooks (from the customer's terms) unless one is picked. The "default message shown on invoices" fills in the message.
|
||||
|
||||
@@ -224,7 +224,7 @@ Hook|:qbo_billing_issue_defaults, { estimate:, params: } | Return `start_date`,
|
||||
Hook|:qbo_billing_build_issue, { issue:, estimate:, defaults: } | Set your plugin's own fields on each issue created from an estimate, before it's saved (redmine_qbo_vehicles sets the vehicle: the one in `defaults`, or the customer's vehicle whose VIN is on the estimate)
|
||||
View|:view_qbo_estimate_issues_form, { estimate:, defaults:, project: } | Draw your plugin's fields on the Create issues from estimate page, applied to every issue. Name them `issue_plugin_fields[name]`; the posted values reach `:qbo_billing_build_issue` in `defaults` (redmine_qbo_vehicles: the Vehicle, preselected from the estimate's VIN)
|
||||
Hook|:qbo_billing_issues_created, { estimate:, issues:, params: } | Called after issues are created from an estimate
|
||||
Hook|:qbo_billing_default_vin, { customer:, issues: } | Return the VIN a new estimate or invoice starts with (an invoice made from an estimate keeps the estimate's VIN; `issues` are that estimate's work orders). redmine_qbo_vehicles: the work orders' vehicle when they share one, else the customer's only vehicle
|
||||
Hook|:qbo_billing_default_vin, { customer:, issues: } | Return the VIN for a document's work orders: used when an invoice is made from an estimate that has no VIN (`issues` are the estimate's work orders). New estimates and invoices start with a blank VIN. redmine_qbo_vehicles: the work orders' vehicle when they share one
|
||||
Hook|:qbo_billing_vin_options, { customer: } | Return `[{ vin:, name: }, ...]` to suggest in the estimate/invoice VIN box; one suggestion fills an empty box (redmine_qbo_vehicles: the customer's vehicles)
|
||||
View|checkboxes with `data-new-issue-param="issue[field]"` on the customer page | Ticking one adds `issue[field]=value` to the New issue link, one per field (redmine_qbo's estimates, redmine_qbo_vehicles' vehicles)
|
||||
View Hook|:view_qbo_estimate_contextual, { estimate_id:, customer_id:, vin:, doc_number: } | Adds links to an estimate page's action area (e.g. redmine_qbo_calendar's Add appointment)
|
||||
|
||||
Reference in new issue
Block a user