Fold redmine_qbo_billing into redmine_qbo

Estimates, invoices and payments written in Redmine, issues from estimates,
and the QuickBooks product/service list and accounts are now part of this
plugin (the RedmineQboBilling code, its controllers, views, strings and
permissions), so there's one plugin and one version instead of two that had
to match.

- The customer page, estimate and invoice lists and the issue page render the
  Create Estimate / Create invoice / Receive payment and Edit links directly;
  the hooks that only existed to let billing add them are gone. Users without
  the billing permissions still get the links to QuickBooks.
- Migrations 043-046 create the items and accounts tables and the estimate
  line links, skipping whatever an existing database already has
  (redmine_qbo_lineitems' tables are used as they are), and copy calendar's
  existing estimate line links in.
- The billing settings are a section of this plugin's settings page.
- The hooks other plugins use stay: qbo_billing_issue_values,
  qbo_billing_validate, qbo_billing_issue_defaults, qbo_billing_issues_created
  and view_qbo_estimate_contextual.
- rake redmine_qbo:relate_estimate_issues

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-30 23:47:01 -04:00
1 parent 48a4185c16
commit 9121e079a0
67 files changed
+5570 -19

No files matched your search

+8 -8
View File
@@ -4,18 +4,18 @@
id: 'dynamic-new-issue-link', class: 'icon icon-add', target: :_blank %>
<%# Plugins add their customer actions here (e.g. redmine_qbo_calendar's Add appointment) %>
<%= call_hook :view_customers_show_contextual, { customer: @customer } %>
<%# A plugin can replace the Create Estimate link (e.g. redmine_qbo_estimates writes estimates in Redmine) %>
<% estimate_link = call_hook(:view_customers_show_estimate_link, { customer: @customer }) %>
<% if estimate_link.present? %>
<%= estimate_link %>
<%# Estimates, invoices and payments are written here; users without those permissions get QuickBooks' screens %>
<% if RedmineQboBilling.writer? %>
<%= render partial: 'qbo_estimates/customer_link', locals: { customer: @customer } %>
<% else %>
<%= link_to sprite_icon('document', l(:label_create_estimate)), "https://qbo.intuit.com/app/estimate?nameId=#{@customer.id}",
class: 'icon icon-document', target: :_blank %>
<% end %>
<%# A plugin can replace the Create Payment link (e.g. redmine_qbo_billing receives payments in Redmine) %>
<% payment_link = call_hook(:view_customers_show_payment_link, { customer: @customer }) %>
<% if payment_link.present? %>
<%= payment_link %>
<% if RedmineQboBilling.invoice_writer? %>
<%= render partial: 'qbo_invoices/customer_link', locals: { customer: @customer } %>
<% end %>
<% if RedmineQboBilling.payment_receiver? %>
<%= link_to sprite_icon('add', l(:button_receive_payment)), new_qbo_payment_path(customer_id: @customer.id), class: 'icon icon-add' %>
<% else %>
<%= link_to sprite_icon('add', l(:label_create_payment)), "https://qbo.intuit.com/app/recvpayment?nameId=#{@customer.id}",
class: 'icon icon-add', target: :_blank %>