@@ -6,6 +6,9 @@ import { PageTitle, Panel } from '@/components/procurement';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { date, money, roleLabels } from '@/types/procurement';
|
||||
import type { PurchaseOrder } from '@/types/purchase';
|
||||
import OrderCancellationRequest, {
|
||||
type OrderCancellationState,
|
||||
} from '@/components/order-cancellation-request';
|
||||
|
||||
type History = {
|
||||
id: number;
|
||||
@@ -22,20 +25,32 @@ const actions: Record<string, string> = {
|
||||
export default function OrderShow({
|
||||
order,
|
||||
history,
|
||||
orderCancellation,
|
||||
}: {
|
||||
order: PurchaseOrder;
|
||||
history: History[];
|
||||
orderCancellation?: OrderCancellationState;
|
||||
}) {
|
||||
const snapshot = order.snapshot;
|
||||
return (
|
||||
<>
|
||||
<Head title={order.number} />
|
||||
<Link
|
||||
href={`/ordens/${order.id}/recepcoes`}
|
||||
className="mx-auto mt-4 w-full max-w-6xl px-5 text-sm font-medium text-teal-700 dark:text-teal-400"
|
||||
>
|
||||
Recepções, qualidade e quantidades pendentes
|
||||
</Link>
|
||||
{orderCancellation && (
|
||||
<div className="mx-auto mt-4 w-full max-w-6xl px-5">
|
||||
<OrderCancellationRequest
|
||||
orderId={order.id}
|
||||
state={orderCancellation}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{(!orderCancellation || orderCancellation.state === 'issued') && (
|
||||
<Link
|
||||
href={`/ordens/${order.id}/recepcoes`}
|
||||
className="mx-auto mt-4 w-full max-w-6xl px-5 text-sm font-medium text-teal-700 dark:text-teal-400"
|
||||
>
|
||||
Recepções, qualidade e quantidades pendentes
|
||||
</Link>
|
||||
)}
|
||||
<div className="mx-auto flex w-full max-w-6xl flex-col gap-7 p-5 lg:p-8">
|
||||
<PageTitle
|
||||
eyebrow={snapshot.company.name}
|
||||
|
||||
Reference in New Issue
Block a user