import { Head, Link } from '@inertiajs/react'; import { InventoryNotice } from '@/components/inventory'; 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'; export default function ReceiptShow({ receipt, movements, }: { receipt: Receipt; movements: StockMovement[]; }) { return ( <>
Guia de remessa
{receipt.delivery_note}
Recebido em / por
{date(receipt.received_on)} ·{' '} {receipt.snapshot.receiver.name}
Armazém
{receipt.snapshot.warehouse?.name ?? 'Sem entrada física'}
{receipt.items.map((line) => (

{line.snapshot.order_item.description} ·{' '} {qualityStates[line.quality_status]}

Recebido: {quantity(line.received_milli)} · Aceite: {quantity(line.accepted_milli)} · Rejeitado: {quantity(line.rejected_milli)}{' '} {line.snapshot.order_item.unit}

{line.snapshot.stock_item ? `${line.snapshot.stock_item.code} · ${line.snapshot.stock_item.name}` : line.snapshot.physical ? 'Sem quantidade aceite em stock.' : 'Serviço, sem movimento físico.'}

{line.notes && (

{line.notes}

)}
))}
{movements.map((movement) => (

Movimento #{movement.id} · + {quantity(movement.quantity_milli)}{' '} {movement.snapshot.stock_item.unit} ·{' '} {movement.snapshot.stock_item.code} ·{' '} {movement.snapshot.warehouse.name}

))} {movements.length === 0 && (

Não houve entradas de bens aceites nesta confirmação.

)}

A confirmação e os movimentos não podem ser editados ou eliminados. Repetir a mesma confirmação não cria novas entradas.

Consultar a ordem e as quantidades pendentes
); } ReceiptShow.layout = { breadcrumbs: [ { title: 'Recepção', href: '/recepcoes' }, { title: 'Confirmação', href: '#' }, ], };