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>
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>