Skip to content

[IP-160]: convert quote to invoice#579

Draft
nielsdrost7 wants to merge 1 commit into
InvoicePlane:developfrom
underdogg-forks:feature/160-convert-quote-to-invoice
Draft

[IP-160]: convert quote to invoice#579
nielsdrost7 wants to merge 1 commit into
InvoicePlane:developfrom
underdogg-forks:feature/160-convert-quote-to-invoice

Conversation

@nielsdrost7

@nielsdrost7 nielsdrost7 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • QuoteService::convertQuoteToInvoice(Quote): Invoice — inside a transaction: copies prospect_id → customer_id, all quote items (name, qty, price, discounts, both tax rates, task link), the discount/tax/total summary, and summary/terms/footer onto a new draft invoice; then sets the quote to the new QuoteStatus::CONVERTED case.
  • The draft is created with a null invoice number — consistent with the duplicate-prevention observer (PR [IP-513]: duplicate-number prevention via Observers #540) that allows multiple nulls for drafts; numbering is assigned when the invoice leaves draft.
  • Converting twice throws and is surfaced as a danger notification; the convert_to_invoice table action (existing stub, now wired) hides for already-converted quotes and requires confirmation.

Deviation from the SMART plan: no redirect to EditInvoice after conversion — that page didn't exist on develop when this PR was written. It does now (further extended by PR #575), so the redirect is a ready-to-do follow-up (#588).

Closes

Closes #160 — quote-to-invoice conversion implemented end-to-end (service, action, status transition)

Follow-up issues (not resolved here — reopen if auto-closed on merge)

Closes #588 — Redirect to the invoice edit page after converting a quote (now unblocked since EditInvoice exists on develop)

Tests

QuoteConversionTest — 3 tests: full conversion (items, totals, status), double-conversion rejection, action visibility.

@InvoicePlane InvoicePlane deleted a comment from coderabbitai Bot Jul 3, 2026
@nielsdrost7 nielsdrost7 changed the title Feature/160 convert quote to invoice [IP-160]: convert quote to invoice Jul 4, 2026
@InvoicePlane InvoicePlane deleted a comment from coderabbitai Bot Jul 4, 2026
@nielsdrost7 nielsdrost7 self-assigned this Jul 4, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Quotes]: Redirect to the invoice edit page after converting a quote [Quotes]: Convert a quote to an invoice

1 participant