const sections: ERPDocumentSection<InvoiceLine>[] = [
{
type: 'table',
title: 'Itemised Tax Details',
rows: invoice.lines,
columns: [
{ header: '#', render: (_line, index) => index + 1 },
{ header: 'Description', render: line => <strong>{line.description}</strong> },
{ header: 'HSN/SAC', render: line => line.hsnSac },
{ header: 'Qty', align: 'right', render: line => line.qty.toLocaleString('en-IN') },
{ header: 'Rate', align: 'right', render: line => formatINR(line.rate) },
{ header: 'Taxable', align: 'right', render: line => formatINR(getInvoiceLineAmounts(line).taxable) },
{ header: 'CGST', align: 'right', render: line => <>{line.cgstRate}%<br />{formatINR(getInvoiceLineAmounts(line).cgst)}</> },
{ header: 'SGST', align: 'right', render: line => <>{line.sgstRate}%<br />{formatINR(getInvoiceLineAmounts(line).sgst)}</> },
{ header: 'Total', align: 'right', render: line => <strong>{formatINR(getInvoiceLineAmounts(line).total)}</strong> },
],
},
{
type: 'totals',
summary: {
title: 'GST & E-Invoice Reference',
lines: [
<><strong>IRN:</strong> {invoice.irn}</>,
<><strong>Amount in words:</strong> {invoice.amountInWords}</>,
],
},
totals: [
{ label: 'Taxable Value', value: formatINR(totals.taxable) },
{ label: 'CGST', value: formatINR(totals.cgst) },
{ label: 'SGST', value: formatINR(totals.sgst) },
{ label: 'Invoice Total', value: formatINR(totals.total), highlight: true },
],
},
{
type: 'twoColumn',
boxes: [
{ title: 'Terms & Conditions', lines: invoice.terms },
{ title: 'Notes', lines: invoice.notes },
],
},
{
type: 'signatures',
signatures: [
{ title: 'Prepared By', name: 'Accounts Executive' },
{ title: 'Authorised Signatory', name: invoice.authorizedBy },
],
},
];