Remove eyebrow header, dropdown picker, and SKU matching. Require scanning the physical asset ID to audit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -79,12 +79,6 @@ export function AuditFlow({
|
|||||||
const handleScan = (result: ScanResult) => {
|
const handleScan = (result: ScanResult) => {
|
||||||
if (result.kind === "item") {
|
if (result.kind === "item") {
|
||||||
setItemId(result.item.id);
|
setItemId(result.item.id);
|
||||||
} else {
|
|
||||||
// SKU scan — pick the most recent active instance of that product.
|
|
||||||
const candidate = overdueFirst
|
|
||||||
.filter((i) => i.productId === result.product.id)
|
|
||||||
.sort((a, b) => +new Date(b.purchaseDate) - +new Date(a.purchaseDate))[0];
|
|
||||||
if (candidate) setItemId(candidate.id);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -114,33 +108,16 @@ export function AuditFlow({
|
|||||||
boxShadow: "var(--shadow-lg)",
|
boxShadow: "var(--shadow-lg)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ModalHeader title={ml.title} eyebrow="Audit" onClose={onClose} />
|
<ModalHeader title={ml.title} eyebrow="" onClose={onClose} />
|
||||||
|
|
||||||
<div style={{ padding: 32 }}>
|
<div style={{ padding: 32 }}>
|
||||||
<ScanField
|
<ScanField
|
||||||
items={overdueFirst}
|
items={overdueFirst}
|
||||||
products={data.products}
|
products={[]}
|
||||||
matchedLabel={item ? `${item.assetId} · ${item.name}` : null}
|
matchedLabel={item ? `${item.assetId} · ${item.name}` : null}
|
||||||
onMatch={handleScan}
|
onMatch={handleScan}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div style={{ marginTop: 16 }}>
|
|
||||||
<Field label="Or pick from list">
|
|
||||||
<Select value={itemId} onChange={(e) => setItemId(e.target.value)}>
|
|
||||||
{overdueFirst.map((i) => {
|
|
||||||
const od = helpers.auditOverdue(i);
|
|
||||||
const sc = helpers.daysSinceCheck(i);
|
|
||||||
return (
|
|
||||||
<option key={i.id} value={i.id}>
|
|
||||||
{od ? "⚠ " : ""}
|
|
||||||
{i.assetId} · {i.name} — {helpers.brandName(data, i.brandId)} · {sc}d since check
|
|
||||||
</option>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</Select>
|
|
||||||
</Field>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
marginTop: 16,
|
marginTop: 16,
|
||||||
|
|||||||
Reference in New Issue
Block a user