Skip to content

Feature/160 convert quote to invoice#579

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

Feature/160 convert quote to invoice#579
nielsdrost7 wants to merge 2 commits into
InvoicePlane:developfrom
underdogg-forks:feature/160-convert-quote-to-invoice

Conversation

@nielsdrost7

Copy link
Copy Markdown
Collaborator

Addresses #160 (kept open per workflow — PRs stay draft).

What

  • 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 — that page only exists on PR #544's branch. Trivial follow-up once #544 lands.

Tests

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

nielsdrost7 and others added 2 commits July 3, 2026 20:25
QuoteService::convertQuoteToInvoice() copies the client, items, totals,
and summary fields onto a new unnumbered draft invoice inside a
transaction, then marks the quote Converted (new QuoteStatus case).
The convert_to_invoice table action is wired to the service, requires
confirmation, and hides once a quote is converted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@InvoicePlane InvoicePlane deleted a comment from coderabbitai Bot Jul 3, 2026
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.

1 participant