diff --git a/docs/order-acknowledgement-po-233782.pdf b/docs/order-acknowledgement-po-233782.pdf new file mode 100644 index 0000000..71b6b0f Binary files /dev/null and b/docs/order-acknowledgement-po-233782.pdf differ diff --git a/src/app/(portal)/inventory/finished-goods/page.tsx b/src/app/(portal)/inventory/finished-goods/page.tsx index 8c3623d..8c8fc96 100644 --- a/src/app/(portal)/inventory/finished-goods/page.tsx +++ b/src/app/(portal)/inventory/finished-goods/page.tsx @@ -4,6 +4,7 @@ import { getQuestSession, getActiveCompany, isSubUser, + hasPermission, } from '@/lib/permissions'; import { redirect } from 'next/navigation'; import { InventorySummaryTable } from '@/components/inventory/inventory-summary-table'; @@ -23,13 +24,16 @@ async function FinishedGoodsInventoryData() { const dbName = `[${process.env.PORTAL_DB_NAME || 'VorteqPortal'}]`; const sub = userIsSubUser ? 1 : 0; - const inventory = await getFinishedGoodsSummary( - activeCompany.epicor_cust_id, - dbName, - sub - ).catch(() => []); + const [inventory, canShip] = await Promise.all([ + getFinishedGoodsSummary( + activeCompany.epicor_cust_id, + dbName, + sub + ).catch(() => []), + hasPermission('create_shipment_request'), + ]); - return ; + return ; } function LoadingSkeleton() { diff --git a/src/components/inventory/inventory-detail-table.tsx b/src/components/inventory/inventory-detail-table.tsx index 379c0b2..6ff2ae1 100644 --- a/src/components/inventory/inventory-detail-table.tsx +++ b/src/components/inventory/inventory-detail-table.tsx @@ -564,7 +564,7 @@ export function InventoryDetailTable({ category, }: Props) { if (embedded) { - return ; + return ; } return ( diff --git a/src/components/inventory/inventory-summary-table.tsx b/src/components/inventory/inventory-summary-table.tsx index 61fd90e..271a583 100644 --- a/src/components/inventory/inventory-summary-table.tsx +++ b/src/components/inventory/inventory-summary-table.tsx @@ -2,7 +2,6 @@ import { useState, useCallback } from 'react'; import { - Table, TableBody, TableCell, TableRow, @@ -24,6 +23,7 @@ import { SortableTableHead, useSortableTable, } from '@/components/ui/sortable-table-head'; +import { CartBar } from '@/components/requests/cart-bar'; const CATEGORY_COLORS: Record = { wip: 'bg-emerald-600 text-white', @@ -37,11 +37,14 @@ const CATEGORY_COLORS: Record = { type InventorySummaryTableProps = { data: InventorySummaryRow[]; category: string; + /** Whether to show the shipment cart bar */ + cartEnabled?: boolean; }; export function InventorySummaryTable({ data, category, + cartEnabled = false, }: InventorySummaryTableProps) { const [searchTerm, setSearchTerm] = useState(''); const [dialogOpen, setDialogOpen] = useState(false); @@ -142,6 +145,8 @@ export function InventorySummaryTable({ return (
+ {cartEnabled && } +
@@ -160,7 +165,7 @@ export function InventorySummaryTable({
- +
Rows - + @@ -251,7 +256,7 @@ export function InventorySummaryTable({ ))} -
+
@@ -321,6 +326,8 @@ export function InventorySummaryTable({ plant={selectedRow?.plant_key || selectedRow?.plant} warehouse={selectedRow?.warehouse} embedded + cartEnabled={cartEnabled} + category={category} /> )}