mirror of
https://github.com/rickbarrette/redmine_qbo_calendar.git
synced 2026-11-17 21:50:37 -05:00
Add appointment link on estimate pages
Listens for redmine_qbo_billing's view_qbo_estimate_contextual hook and adds an Add appointment link with the customer, the estimate, and the vehicle whose VIN matches the estimate's. The new appointment form uses the estimate and vehicle only when they belong to the customer. 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
+32
No files matched your search
@@ -19,6 +19,16 @@ module RedmineQboCalendar
|
||||
context[:hook_caller].render(partial: 'customer_appointments/customer_actions',
|
||||
locals: { customer: context[:customer] })
|
||||
end
|
||||
|
||||
# Adds "Add appointment" to an estimate's page in redmine_qbo_billing (:view_qbo_estimate_contextual),
|
||||
# with the customer, the estimate and the vehicle matching its VIN filled in
|
||||
def view_qbo_estimate_contextual(context = {})
|
||||
customer = Customer.find_by(id: context[:customer_id])
|
||||
return '' unless customer
|
||||
|
||||
context[:hook_caller].render(partial: 'customer_appointments/estimate_actions',
|
||||
locals: { customer: customer, estimate_id: context[:estimate_id], vin: context[:vin] })
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user