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}
{activeDocument.customerName}
Quick Actions
Update document status without opening the full editor.
Issue Date
Expires
Lines
Approval
Discount
Tax
Freight
Total
Revision History
Automatic snapshots are recorded when the document changes status, content, or approval state.
Customer
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
Sales-order demand is netted against available stock, active reservations, open work orders, and open purchase orders before new build or buy quantities are recommended.
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
Shipment records currently tied to this sales order.