Skip to content

fix(sales): show product image on Stock Allocation backorder rows (qr71)#432

Merged
OneTwo3D merged 1 commit into
developmentfrom
fix/allocation-backorder-image
Jun 26, 2026
Merged

fix(sales): show product image on Stock Allocation backorder rows (qr71)#432
OneTwo3D merged 1 commit into
developmentfrom
fix/allocation-backorder-image

Conversation

@OneTwo3D

Copy link
Copy Markdown
Owner

Problem

On the sales order detail screen, the Stock Allocation panel's Backorder / Unallocated rows showed a hardcoded grey box instead of the product image — even though the line-items section, the allocated-rows section, and shipment-line rows all show product images.

Most visible on an order with no stock to allocate (e.g. order 163295, PROCESSING with 0 allocations): every line falls into the backorder/unallocated list, so each product appeared as a grey box despite having a valid image.

Root cause

The backorder block in so-detail-client.tsx rendered a fixed <div className="w-8 h-8 rounded bg-muted" /> and never read the line's image. The image data already flows in via lines={so.lines} (SoLineRow carries imageUrl), but AllocationPanelLine didn't declare the field so it was dropped.

Fix

  • Add imageUrl: string | null to AllocationPanelLine.
  • Render the same {imageUrl ? <img/> : <grey/>} pattern already used by the adjacent allocated-rows and shipment-line sections.

No data-layer changes — getSalesOrder already resolves product.imageUrl ?? parent.imageUrl for each line.

Verification

  • npm run type-check
  • npm run lint (target file) ✓
  • npm run build ✓ (compiled successfully)
  • npm run test:unit ✓ 1887 pass / 0 fail

Closes onetwo3d-ims-qr71

🤖 Generated with Claude Code

…ted rows (qr71)

The Stock Allocation panel's Backorder/Unallocated rows rendered a hardcoded grey
placeholder instead of the product image, while line items (and the allocated-rows
and shipment-line sections) show images. Most visible on an order with no stock to
allocate (e.g. 163295), where every line falls into this list and shows grey.

The image data already flows in via lines={so.lines} (SoLineRow carries imageUrl);
the block just never read it. Add imageUrl to AllocationPanelLine and render the
same {imageUrl ? <img/> : <grey/>} pattern used by the adjacent allocation/shipment
rows.

Verified: type-check, eslint, next build, full unit suite (1887 pass / 0 fail).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@OneTwo3D OneTwo3D merged commit cb345a2 into development Jun 26, 2026
9 checks passed
@OneTwo3D OneTwo3D deleted the fix/allocation-backorder-image branch June 26, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant