CutoffWarning
- Status
- Implemented
- Family
- 12 of 13
- Registry
- @lopifi/cutoff-warning
npx shadcn@latest add @lopifi/theme @lopifi/cutoff-warningThe component, rendering
Real data, the shipped component. Switch the theme to check the claims the spec makes below.
What lands in your repository
One component is never one file. Everything below is copied into your project, where you own it.
- Files
components/ledger/cutoff-warning.tsx
- Lopifi dependencies · 3
- cnfiscal-periodicons
- npm packages
- clsxtailwind-merge
- Registry entry
- /r/cutoff-warning.json
The whole component
No compiled bundle, no black box. This is the file the registry copies, and the file you will edit.
import * as React from "react";
import { cn } from "@/lib/ledger/cn";
import { formatDate } from "@/lib/ledger/fiscal-period";
import { ExclamationTriangleIcon } from "@/components/ledger/icons";
export interface CutoffWarningProps extends React.ComponentPropsWithoutRef<"div"> {
closedThrough: Date;
entryDate: Date;
onPostAccrual?: () => void;
onRequestReopen?: () => void;
}
/**
* Inline at the date field, never a toast. States the consequence **and both
* legitimate remedies** — a bare rejection leaves the user with no path.
*/
export const CutoffWarning = React.forwardRef<HTMLDivElement, CutoffWarningProps>(
({ className, entryDate, closedThrough, onRequestReopen, onPostAccrual, ...props }, ref) => {
const postingPeriod = new Date(closedThrough.getFullYear(), closedThrough.getMonth() + 1, 1);
return (
<div
className={cn("flex items-start gap-2 rounded-sm bg-warning-subtle px-3 py-2", className)}
ref={ref}
role="alert"
{...props}
>
<ExclamationTriangleIcon aria-hidden="true" className="mt-0.5 size-4 shrink-0 text-warning" />
<p className="text-body text-text-primary">
This is dated {formatDate(entryDate)}, in a closed period. It will post to{" "}
{postingPeriod.toLocaleDateString("en-GB", { month: "long", year: "numeric" })} and be flagged for
cutoff review. If it belongs in the earlier period,{" "}
<button
className="text-accent underline underline-offset-2"
onClick={onRequestReopen}
type="button"
>
request a reopen
</button>{" "}
or{" "}
<button className="text-accent underline underline-offset-2" onClick={onPostAccrual} type="button">
post an accrual
</button>
.
</p>
</div>
);
},
);
CutoffWarning.displayName = "CutoffWarning";
The accounting it encodes
Concepts this component renders. Each one is defined once, in the lexicon, and used identically in the code and the copy.
Also in Close, controls & consolidation
- PeriodStatusState, provenance, and the next action.Spec
- CloseStatusThe seven-section gated pipeline.Spec
- AuditTrailField-level diffs on every financial object.
- EvidencePanelInline rendering, content hash, never deleted.Spec
- IntegrityCheckPanelEleven continuous assertions. A failure owns the screen.Spec
- MaterialityPolicyBoth thresholds must be exceeded. Threshold displayed.Spec
- ApprovalPolicyEditorSeparate-approver shown as fixed, not a toggle.Spec
- RoleMatrixController ≠ Treasurer. Admin cannot transact.Spec
- SubsequentEventLogAdjusting vs. non-adjusting, decision recorded.Spec
- RestatementBannerMarks a restated comparative everywhere.Spec
- AuditorModeRead-only server-side, scope immutable, itself audited.Spec
- SamplingToolMethod and seed recorded — reproducible selection.Spec
- EvidenceBundleEntries + documents + approvals + trail, with a manifest.Spec
- EntitySelectorExplicit scope. Standalone vs. consolidated visually distinct.Spec
- ConsolidationViewEntity columns, eliminations, NCI, group total.Spec
- IntercompanyMatrixMust net to zero. Break types named.Spec
- EliminationEntryConsolidation-level only, boundary visible.Spec
- NciPanelOn both statements.Spec
- TranslationSummaryRates by type, with sources and methodology.Spec
- CtaRollForwardIts own equity line, never buried.Spec
- FxRevaluationMonetary items only, derived from classification.Spec
- FxGainLossPanelRealized and unrealized never combined.Spec
- RateTableRate type is not optional. A missing rate blocks.Spec
See also
A component is specified in one place, defined in another, and running in a third. All three, from here.
- Close, controls & consolidation — the family specThe four-layer specification this component was built against, before it was written.Doc
- Month-end close and controlsThe family running, with real figures in it, in both themes and at every density.Live
- CatalogAll 179 components, specified before they are written.Doc
- CutoffRecording each transaction in the period in which it occurred — the boundary tested at every period endTerm
Elsewhere in the system
Where CutoffWarning sits in the rest of the system — the live section it renders in, the calculators that compute what it displays, and the ledger payloads it is fed from.
- CutoffWarning, runningThe gl showcase — live, with theme, density, greyscale and reduced-motion switches.Live
- Day count & proration30/360 is wrong about the calendar and right about the contract. Both are here.Tool
- Periods, locking and the closeWhat stops someone posting into a closed month?API
- Close, controls & consolidationClose, controls & consolidation — specs for 24 React components: PeriodStatus, CutoffWarning, CloseStatus, AuditTrail and 20 more.Doc
Components are copied into your repository and meant to be edited — rounding policy, fiscal calendar and compliance copy differ per company.
Told when Close, controls & consolidation changes
Components are copied into your repo, so a fix here does not reach you on its own. One email when a component in this family changes in a way that needs a migration — and nothing when it does not.