Skip to content

[IP-542]: invoice edit page#575

Draft
nielsdrost7 wants to merge 2 commits into
InvoicePlane:developfrom
underdogg-forks:feature/542-invoice-edit-page
Draft

[IP-542]: invoice edit page#575
nielsdrost7 wants to merge 2 commits into
InvoicePlane:developfrom
underdogg-forks:feature/542-invoice-edit-page

Conversation

@nielsdrost7

@nielsdrost7 nielsdrost7 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replaces the inline modal edit in InvoicesTable with navigation to a dedicated EditRecord page (EditInvoice)
  • Adds status-aware header action bar to the invoice edit page, matching the top-right dropdown users expect from InvoicePlane v1
  • Registers the edit route in InvoiceResource::getPages()

Header actions

Action Condition
Create Credit Note Visible only for SENT, PAID, PARTIALLY_PAID
Download PDF Always — implemented (see update below)
Send Email Always (stub — tracked in #520)
Create Recurring Invoice Always (stub — tracked in #586)
Copy Invoice Always — replicates record + line items, redirects to new edit page
Delete Hidden for PAID invoices and read-only invoices

Closes

Closes #542 — EditInvoice page (parent)
Closes #223 — Invoice action bar: download PDF / send email
Closes #224 — Invoice action bar: create credit note / recurring / copy
Closes #96 — Preview an invoice PDF before emailing or printing
Closes #190 — Download PDF for an invoice from the invoice view
Closes #171 — Issue credit notes from invoices for refunds or adjustments

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

Closes #586 — Create Recurring Invoice stub (action bar still shows a "not yet implemented" toast; no RecurringInvoice creation flow wired up)
Closes #520 — Send Email stub (the "Email Invoice" action itself is tracked there; the wider email flow lives in #520#527)

Test plan

  • Open an invoice in DRAFT status → Credit Note action is hidden, Delete is visible
  • Open an invoice in SENT status → Credit Note action is visible, Delete is visible
  • Open an invoice in PAID status → Credit Note is visible, Delete is hidden
  • Copy Invoice → creates a new DRAFT invoice with all line items, redirects to its edit page
  • Preview → opens a slide-over rendering the invoice PDF markup, no iframe/route
  • Download PDF → streams a <invoice-number>.pdf download
  • Create Credit Note → creates a negated draft linked via creditinvoice_parent_id; attempting to credit a credit note is refused with a notification
  • Email / Recurring stubs show "Not yet implemented" warning toast

Update 2026-07-04 — PDF preview/download + credit notes (#96, #190, #171)

  • dompdf added; the existing domPDF driver was missing its Dompdf\* imports and the ip.pdfDriver/paperSize/paperOrientation config keys — now operational via PDFFactory.
  • invoices::pdf.invoice Blade template — one document markup shared by the PDF driver and the on-screen preview.
  • InvoiceService: renderHtml(), generatePdf() (StreamedResponse named <invoice-number>.pdf), createCreditNote() (negated draft, invoice_sign = -1, linked via creditinvoice_parent_id, null number until it leaves draft; crediting a credit note refused).
  • EditInvoice header: Preview (slide-over, no iframe/route — [Invoices]: Preview an invoice PDF before emailing or printing #96), Download PDF ([Invoices]: Download PDF for an invoice from the invoice view #190), Create credit note wired to the service with redirect to the new draft ([Invoices]: Issue credit notes from invoices for refunds or adjustments #171).
  • Merged fork develop (permission-seeding test fix) and restored develop's modal EditAction on the invoices list — the list keeps the modal flow the develop suite asserts; the EditInvoice page remains for its route and redirects.

Tests: InvoicePdfAndCreditNoteTest (6) — full suite on this branch: 0 failed, 283 passed (baseline develop: 272 passed).

@InvoicePlane InvoicePlane deleted a comment from coderabbitai Bot Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment