Skip to content

Commit

Permalink
[PUI] Tweak purchase order line table (inventree#7656)
Browse files Browse the repository at this point in the history
* Add "packaging" field to PO line table

* Fixes for order detail pages
  • Loading branch information
SchrodingersGat authored Jul 15, 2024
1 parent fc0a860 commit b96b8b8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 28 deletions.
14 changes: 0 additions & 14 deletions src/frontend/src/pages/purchasing/PurchaseOrderDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,6 @@ export default function PurchaseOrderDetail() {
];

let tr: DetailsField[] = [
{
type: 'text',
name: 'line_items',
label: t`Line Items`,
icon: 'list'
},
{
type: 'progressbar',
name: 'completed',
Expand All @@ -148,14 +142,6 @@ export default function PurchaseOrderDetail() {
total: order.line_items,
progress: order.completed_lines
},
{
type: 'progressbar',
name: 'shipments',
icon: 'shipment',
label: t`Completed Shipments`,
total: order.shipments,
progress: order.completed_shipments
},
{
type: 'text',
name: 'currency',
Expand Down
10 changes: 2 additions & 8 deletions src/frontend/src/pages/sales/SalesOrderDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@ export default function SalesOrderDetail() {
];

let tr: DetailsField[] = [
{
type: 'text',
name: 'line_items',
label: t`Line Items`,
icon: 'list'
},
{
type: 'progressbar',
name: 'completed',
Expand All @@ -126,8 +120,8 @@ export default function SalesOrderDetail() {
icon: 'shipment',
label: t`Completed Shipments`,
total: order.shipments,
progress: order.completed_shipments
// TODO: Fix this progress bar
progress: order.completed_shipments,
hidden: !order.shipments
},
{
type: 'text',
Expand Down
17 changes: 11 additions & 6 deletions src/frontend/src/tables/purchasing/PurchaseOrderLineItemTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
import { useTable } from '../../hooks/UseTable';
import { apiUrl } from '../../states/ApiState';
import { useUserState } from '../../states/UserState';
import { TableColumn } from '../Column';
import {
CurrencyColumn,
LinkColumn,
Expand Down Expand Up @@ -65,7 +66,7 @@ export function PurchaseOrderLineItemTable({
}
});

const tableColumns = useMemo(() => {
const tableColumns: TableColumn[] = useMemo(() => {
return [
{
accessor: 'part',
Expand Down Expand Up @@ -138,17 +139,21 @@ export function PurchaseOrderLineItemTable({
)
},
{
accessor: 'pack_quantity',
accessor: 'supplier_part_detail.packaging',
sortable: false,
title: t`Pack Quantity`,
render: (record: any) => record?.supplier_part_detail?.pack_quantity
title: t`Packaging`
},
{
accessor: 'SKU',
accessor: 'supplier_part_detail.pack_quantity',
sortable: false,
title: t`Pack Quantity`
},
{
accessor: 'supplier_part_detail.SKU',
title: t`Supplier Code`,
switchable: false,
sortable: true,
render: (record: any) => record?.supplier_part_detail?.SKU
ordering: 'SKU'
},
{
accessor: 'supplier_link',
Expand Down

0 comments on commit b96b8b8

Please sign in to comment.