Repository navigation
Add the invoice card to the Desk - #757
Merged
Merged
Conversation
A freight line kept only the template's name, so nothing could link back to the template itself. It now stores the id beside the name: the template the shipment's rating names, else, for a rating that only kept a name, the template the shipment is assigned when that template still has that name. An id that is not a PULID is left out rather than stored. Copying a line's charge detail carries the id. The migration adds the column and fills it on existing freight lines from the shipment's rating or assigned template, only where the template still exists and its name matches what the line printed; anything else is left without an id rather than guessed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Bt5FWcHvsb67pNyemFnr2
An invoice looked up by the agent, or opened from a table's row or another card, now draws as a card of its own rather than a list of fields. It reads what a biller and a collector read it for: who it bills and what is still owed; the terms as a ruler from the invoice date to the due date, past it in amber once late, or, for a draft, how many of the customer's days have run while it waits to be posted; the charges summed by how each was billed, the freight named by the formula template that rated it and opening that template's card; payments and credits as remittance stubs; the open dispute over the closed ones; where it went by email, EDI 210 and to whichever accounting system the organization keeps, each line cut to one row and told in full on hover only when cut; and the shipments it bills, origin to destination. A voided invoice says why and what became of its freight; a credit memo, what it corrects, what it has left and the invoices it settled. The server adds what the card needs and nothing the page did not already load: Invoice.chargeSummary sums the lines GetByID already reads into one row per way a charge was billed, so a consolidated invoice of hundreds of lines is a handful of rows; the users who voided an invoice and opened and resolved its disputes; the formula template on each invoice line; and ShipmentsInput.invoiceIds, which needs permission to read invoices and is resolved in the API layer so the operations module never reads a billing table. Every schema change is additive. The accounting sync state's labels move into lib/accounting-sync so the invoice page's sync line and the card name the system the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Bt5FWcHvsb67pNyemFnr2
Regenerates the translation catalogs and product guide catalog over both sides, and translates the two activity-feed strings master left untranslated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Bt5FWcHvsb67pNyemFnr2
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit details
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 |
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.
Description
Adds an invoice resource card to the Desk: an overview of an invoice with a few actions, opened beside the conversation that looked it up. The billing queue stays the place for full detail.
The card covers these states:
It has these sections:
Invoice lines now store the ID of the formula template they were rated with, so the template name on a freight line opens the formula template card. The name is truncated, with the full name on hover. Long text on the email and EDI slips, such as why a 210 wasn't sent, truncates the same way.
Related Issue or Discussion
The maintainer requested and approved this from mockups in a Claude Code session.
Type of Change
Scope
Server
billing/domain/invoice:InvoiceLine.FormulaTemplateID;ChargeGroupsgroups lines into the card's charge rows;BilledShipmentIDslists the shipments an invoice bills.billing/app/invoicelines: the freight line records the template it was rated with. It prefers the rating detail and falls back to the assigned template only when the names match.20261231009470_invoice_line_formula_template: adds the column and backfills existing freight lines only where the template name matches. Lines it can't match stay null.Invoice.chargeSummary,Invoice.voidedBy,InvoiceLine.formulaTemplateId,InvoiceDispute.openedBy/resolvedByandShipmentsInput.invoiceIds;projection.ymlandgqlgen.yml;invoiceIdsrequires invoice read permission. The newShipmentOptions.IDsfilter is how it reaches the repository.Client
routes/desk/_components/artifacts/cards/invoice/: the card, its parts, skeleton, helpers and tests. Its styles are thedk-inv-*block indesk-v2.css.lib/graphql/invoice-card.ts, theDeskInvoiceCardoperation, andlib/queries/invoice.ts(card,lastEmailAttempt).hooks/use-clipped.ts: tells the card when text is truncated, so the tooltip only shows then.lib/accounting-sync.ts: the sync state labels, now shared withsync-state-line.tsx.invoiceandinvoice-closed.Generated and docs
docs/engineering/desk-artifacts.md.Validation
cd services/tms && task test:go testpasses for the changed packages. The new backfill integration test was run with-tags integrationagainst a local Postgres 16, and it fails when the backfill picks the wrong template.cd services/tms && task lint: golangci-lint (--new-from-rev=origin/master) reports 0 new issues, andgo run ./scripts/archlintpasses.cd client && pnpm typecheck:tsc -bpasses in every package (run per package because turbo fails in the container).cd client && pnpm build: not run locally; CI covers the build and bundle budget.cd client && pnpm lint: oxlint,lint:designandlint:skeletonspass.task gqlschema-diff: 8 safe changes, 0 breaking.node i18n/tools/i18n.mjs checkpasses, and so doespnpm --filter @trenova/web guide:check.Screenshots or Recordings
Mock screenshots of every state (loaded, attention, empty, skeleton, error, full page and narrow, in light and dark) were reviewed and approved in the session. To regenerate them, run
node e2e/mock-api/desk-cards-screenshots.mjswith theinvoiceandinvoice-closedgroups.Deployment Notes
invoice_lines.formula_template_idcolumn and backfills it from the shipments' rating detail and assigned template. Lines without a matching template name stay null.Checklist
AGENTS.md,CLAUDE.md, and existing repository patterns.🤖 Generated with Claude Code
https://claude.ai/code/session_012Bt5FWcHvsb67pNyemFnr2
Generated by Claude Code