Issue Date
import { permissions } from "@mrp/shared"; import type { SalesDocumentDetailDto, SalesDocumentStatus, SalesOrderPlanningDto, SalesOrderPlanningNodeDto } from "@mrp/shared/dist/sales/types.js"; import type { ShipmentSummaryDto } from "@mrp/shared/dist/shipping/types.js"; import { useEffect, useState } from "react"; import { Link, useNavigate, useParams } from "react-router-dom"; import { useAuth } from "../../auth/AuthProvider"; import { api, ApiError } from "../../lib/api"; import { ConfirmActionDialog } from "../../components/ConfirmActionDialog"; import { DocumentRevisionComparison } from "../../components/DocumentRevisionComparison"; import { salesConfigs, salesStatusOptions, type SalesDocumentEntity } from "./config"; import { SalesStatusBadge } from "./SalesStatusBadge"; import { ShipmentStatusBadge } from "../shipping/ShipmentStatusBadge"; function PlanningNodeCard({ node }: { node: SalesOrderPlanningNodeDto }) { return (
{config.detailEyebrow.toUpperCase()}
{activeDocument.customerName}
QUICK ACTIONS
Issue Date
Expires
Lines
Approval
Discount
Tax
Freight
Total
REVISION HISTORY
Customer
Project Link
{activeDocument.linkedProjectId ? (This {entity === "quote" ? "quote" : "sales order"} is already linked to a project, and downstream WO/PO launches will carry that project context.
No linked project is currently attached to this {entity === "quote" ? "quote" : "sales order"}.
)}Notes
{activeDocument.notes || "No notes recorded for this document."}
Line Items
{activeDocument.lines.length === 0 ? (| Item | Description | Qty | UOM | Unit Price | Total |
|---|---|---|---|---|---|
|
{line.itemSku}
{line.itemName}
|
{line.description} | {line.quantity} | {line.unitOfMeasure} | ${line.unitPrice.toFixed(2)} | ${line.lineTotal.toFixed(2)} |
DEMAND PLANNING
Build Recommendations
Purchase Recommendations
Uncovered
Planned Items
| Item | Gross | Linked WO | Linked PO | Available | Open WO | Open PO | Build | Buy | Uncovered | Actions |
|---|---|---|---|---|---|---|---|---|---|---|
|
{item.itemSku}
{item.itemName}
|
{item.grossDemand} | {item.linkedWorkOrderSupply} | {item.linkedPurchaseSupply} | {item.availableQuantity} | {item.openWorkOrderSupply} | {item.openPurchaseSupply} | {item.recommendedBuildQuantity} | {item.recommendedPurchaseQuantity} | {item.uncoveredQuantity} |
{canManageManufacturing && item.recommendedBuildQuantity > 0 ? (
Draft WO
) : null}
{canManagePurchasing && item.recommendedPurchaseQuantity > 0 ? (
Draft PO
) : null}
|
SHIPPING