commit21
This commit is contained in:
@@ -4,15 +4,26 @@ import { PageTitle, Panel } from '@/components/procurement';
|
||||
import { date } from '@/types/procurement';
|
||||
import { quantity, qualityStates, receiptStates } from '@/types/inventory';
|
||||
import type { Receipt, StockMovement } from '@/types/inventory';
|
||||
import ReceiptDocuments, {
|
||||
type ReceiptDocument,
|
||||
} from '@/components/receipt-documents';
|
||||
|
||||
export default function ReceiptShow({
|
||||
receipt,
|
||||
movements,
|
||||
correctedReceiptItems = {},
|
||||
documentsReady = false,
|
||||
canAddDocuments = false,
|
||||
documents = [],
|
||||
purchaseProcessHref = null,
|
||||
}: {
|
||||
receipt: Receipt;
|
||||
movements: StockMovement[];
|
||||
correctedReceiptItems?: Record<number, string>;
|
||||
documentsReady?: boolean;
|
||||
canAddDocuments?: boolean;
|
||||
documents?: ReceiptDocument[];
|
||||
purchaseProcessHref?: string | null;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
@@ -24,6 +35,20 @@ export default function ReceiptShow({
|
||||
description={`${receipt.snapshot.supplier.name} · ${receiptStates[receipt.status]}`}
|
||||
/>
|
||||
<InventoryNotice />
|
||||
<a
|
||||
href={`/recepcoes/${receipt.id}/imprimir`}
|
||||
className="text-sm underline"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Imprimir ou guardar a recepção como PDF
|
||||
</a>
|
||||
<ReceiptDocuments
|
||||
receiptId={receipt.id}
|
||||
ready={documentsReady}
|
||||
canAdd={canAddDocuments}
|
||||
documents={documents}
|
||||
/>
|
||||
<Panel title="Confirmação preservada">
|
||||
<dl className="grid gap-5 text-sm sm:grid-cols-3">
|
||||
<div>
|
||||
@@ -122,6 +147,14 @@ export default function ReceiptShow({
|
||||
>
|
||||
Consultar a ordem e as quantidades pendentes
|
||||
</Link>
|
||||
{purchaseProcessHref && (
|
||||
<Link
|
||||
className="text-sm underline"
|
||||
href={purchaseProcessHref}
|
||||
>
|
||||
Acompanhar o processo de compra de origem
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user