{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "invoice-print-page", "title": "Invoice Print Page", "description": "Print-optimized invoice layout without navigation chrome.", "registryDependencies": [ "https://raw.githubusercontent.com/dnachavez/adminlte-next/master/public/r/adminlte-theme.json", "https://raw.githubusercontent.com/dnachavez/adminlte-next/master/public/r/adminlte-table.json" ], "files": [ { "path": "registry/new-york/invoice-print-page/blocks/invoice-print-page.tsx", "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/registry/new-york/adminlte-theme/lib/cn\"\n\ninterface InvoicePrintItem {\n id: string\n quantity: number\n description: string\n serialNumber?: string\n unitPrice: number\n}\n\ninterface InvoicePrintPageProps extends React.HTMLAttributes {\n invoiceNumber: string\n date: string\n from: { name: string; address: string; phone?: string; email?: string }\n to: { name: string; address: string; phone?: string; email?: string }\n items: InvoicePrintItem[]\n taxRate?: number\n shippingCost?: number\n}\n\nfunction InvoicePrintPage({\n className,\n invoiceNumber,\n date,\n from,\n to,\n items,\n taxRate = 0,\n shippingCost = 0,\n ...props\n}: InvoicePrintPageProps) {\n const subtotal = items.reduce((s, i) => s + i.quantity * i.unitPrice, 0)\n const tax = subtotal * (taxRate / 100)\n const total = subtotal + tax + shippingCost\n\n return (\n \n
\n
\n

{from.name}

\n
\n {from.address &&
{from.address}
}\n {from.phone &&
Phone: {from.phone}
}\n {from.email &&
Email: {from.email}
}\n
\n
\n
\n
Invoice #{invoiceNumber}
\n
{date}
\n
\n
\n\n
\n To: {to.name}\n {to.address && , {to.address}}\n
\n\n \n \n \n \n \n \n \n \n \n \n {items.map((item) => (\n \n \n \n \n \n \n ))}\n \n
QtyDescriptionSerial #Subtotal
{item.quantity}{item.description}{item.serialNumber || \"-\"}${(item.quantity * item.unitPrice).toFixed(2)}
\n\n
\n
\n
\n Subtotal:${subtotal.toFixed(2)}\n
\n {taxRate > 0 && (\n
\n Tax ({taxRate}%):${tax.toFixed(2)}\n
\n )}\n {shippingCost > 0 && (\n
\n Shipping:${shippingCost.toFixed(2)}\n
\n )}\n
\n Total:${total.toFixed(2)}\n
\n
\n
\n \n )\n}\n\nexport { InvoicePrintPage }\nexport type { InvoicePrintPageProps }\n", "type": "registry:component" } ], "type": "registry:block" }