Skip to content

Make the blank event invoice a fillable, printable form#2005

Open
maebeale wants to merge 3 commits into
mainfrom
maebeale/blank-invoices-editable
Open

Make the blank event invoice a fillable, printable form#2005
maebeale wants to merge 3 commits into
mainfrom
maebeale/blank-invoices-editable

Conversation

@maebeale

@maebeale maebeale commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 contained presenter + view change plus a small create action and Stimulus controller (blank template only)

Why

The blank event invoice was a static print template. This makes it editable in-browser and logs each generation to Ahoy so there's a usage record — without a dedicated invoice model. Registration and bulk-payment invoices stay read-only.

What

  • EventInvoice#editable? — true only for the blank template (from_event).
  • _invoice.html.erb (editable branch) — standard-sized inputs for bill-to / attention / meta / line item, a "Names included in registration fees" notes area, all wrapped in a form.
  • Quantity + amount-per-person are editable; line amount and total recompute live via the invoice-editor Stimulus controller (whole dollars drop cents, matching MoneyFormatter).
  • "Save record" posts to Events::InvoicesController#create, which logs a generate.invoice Ahoy event tied to the event (user + entered details) and re-renders the filled-in form so values survive the save. No new model/table.

Notes

  • Ahoy is used as a usage breadcrumb, not a source of truth. If invoices ever need to be reliably reloaded/re-edited, that's the point to introduce a real model.
  • Ahoy only persists when a JS visit exists (production), so the request spec asserts the tracker is invoked rather than counting rows.

The blank invoice was a static template meant to be printed and completed by
hand. Make it editable in-browser so admins can fill in bill-to, attention,
invoice meta, and line-item fields, add a notes area for the names covered by
the registration fees, and edit quantity and amount-per-person with the line
amount and total recomputing live before printing. Registration and
bulk-payment invoices stay read-only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 02:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 22, 2026 03:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale
maebeale marked this pull request as ready for review July 22, 2026 10:45
Adds a "Save record" submit on the editable blank invoice that posts the
filled-in form to Events::InvoicesController#create, which logs a
"generate.invoice" Ahoy event tied to the event (who generated it, plus the
entered bill-to/attention/line-item/names details) — a usage breadcrumb without
a dedicated invoice model. The form re-renders prefilled so values survive the
save, and the live auto-totalling is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 11:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants