sales & grn fixers

This commit is contained in:
2026-10-04 15:31:59 +05:30
parent cea433e320
commit 3d3dbbbb59
52 changed files with 20761 additions and 482 deletions
@@ -100,7 +100,7 @@ export default function PurchaseInvoicePrintPage({ params }: { params: Promise<{
<div><span className="text-muted-foreground">Grand total: </span><span className={layout.totalsHighlight}>{formatAmount(invoice.totals.grandTotal)}</span></div>
</div>
) : (
<div className={`grid ${layout.arrangement === "highlight" ? "md:grid-cols-2" : "md:grid-cols-3"} ${layout.infoGrid}`}>
<div className={`grid md:grid-cols-2 ${layout.infoGrid}`}>
<div className={layout.card}>
<div className={layout.cardLabel}>Vendor</div>
<div className={layout.cardValue}>{invoice.vendorSnapshotName}</div>
@@ -111,16 +111,6 @@ export default function PurchaseInvoicePrintPage({ params }: { params: Promise<{
<div className="mt-2 text-sm text-muted-foreground">Vendor invoice date: {new Date(invoice.vendorInvoiceDate).toLocaleDateString()}</div>
<div className="mt-1 text-sm text-muted-foreground">Printed: {new Date().toLocaleString()}</div>
</div>
{layout.arrangement !== "highlight" && (
<div className={layout.card}>
<div className={layout.cardLabel}>Totals</div>
<div className="mt-2 grid grid-cols-2 gap-2 text-sm">
<div className="text-muted-foreground">Subtotal</div><div className="text-right font-medium">{formatAmount(invoice.totals.subtotal)}</div>
<div className="text-muted-foreground">VAT</div><div className="text-right font-medium">{formatAmount(invoice.totals.vatTotal)}</div>
<div className="text-muted-foreground">Grand total</div><div className={`text-right ${layout.totalsHighlight}`}>{formatAmount(invoice.totals.grandTotal)}</div>
</div>
</div>
)}
</div>
)}
@@ -149,6 +139,18 @@ export default function PurchaseInvoicePrintPage({ params }: { params: Promise<{
</Table>
</div>
{/* Totals sit under the GRN lines, right-aligned, like an invoice footer. */}
{layout.arrangement !== "highlight" && (
<div className={`ml-auto mt-4 w-full max-w-xs ${layout.card}`}>
<div className={layout.cardLabel}>Totals</div>
<div className="mt-2 grid grid-cols-2 gap-2 text-sm">
<div className="text-muted-foreground">Subtotal</div><div className="text-right font-medium">{formatAmount(invoice.totals.subtotal)}</div>
<div className="text-muted-foreground">VAT</div><div className="text-right font-medium">{formatAmount(invoice.totals.vatTotal)}</div>
<div className="text-muted-foreground">Grand total</div><div className={`text-right ${layout.totalsHighlight}`}>{formatAmount(invoice.totals.grandTotal)}</div>
</div>
</div>
)}
<InvoicePrintFooter company={company} template={template} />
</div>
)
@@ -42,7 +42,7 @@ export default function SalesInvoicePrintPage({ params }: { params: Promise<{ id
}
Promise.all([
customersApi.list({ pageSize: 200 }),
customersApi.list({ pageSize: 200, includeCashCustomer: true }),
itemsApi.list({ pageSize: 200 }),
uomsApi.list({ pageSize: 200 }),
warehousesApi.list({ pageSize: 200 }),
@@ -125,7 +125,6 @@ export default function SalesInvoicePrintPage({ params }: { params: Promise<{ id
<div className={layout.card}>
<div className={layout.cardLabel}>Customer</div>
<div className={layout.cardValue}>{invoice.customerSnapshotName}</div>
<div className="mt-1 text-sm text-muted-foreground">Customer ID: {invoice.customerId}</div>
{invoice.customerSnapshotTaxNo ? <div className="mt-1 text-sm text-muted-foreground">Tax No: {invoice.customerSnapshotTaxNo}</div> : null}
{customer?.displayName ? <div className="mt-1 text-sm text-muted-foreground">Customer: {customer.displayName}</div> : null}
</div>