Issue templates can use {{name}} macros in the subject and description;
they're filled when the issue is saved, once they have a value. Other
plugins add macros through the new :qbo_issue_macros hook.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refund emails and PDFs take the shop name and mail settings from
:qbo_mail_settings instead of reading redmine_qbo_reminders' settings; the
customer page's ticked boxes use generic data-ticked-field/data-ticked-params
instead of knowing redmine_qbo_calendar's Add appointment link; and Create
issues carries the params plugins name in :qbo_billing_issue_carry_params
instead of appointment_id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Create issues no longer copies a parent issue's vehicle itself: the parent
is passed to :qbo_billing_issue_defaults (parent_issue:) and
:qbo_billing_build_issue (parent:), and every plugin's defaults are merged
rather than only the first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EstimateService had no build_qbo_remote, so a failed read fell back to
ServiceBase's NotImplementedError, which rescue StandardError misses (e.g.
saving an appointment with an estimate while QuickBooks was down gave a 500).
Tests keep refund emails off redmine_qbo_reminders' SMTP server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaced the old screenshots (outdated, with real names) with current
pages from a test instance with made-up data, and shown them in the
README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The customer page's Billing and Shipping Address were always empty: the
controller stopped setting them in March and the view still read them.
The page now formats the QuickBooks addresses itself. A missing phone
number showed as "0", and the balance as "$125.0"; they're now blank
and "$125.00".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Any logged-in user could open any estimate or invoice PDF by id. Now:
- estimates: View customers or Write estimates, or an estimate attached
to an issue the user can see (the issue page links to it); users
without the permission don't trigger a sync of uncached estimates
- invoices: View customers, Write invoices, View/Receive payments or
Issue refunds, or invoices attached to issues the user can see
- share-link customers are unchanged (their own issue's documents)
- the sidebar's estimate search only shows to those who can use it
The issue PDF merges an estimate PDF with optional content, as it
already did for the issue's own PDF, instead of failing.
Removed dead code: the JSON branches of CustomersController#create
(Redmine refuses JSON there) and the scaffold views for
qbo#authenticate, #oauth_callback and #webhook, which those actions
never render. An invalid customer now shows the form with a 422.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BillIssueTimeJob (hours by activity, partial failure and retry, quoted
item names), the QuickBooks connection and token refresh, the business
report's periods and database figures, the Redmine page patches and
hooks (issue page, form, history, issue list column and filter, billed
time, user employee, bill/share links, issue PDF with its estimate,
activity), RefundGateway, the refund email and PDF, the services' query
string and emailing, invoice lines' LinkedTxn, combined PDFs, invoice
attachment, and the plugin settings page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Integration tests for every controller: permissions, the estimate and
invoice editors (drafts, save and send, conflicts, the linked-estimate
and paid-invoice unlocks), payments, drafts, customers and share
links, estimate/invoice PDFs for share-link customers, items, accounts,
the business report, and QboController (OAuth state check, webhook
signature, manual billing). Unit tests for the webhook job, the sync
dispatcher and QboSyncJob.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fake QuickBooks service (test/qbo_fake_service.rb) stands in for the
estimate, invoice and connection services, so the writers are tested
end to end without QuickBooks.
Covers EstimateWriter (reading, saving, subtotals, discounts, custom
fields, locks, accepting, emailing), InvoiceWriter (from estimates,
paid-invoice unlock, closing estimates, imports of time and
estimates), PaymentWriter (oldest-first allocation, deposits, edits),
EstimateIssueBuilder, Company, the sync services and
CustomerSearchService.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unit tests for EstimateForm, PaymentForm, RefundForm, InvoiceRefundForm,
InvoiceStatus, LaborItems/ManHours, IssueValues, TitleCase, the
RedmineQboBilling permission helpers and field hooks, and the models:
Customer, Estimate, Invoice, Payment (with their activity events), Item,
Account, QboDraft, QboRefund, QboSyncStatus and QboBaseModel's push and
sync behaviour.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An estimate attached to an issue was read-only, so changing it after a
customer asked for tweaks meant taking it off the work order first.
A new global permission, "Edit estimates linked to issues" (on top of
Write estimates), shows an "Unlock to edit" button on a linked
estimate. After a confirmation the estimate opens for editing, and the
issues stay linked when it's saved. EstimateWriter.save still refuses a
linked estimate unless it was unlocked by a user with the permission.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The attachments patch skipped the login redirect for share-link holders
but left Redmine's read_authorize, find_container and
find_downloadable_attachments in place, which deny the anonymous user.
It relied on an Attachment#visible? patch that never existed, so every
file on a shared issue sent the customer to the login page.
Those checks now pass when the session holds an active share token for
the file's issue (show, download, thumbnail, Download all), and defer
to Redmine otherwise. Files on private notes stay hidden, matching the
share page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Completed work that's billed and paid in full can be refunded from its
invoice (Refund on the invoice, or Paid invoice on the customer's Refund
page). It makes a QuickBooks Refund Receipt: the invoice lines refunded
(all or part, by quantity or amount) with their products/services and
tax codes, the invoice discount's share, and the restocking fee as a
negative line when it's ticked: the fee rate of the parts refunded, so
labor-only work has none. Paid out of the refund check or card account,
with the check number.
Each refund records the lines it refunded, so a line can't be refunded
for more than it was billed across refunds. Optionally notes the refund
on the invoice's work orders and emails the customer. The refund page,
PDF and email show the lines, tax and fee. Migration 056 adds the
columns to qbo_refunds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Documents share links (what they show, a month's validity, the
purge_customer_tokens task), the Share issues with customers
permission, and ticked estimates filling in New issue and Add
appointment on the customer page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CustomerToken.purge_expired deletes share links that have expired or
whose issue was deleted. It runs whenever a new link is made, so they
don't pile up, and from rake redmine_qbo:purge_customer_tokens for a
manual or scheduled run. Expired links were only ignored before.
Also drops Issue's belongs_to :customer_token: issues have no such
column, so the association could only raise.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* customers#filter_estimates_by_customer and #filter_invoices_by_customer,
their routes, permission entries and template: they filled an estimate
dropdown on the old issue form, which is gone.
* Routes with no action: accounts new/create/show/edit/update/destroy
(only index, Set default and Sync exist) and customers#destroy.
* Unused methods: AuthHelper#require_user, #allowed_to?, #check_permission;
CustomersController#address_to_s; CustomerToken#expired? and
.remove_expired_tokens; QboBaseModel#skip_qbo_push?;
QboDraft.writable_document?; SyncServiceBase#extract_value.
* CustomersController's before_action helpers are private.
* The unused .autocomplete-meta style and 28 unused translation keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* The invoice list's paid badge is short so each invoice stays on one
line: "Paid", or "Paid +3d" when it was paid in full 3 days after
its date, with the day on hover. The invoice page keeps the date.
* The estimate and invoice lists are laid out in columns (checkbox,
number, date, status, actions), so the edit/view icons line up.
* Ticked estimates (and redmine_qbo_vehicles' vehicles) fill in
redmine_qbo_calendar's Add appointment link (estimate_id,
vehicle_id) as well as New issue. Estimate checkboxes are only on
the customer page, where they're used.
* application.js is gone: it only carried the old Google Calendar
link code, which threw an error when a box was ticked on a vehicle
page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Sales tax section: tax invoiced (on invoices dated in the period,
accrual) and tax collected (on invoices paid in full in the period,
counted on the day each was paid in full, cash), with counts, a line
chart and a month-by-month table. Only invoices are counted; sales tax
is filed from QuickBooks' Sales Tax Liability report.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Estimates and invoices written are reported without sales tax (new
estimates.tax_amount, filled in by the estimate sync), and a new
Invoices paid in full figure counts invoices on the day they were paid
in full. Payments stay as received, so collected vs. invoiced compares
them with the invoices' totals with tax.
Paid invoices show the day they were paid in full on the customer's
invoice list and the invoice page ("Paid 11/03/2026").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New invoices columns tax_amount and paid_on, filled in by the invoice
sync. An invoice is paid in full on the later of its date and the
dates of the payments and credit memos applied to it (local payments
first; QuickBooks only for ones not synced yet and credit memos), so
reports such as the monthly sales commission don't have to read
invoices from QuickBooks. A full sync fills them in for older
invoices; it now syncs payments before invoices.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Refund page on the customer: the canceled order's estimate fills in
the parts the 30% restocking fee is worked out on. Refunding makes the
fee invoice, pays it from the customer's credit, records the rest as a
Check (company check) or Expense (card refund on the terminal) with the
category Accounts Receivable, applies the credit to it so the balance
comes back to $0.00, and optionally marks the estimate Rejected,
cancels its work orders with the reason as a note and emails the
customer. Each refund has a page with a PDF of it.
New permission: Issue refunds. New settings under Billing » Refunds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
: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>
- Issue PDF: show the issue's estimate number and invoice number(s)
- Create issues from estimate: optional parent task. The issues are created as
its subtasks, take its customer, and start from its project, vehicle and
custom field values (subtask_field_copier's rules when installed)
- Issue page: shortcut to create the estimate's issues as subtasks of the issue
- Create issues page: editable start and due dates, pre-filled from the
appointment or the parent task
- Always show plugins' fields (e.g. the vehicle) on the Create issues page
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clicking Save, Save and send or Save draft shows a spinner in the action bar and locks the buttons until the page reloads, so a second click can't save or send twice.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Estimates and invoices take a discount, as a percent of the subtotal or an
amount, saved as QuickBooks' discount line and taken off before sales tax.
Duplicated estimates and invoices made from an estimate keep it. The box is
hidden when discounts are off in QuickBooks.
- A paid invoice can be unlocked for editing after a confirmation. The
payments stay linked, and the total can't go below what's been paid.
Unlocking needs the new "Edit partially paid invoices" or "Edit paid
invoices" permission, checked again when saving.
- Saved payments can be edited: date, method, reference, memo, amount and the
invoices they pay. Each invoice keeps its amount unless the amount or the
invoices change. Payments that also apply credit memos stay read-only.
- Locked estimates and invoices are readable again (disabled boxes had faint
or invisible text, especially in Safari).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When an estimate didn't have the company's sales person field, the plugin fell back to
any field named like "Sales Rep", e.g. a retired "Sales Rep old" dropdown, which
QuickBooks returns as its option number. Invoices made from those estimates got "4"
as their sales person. Only the company's field is read now; an estimate without it
has no sales person, so the invoice gets the user who creates it. Matching by name is
left for when QuickBooks' settings can't be read, and never picks a hidden field.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A draft is kept in Redmine only, however incomplete, so nothing is in QuickBooks
until it's saved from the editor. QuickBooks can't apply a deposit to an invoice
that's still being written, which made it read-only. Saving to QuickBooks deletes
the draft.
Drafts are listed on the customer's page, on a Drafts page linked from Customers,
and on a new invoice or estimate for a customer who already has one. Anyone with
Write invoices (or Write estimates) can continue or delete invoice (or estimate)
drafts. Adds the qbo_drafts table (migration 052).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The token expiry came back as "never synced" text, which the page treated as a
time, so it failed. It's now empty, shown as N/A.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
QuickBooks doesn't tell apps which custom fields are inactive, and a field stays on
its old estimates after it's turned off, so an inactive "Sales Rep old" kept showing
and was filled in with the sales person. The billing settings now list the fields
found, with a box to hide each; hidden fields are left out of the editor, the sales
person and other plugins' field lookups.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>