[IP-31]: complete the invoice list row action group (#31, #167, #201, #530, #48)#581
Draft
nielsdrost7 wants to merge 1 commit into
Draft
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…, InvoicePlane#167, InvoicePlane#201, InvoicePlane#530, InvoicePlane#48) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0b36532 to
3fe01ff
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the invoice list row action group. One branch, five issues, squashed into a single atomic commit.
What each issue got
#167 — Copy invoice
copyrow action (confirmation dialog), gated byduplicate-invoices.InvoiceCopyService::copy()duplicates the invoice inside a DB transaction: all header fields, discount, numbering, template settings and line items are carried over; the copy is reset to Draft,invoice_number = null(drafts may have null numbers),invoiced_at= today, due +30 days, freshurl_key. Payments,creditinvoice_parent_idandis_read_onlyare deliberately not copied.feature/167-copy-invoicework and adapted to the current develop structure (permission gate added, dead code removed).#201 — Enter payment
enter_paymentrow action, gated bycreate-payments, visible only for Sent, Viewed, Partially Paid and Overdue invoices (never Draft or Paid).invoice_totalminus the sum of the invoice's payments) and today's date; payment method is a required select.PaymentService::enterInvoicePayment()records the payment in a transaction and syncs the invoice status: fully paid → Paid, partly paid Sent/Viewed → Partially Paid (Overdue stays Overdue until settled in full). The pre-existingPaymentServicedid not do any status syncing, so this is new service logic.#530 — Email action disabled with tooltip
send emailaction is now disabled (not hidden) with tooltip "This customer has no email address" when the invoice's customer has no email.Relation::customer_emailpreviously read a non-existentemailcolumn (always null); it now resolves from the primary contact's email communications, preferring the one flaggedis_primary.#31 — Status-aware action set
deleteis hidden for Paid invoices (InvoiceService::deleteInvoice()throws for them anyway; now the action never shows). There is no Cancelled status inInvoiceStatus, so Paid is the only terminal state to guard.#48 — Filter by invoice group
SelectFilter::make('numbering_id')on the invoices table; options are the Invoice-type numbering schemes of the current company (tenant-scoped via theBelongsToCompanyglobal scope, matching the invoice form's numbering select). Thenumberingtable has noactivecolumn, so all invoice numbering schemes are offered.Closes
Closes #167 — Copy an invoice to generate a similar billing record
Closes #201 — Enter a payment for an invoice from the invoice list
Closes #530 — Disable "Email Invoice" action with tooltip when customer has no email address
Closes #31 — implement invoices options on invoice list
Closes #48 — Filter invoices by invoice group
Follow-up issues (not resolved here — reopen if auto-closed on merge)
Closes #200 — "download pdf" row action is still a stub (empty action closure + literal
todo:modal description text). PR #575 implements PDF download on the invoice edit page viaInvoiceService::generatePdf()— this list action should call the same service once merged, not duplicate PDF logic.Deliberately untouched
The
download pdfstub action is left as-is: the PDF service is being built on a separate branch (PR #575) and this PR must not conflict with it.Validation
Upstream CI is dead, so validation was local (PHPUnit, sqlite in-memory), with a baseline comparison against
origin/develop:InvoiceListActionsTestThe pre-existing 9 incomplete / 26 skipped and the
QuoteWasUpdatedListenerTestrunner warning are identical to the develop baseline. All touched files pass Pint.