mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-11-17 18:20:36 -05:00
Invoice page hook for plugin actions
:view_qbo_invoice_contextual, { invoice_id:, customer_id:, doc_number: }
in the invoice page's top-right actions, like the estimate page's hook
(used by redmine_qbo_labels' Print label).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
90adb96d54
commit
5c48646041
2 files changed
+3
No files matched your search
@@ -235,6 +235,7 @@ Hook|:qbo_billing_field_options, { customer: } | Return `{ field_id => [{ value:
|
||||
View|:view_qbo_estimate_form_bottom, { form:, document: } | Add your plugin's script to the estimate/invoice editor. It can use `window.qboEditor` (`field(id)`, `fieldNamed(/name/)`, `setFieldOptions(id, options)`) and listen for `qbo:customer-changed` and `qbo:imported` on the form (redmine_qbo_vehicles fills the VIN and mileage)
|
||||
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:, custom_fields:, doc_number: } | Adds links to an estimate page's action area (e.g. redmine_qbo_calendar's Add appointment); `custom_fields` is `{ field_id => value }`
|
||||
View Hook|:view_qbo_invoice_contextual, { invoice_id:, customer_id:, doc_number: } | Adds links to an invoice page's action area (e.g. redmine_qbo_labels' Print label)
|
||||
|
||||
Other plugins create estimates with `RedmineQboBilling::EstimateWriter.create_estimate(customer:, lines:, private_note:, custom_fields:, user:)`; `custom_fields` is `{ field_id => value }`, and each line is a hash of `description`, `item_id`, `quantity`, `rate` and `taxable`.
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<% html_title "#{l(:label_invoice)} ##{@form.doc_number}" %>
|
||||
|
||||
<div class="contextual">
|
||||
<%# Plugins add invoice actions here (e.g. redmine_qbo_labels' Print label) %>
|
||||
<%= call_hook :view_qbo_invoice_contextual, { invoice_id: @form.id, customer_id: @form.customer_id, doc_number: @form.doc_number } %>
|
||||
<% if RedmineQboBilling.payment_receiver? && @form.balance.to_d > 0 %>
|
||||
<%= link_to sprite_icon('add', l(:button_receive_payment)), new_qbo_payment_path(customer_id: @form.customer_id), class: 'icon icon-add' %>
|
||||
<% end %>
|
||||
|
||||
Reference in new issue
Block a user