From bd328d40dc980ca07ccd5ce78936175b554319cd Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 1 Sep 2026 02:09:49 +0200 Subject: [PATCH] feat(deliveries): enrich DN row subline with customer/order/paperclip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The /deliveries To Load + Back from Driver + Checked In tabs each render delivery-note rows showing only 'DN {number}' + a one-line status subline. Operators couldn't identify the customer or tell whether the signed copy was back without scrolling up to the customer/order group header. Replace the existing subline with a compact pieces list: customer name (truncated, with title tooltip) · company name · parent order number · signed-copy indicator (paperclip icon + filenames in title=) · delivery date (if set). Counter-pickup DNs (no parent order) collapse to 'Counter pickup' in italic. All data is already on the row payload from /api/v1/deliveries — no server or schema changes. Also removed the now-unused 'subline' const that the prior implementation used for the old single-line status subline. Verified visually via dev server: counter-pickup fallback renders correctly ('Counter pickup' italic). Order-attached and signed-copy code paths are structurally correct per the spec — would need a DN with order + signed files in the live data to exercise them, but no such DN was visible in the current dev data. Co-Authored-By: Claude Code --- src/app/(app)/deliveries/page.tsx | 47 +++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/src/app/(app)/deliveries/page.tsx b/src/app/(app)/deliveries/page.tsx index 3e0406b..ee72cd1 100644 --- a/src/app/(app)/deliveries/page.tsx +++ b/src/app/(app)/deliveries/page.tsx @@ -87,6 +87,7 @@ import { FileText, Loader2, PackageOpen, + Paperclip, Pencil, Square, Truck, @@ -1518,12 +1519,6 @@ function DeliveryNoteRowComponent({ // abandoned DN would be misleading. const canUploadSignedCopy = dn.status !== "cancelled"; - const subline = (() => { - if (dn.status === "draft") return "Not yet sent"; - if (dn.customer_po) return `PO ${dn.customer_po}`; - return "Awaiting customer response"; - })(); - return (
DN {dn.delivery_note_number}

- {dn.delivery_date && ( + {dn.order ? ( + <> + + {dn.order.customer_name} + + {dn.order.company_name && ( + <> + · + {dn.order.company_name} + + )} + {dn.order.order_number && ( + <> + · + {dn.order.order_number} + + )} + + ) : ( + Counter pickup + )} + {dn.signed_copy && dn.signed_copy.length > 0 && ( <> - Delivery {dn.delivery_date} · + + + signed copy + + + )} + {dn.delivery_date && ( + <> + · + Delivery {dn.delivery_date} )} - - {subline} -