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

+198 -1
View File
@@ -117,4 +117,201 @@ en:
notice_invoice_not_found: "Invoice not found"
notice_invoice_updated: "Invoice updated in QuickBooks"
notice_issue_not_found: "Issue not found"
warn_ru_sure: "Are you sure?"
warn_ru_sure: "Are you sure?"
# ---- Billing: estimates, invoices, payments, items and accounts ----
label_billing_settings: "Billing"
# Permissions
permission_write_estimates: "Write estimates"
permission_send_estimates: "Email estimates"
permission_write_invoices: "Write invoices"
permission_send_invoices: "Email invoices"
permission_create_estimate_issues: "Create issues from estimates"
permission_receive_payments: "Receive payments"
button_add_lines: "Add lines"
button_add_subtotal: "Add subtotal"
button_clear_all_lines: "Clear all lines"
button_duplicate: "Duplicate"
button_edit_estimate: "Edit estimate"
button_view_estimate: "View estimate"
button_email_estimate: "Email"
button_open_in_quickbooks: "Open in QuickBooks"
button_refresh_quickbooks_fields: "Refresh QuickBooks fields"
button_reload_estimate: "Reload the estimate"
button_save_and_send: "Save and send"
error_estimate_changed_in_quickbooks: "This estimate was changed in QuickBooks after you opened it, so it wasn't saved."
error_estimate_field_invalid: "%{field} is not valid"
error_estimate_linked_to_issues: "This estimate is linked to these issues, so it can't be changed here. Duplicate it to make a new estimate:"
error_estimate_has_bundles: "This estimate has bundles, which can only be edited in QuickBooks."
error_estimate_line_description: "Line %{line} needs a description, a product or service, or a rate"
error_estimate_line_number: "Line %{line} has a quantity or rate that isn't a number"
error_estimate_line_unmatched_item: "Line %{line}: pick \"%{name}\" from the product/service list"
error_estimate_needs_a_line: "Add at least one line"
error_estimate_needs_customer: "Choose a customer"
error_estimate_not_saved: "QuickBooks didn't save the estimate"
error_estimate_not_sent: "QuickBooks didn't send the estimate"
error_estimate_saved_not_sent: "It was saved but not sent: %{message}"
label_choose_a_customer: "Choose a customer"
label_customer_email: "Customer email"
label_discount_from_quickbooks: "Discount"
label_drag_to_reorder: "Drag to reorder"
label_estimate_date: "Estimate date"
label_estimate_expiration_days: "Estimates expire after (days)"
label_estimate_no: "Estimate no."
label_estimate_pdf: "PDF"
label_estimate_sent: "Sent"
label_estimate_total: "Total"
label_expiration_date: "Expiration date"
label_memo: "Memo"
label_message_on_estimate: "Message displayed on estimate"
label_new_estimate: "New estimate"
label_product_service: "Product/service"
label_qty: "Qty"
label_rate: "Rate"
label_sales_person: "Sales person"
label_sales_tax: "Sales tax"
label_subtotal: "Subtotal"
label_tax: "Tax"
label_taxable_subtotal: "Taxable subtotal"
label_vin: "VIN"
notice_estimate_saved_and_sent: "Estimate #%{number} saved in QuickBooks and emailed to %{email}"
notice_estimate_saved_in_quickbooks: "Estimate #%{number} saved in QuickBooks"
notice_estimate_sent: "Estimate #%{number} emailed to %{email}"
notice_estimate_settings_refreshed: "QuickBooks custom fields and estimate settings were read again"
text_assigned_by_quickbooks: "Assigned when saved"
text_clear_all_lines_confirmation: "Clear all lines?"
text_email_estimate_confirmation: "Email estimate #%{number} to %{email}?"
text_estimate_duplicated_from: "Copied from estimate #%{number}. It's saved as a new estimate."
text_estimate_closed: "This estimate is closed (it was turned into an invoice). Changes here won't change the invoice."
text_estimate_expiration_days: "New estimates get an expiration date this many days after the estimate date, e.g. 30. Leave blank for no expiration date."
text_estimate_reload: "Reloading shows the latest version from QuickBooks; changes made on this page will be lost."
text_estimate_send_needs_email: "Enter the customer's email to send it."
text_memo_is_private: "Internal, not shown to the customer"
text_no_sales_person_field: "QuickBooks isn't sharing a text custom field named Sales Person, so this isn't saved."
text_no_vin_field: "QuickBooks isn't sharing a text custom field named VIN."
text_quickbooks_custom_fields_found: "Custom fields QuickBooks shares with apps: %{fields}. QuickBooks only shares its first three text fields; a field it doesn't list in its settings shows up here once it's filled in on an estimate."
text_quickbooks_settings_unavailable: "QuickBooks' estimate settings couldn't be read, so custom fields and the default message are missing. Check the QuickBooks connection."
text_separate_emails_with_comma: "Separate emails with a comma"
text_tax_calculated_by_quickbooks: "Calculated by QuickBooks when saved"
# QuickBooks product/service list and income accounts
field_classification: "Classification"
field_sku: "SKU"
field_taxable: "Taxable"
field_unit_price: "Unit Price"
label_active: "Active"
label_account: "Account"
label_accounts: "Accounts"
label_account_count: "Number of Accounts:"
label_back: "Back"
label_default_account: "Default Item Income Account"
label_description: "Description"
label_edit_item: "Edit Item"
label_item: "Item"
label_item_count: "Item Count:"
label_item_new: "New Item"
label_items: "Items"
label_management_and_sync: "Management & Synchronization"
label_never_synced: "Never synced"
label_no: "No"
label_sync_now_accounts: "Sync Accounts"
label_sync_now_items: "Sync Items"
label_type: "Type"
label_yes: "Yes"
error_default_account_not_selected: "Select an account to make it the default."
notice_default_account_updated: "Default account updated."
# Invoices
button_add_to_invoice: "Add to invoice"
button_create_invoice: "Create invoice"
button_edit_invoice: "Edit invoice"
button_import_time_estimates: "Import time & estimates"
button_undo_import: "Undo import"
button_view_invoice: "View invoice"
error_estimate_already_invoiced: "Estimate #%{number} is already billed on invoice #%{invoice}."
error_estimate_closed_billed: "Estimate #%{number} is already billed (%{status})."
error_estimate_rejected: "Estimate #%{number} was rejected, so it can't be billed."
text_estimate_billed_on: "This estimate is billed on:"
error_invoice_changed_in_quickbooks: "This invoice was changed in QuickBooks after you opened it, so it wasn't saved."
error_invoice_has_bundles: "This invoice has bundles, which can only be edited in QuickBooks."
error_invoice_not_saved: "QuickBooks didn't save the invoice"
error_invoice_not_sent: "QuickBooks didn't send the invoice"
error_invoice_paid: "A payment has been applied to this invoice, so it can't be changed here."
label_billable_time: "Billable time"
label_due_date: "Due date"
label_invoice: "Invoice"
label_invoice_balance: "Balance due %{balance}"
label_invoice_date: "Invoice date"
label_invoice_no: "Invoice no."
label_invoice_paid: "Paid"
label_invoice_partially_paid: "Partially paid"
label_message_on_invoice: "Message displayed on invoice"
label_new_invoice: "New invoice"
label_open_estimates: "Open estimates"
label_replace_lines: "Replace these lines"
label_replaceable_items: "Replaced by imported time"
label_time_badge: "Time"
notice_invoice_saved_and_sent: "Invoice #%{number} saved in QuickBooks and emailed to %{email}"
notice_invoice_saved_in_quickbooks: "Invoice #%{number} saved in QuickBooks"
notice_invoice_sent: "Invoice #%{number} emailed to %{email}"
text_email_invoice_confirmation: "Email invoice #%{number} to %{email}?"
text_invoice_from_estimate: "Made from estimate #%{number}. The estimate is closed when the invoice is saved."
text_invoice_many_vehicles: "These work orders are for more than one vehicle:"
text_line_bills_time: "Bills a QuickBooks time activity; saving marks the time as billed"
text_replaceable_items: "Products/services that billable time can replace on invoices, e.g. Labor. Only invoice lines with these are offered under Replace these lines when time is imported. Leave empty to offer every line. Ctrl/Cmd-click to pick several."
text_replace_lines: "Tick the lines the time replaces (e.g. the estimate's labor lines). The time goes where the first ticked line is."
# Issues from estimates (moved from redmine_qbo_calendar)
button_create_estimate_issues_submit: "Create issues"
button_create_estimate_issues: "Create issues"
error_estimate_lines_already_created: "Some of these estimate lines were just turned into issues by someone else. Please review and try again."
error_no_estimate_lines_selected: "Select at least one estimate line"
error_no_labor_lines_found: "No lines with a description and a matching item code were found on the estimate"
label_default_project: "Default project"
label_default_tracker: "Default tracker"
label_estimate_issue_fields: "Issue fields"
label_estimate_issue_settings: "Issues from estimates"
label_estimate_item: "Item"
label_estimate_item_codes: "Estimate item codes"
label_estimate_line_already_created: "Already created"
label_issue_template: "Template"
label_no_issue_template: "(no template)"
notice_estimate_issues_created:
one: "1 issue created from the estimate"
other: "%{count} issues created from the estimate"
text_default_project_info: "Where issues from estimates are created when nothing else picks a project (e.g. an appointment's project). It can still be changed on the page."
text_default_tracker_info: "Pre-selected for each proposed issue. Leave blank to use the project's first tracker."
text_estimate_issue_fields_info: "Entered once and applied to every created issue whose tracker uses the field. Fields marked * are required by the selected trackers."
text_estimate_issues_hint: "The subject comes from the estimate line's description and estimated hours from its quantity. Edit anything before creating. New issues are related to each other and to issues already created from this estimate."
text_estimate_issues_template_hint: "The subject comes from the estimate line's description and estimated hours from its quantity. A template supplies the issue's description. New issues are related to each other and to issues already created from this estimate."
text_estimate_item_codes_info: "QBO item names that can become issues, one per line (e.g. Labor, Alignments). Matches the full item name or any part of a Category:Item name, ignoring case. Their quantities are also an estimate's labor hours (an appointment's hours can't be less)."
# Payments
button_print_payment: "Print"
button_receive_payment: "Receive payment"
button_save_payment: "Save payment"
error_payment_amount: "Enter the amount received"
error_payment_needs_method: "Choose the payment method"
error_payment_not_saved: "QuickBooks didn't save the payment"
label_no_open_invoices: "No open invoices: the payment is kept as a credit"
label_open_balance: "Open balance"
label_payment: "Payment"
label_payment_applied: "Payment"
label_payment_applies_to: "Applied to"
label_payment_date: "Payment date"
label_payment_deposit: "Deposit"
label_payment_method: "Payment method"
label_payment_reference: "Reference no."
label_payment_unapplied: "Unapplied (credit)"
notice_payment_not_found: "Payment not found in QuickBooks"
notice_payment_saved: "Payment of %{amount} saved in QuickBooks"
text_no_payment_methods: "QuickBooks' payment methods couldn't be read. Check the QuickBooks connection."
text_payment_deposit: "Keep it as a credit on the customer's account instead of paying open invoices"
text_payment_pick_invoices: "Tick invoices to fill in the amount and pay just those. With none ticked, the payment goes on the oldest invoices first."
text_payment_reference: "e.g. the check number"
text_payment_unapplied_deposit: "Not applied to any invoice: it's a credit on the customer's account."
+51 -1
View File
@@ -42,4 +42,54 @@ resources :customers do
get :autocomplete
get :sync
end
end
end
# Estimate writer pages. Kept under /qbo_estimates so they don't clash with redmine_qbo's /estimates/:id PDF route.
resources :qbo_estimates, only: [:new, :create, :edit, :update] do
member do
post :send_email
get :issues_preview
post :create_issues
end
collection do
get :customer_info
get :items
post :refresh_company
end
end
# Invoice writer pages (redmine_qbo has /invoices/:id for the PDF)
resources :qbo_invoices, only: [:new, :create, :edit, :update] do
member do
post :send_email
end
collection do
get :import_options
end
end
# Receive payment pages
resources :qbo_payments, only: [:new, :create, :show] do
member do
get :pdf
end
collection do
get :open_invoices
end
end
# QuickBooks product/service list (moved from redmine_qbo_lineitems; same URLs)
resources :items do
collection do
get :autocomplete
get :sync
end
end
# QuickBooks income accounts
resources :accounts do
collection do
patch :set_default
get :sync
end
end