import { type VNode } from 'vue'; import { type UomContext } from '@/helper/uom-rules'; /** A single physical-count chip: an amount in a given UOM, flagged when the UOM * is NetSuite-inactive (purple) or not on the SKU (orphan, red). */ export interface AmountChip { abbrev: string; amount: number; variant: 'normal' | 'inactive' | 'orphan'; } /** Lean row for the subgroup 3-column table (Name / UOM base / Amounts) — * derived straight from the group's items, no balance/adjustment data. */ export interface GroupRowItem { id: string; code: string; name: string; baseUnit: string; baseUnitAmount: number; isTemplateItem: boolean; measurements: AmountChip[]; physicalBalance: number; breakdown: BreakdownLine[]; } /** One line of the stock-take-balance breakdown popover — mirrors the parent * closing-draft dialog's BreakdownLine. */ export interface BreakdownLine { label: string; amount: number; abbrev: string; subtotal: number; inactive: boolean; orphan: boolean; counted: boolean; } /** Per-item breakdown: base amount plus each counted measurement × conversion. * Subtotals are decimal-safe so the popover total matches physicalBalance. * Same logic as the parent closing-draft dialog's breakdown. */ export declare function buildItemBreakdown(item: FdoClosingDraftItem, ctx: UomContext): BreakdownLine[]; /** Renders the breakdown popover panel — same layout as the parent * closing-draft dialog's breakdown panel. */ export declare function renderBreakdownPanel(breakdown: BreakdownLine[], total: number, baseUnit: string): VNode; /** Base-unit amount + one chip per counted measurement for a single item. */ export declare function buildItemChips(item: FdoClosingDraftItem, ctx: UomContext): { baseUnitAmount: number; measurements: AmountChip[]; }; /** Template items come from `items`; non-template ones from `negativeStockItems`. */ export declare function buildGroupRowItems(group: FdoSubClosingDraft, ctx: UomContext): GroupRowItem[]; /** Renders the Amounts cell: a base-unit chip followed by one chip per counted * measurement. Shared by the parent closing-draft table and the subgroup sheet. */ export declare function renderAmountChips(baseUnitAmount: number, baseUnit: string, measurements: AmountChip[]): VNode; /** One contribution source for an item — the parent draft ("Main") or a sub. */ export interface ItemSource { label: string; isSub: boolean; items: FdoClosingDraftItem[]; } /** An item's chips attributed to a single contributing source. */ export interface ItemSourceBucket { label: string; isSub: boolean; baseUnitAmount: number; measurements: AmountChip[]; } /** Splits an item's physical counts by the source that recorded them, dropping * sources that contributed nothing. Used to show "which sub did this come from". */ export declare function buildItemSourceBuckets(skuId: string, sources: ItemSource[], ctx: UomContext): ItemSourceBucket[]; /** Renders source buckets stacked, each under an uppercase source-name header. */ export declare function renderSourceBuckets(buckets: ItemSourceBucket[], baseUnit: string): VNode;