From 0b87dc9372bcb18459dd80e5b6979719064c2c63 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 9 Oct 2024 21:50:29 +1100 Subject: [PATCH] [PUI] Part IPN display (#8264) * Add IPN column to order tables * Fix display on SupplierPartDetail page * Update manufacturer part detail page --- .../src/pages/company/CompanyDetail.tsx | 2 +- .../pages/company/ManufacturerPartDetail.tsx | 39 ++++++++++++------- .../src/pages/company/SupplierPartDetail.tsx | 15 +++++-- .../purchasing/PurchaseOrderLineItemTable.tsx | 13 ++++--- .../tables/sales/ReturnOrderLineItemTable.tsx | 8 ++++ 5 files changed, 54 insertions(+), 23 deletions(-) diff --git a/src/frontend/src/pages/company/CompanyDetail.tsx b/src/frontend/src/pages/company/CompanyDetail.tsx index 0dcf720d22bd..4790c6757dff 100644 --- a/src/frontend/src/pages/company/CompanyDetail.tsx +++ b/src/frontend/src/pages/company/CompanyDetail.tsx @@ -171,7 +171,7 @@ export default function CompanyDetail(props: Readonly) { return [ { name: 'details', - label: t`Details`, + label: t`Company Details`, icon: , content: detailsPanel }, diff --git a/src/frontend/src/pages/company/ManufacturerPartDetail.tsx b/src/frontend/src/pages/company/ManufacturerPartDetail.tsx index a552d1860533..7110e1a24dc4 100644 --- a/src/frontend/src/pages/company/ManufacturerPartDetail.tsx +++ b/src/frontend/src/pages/company/ManufacturerPartDetail.tsx @@ -79,18 +79,19 @@ export default function ManufacturerPartDetail() { }, { type: 'string', - name: 'description', - label: t`Description`, + name: 'part_detail.IPN', + label: t`IPN`, copy: true, - hidden: !manufacturerPart.description + icon: 'serial', + hidden: !data.part_detail?.IPN }, { - type: 'link', - external: true, - name: 'link', - label: t`External Link`, + type: 'string', + name: 'part_detail.description', + label: t`Description`, copy: true, - hidden: !manufacturerPart.link + icon: 'info', + hidden: !manufacturerPart.description } ]; @@ -110,6 +111,22 @@ export default function ManufacturerPartDetail() { copy: true, hidden: !manufacturerPart.MPN, icon: 'reference' + }, + { + type: 'string', + name: 'description', + label: t`Description`, + copy: true, + hidden: !manufacturerPart.description, + icon: 'info' + }, + { + type: 'link', + external: true, + name: 'link', + label: t`External Link`, + copy: true, + hidden: !manufacturerPart.link } ]; @@ -128,11 +145,7 @@ export default function ManufacturerPartDetail() { /> - + diff --git a/src/frontend/src/pages/company/SupplierPartDetail.tsx b/src/frontend/src/pages/company/SupplierPartDetail.tsx index 2379ed236a68..93d49233d4d5 100644 --- a/src/frontend/src/pages/company/SupplierPartDetail.tsx +++ b/src/frontend/src/pages/company/SupplierPartDetail.tsx @@ -88,9 +88,18 @@ export default function SupplierPartDetail() { }, { type: 'string', - name: 'description', + name: 'part_detail.IPN', + label: t`IPN`, + copy: true, + hidden: !data.part_detail?.IPN, + icon: 'serial' + }, + { + type: 'string', + name: 'part_detail.description', label: t`Description`, - copy: true + copy: true, + icon: 'info' }, { type: 'link', @@ -196,7 +205,7 @@ export default function SupplierPartDetail() { /> - + diff --git a/src/frontend/src/tables/purchasing/PurchaseOrderLineItemTable.tsx b/src/frontend/src/tables/purchasing/PurchaseOrderLineItemTable.tsx index 7b355a6a10b8..fc87a32fd3f3 100644 --- a/src/frontend/src/tables/purchasing/PurchaseOrderLineItemTable.tsx +++ b/src/frontend/src/tables/purchasing/PurchaseOrderLineItemTable.tsx @@ -125,17 +125,18 @@ export function PurchaseOrderLineItemTable({ return [ { accessor: 'part', - title: t`Internal Part`, + title: t`Part`, sortable: true, switchable: false, render: (record: any) => PartColumn({ part: record.part_detail }) }, { - accessor: 'description', - title: t`Part Description`, - - sortable: false, - render: (record: any) => record?.part_detail?.description + accessor: 'part_detail.IPN', + sortable: false + }, + { + accessor: 'part_detail.description', + sortable: false }, ReferenceColumn({}), { diff --git a/src/frontend/src/tables/sales/ReturnOrderLineItemTable.tsx b/src/frontend/src/tables/sales/ReturnOrderLineItemTable.tsx index dc1b1bcf09b9..24698ea6967a 100644 --- a/src/frontend/src/tables/sales/ReturnOrderLineItemTable.tsx +++ b/src/frontend/src/tables/sales/ReturnOrderLineItemTable.tsx @@ -101,6 +101,14 @@ export default function ReturnOrderLineItemTable({ switchable: false, render: (record: any) => PartColumn({ part: record?.part_detail }) }, + { + accessor: 'part_detail.IPN', + sortable: false + }, + { + accessor: 'part_detail.description', + sortable: false + }, { accessor: 'item_detail.serial', title: t`Serial Number`,