Frappe Erpnext Custom Print Invoice HTML

Hi everyone,

I’m working on a custom print format (HTML) for invoices in ERPNext. My goal is to display the header and footer on every page when the print output spans multiple pages.

I’ve tried implementing this using custom CSS (including some AI-generated approaches), but I’m facing inconsistent behavior—especially with page breaks and default print styles overriding my changes.

Has anyone successfully implemented repeating headers and footers in multi-page print formats in ERPNext? Any guidance, best practices, or examples would be really helpful.

Thanks in advance!

Hi @Rangubha_Makwana

Can you share your html code here with the doctype name.

Print formats handling has made so easy with the help of AI tools only requires to have clean and clear prompt will bring you what you want in your print format instantly.

Hi @ahsantareen ,


{% set currency_symbol = frappe.get_doc("Currency", doc.currency).symbol if doc.currency else "₹" %}

{% set is_outstate = "Out-state" in (doc.taxes_and_charges or "") %}

{% set supplier_addr = frappe.get_doc("Address", doc.supplier_address) if doc.supplier_address else None %}

{% set ship_addr = frappe.get_doc("Address", doc.shipping_address) if doc.shipping_address else None %}

<style>

html body table.pt {

width: 100%;

border-collapse: collapse;

table-layout: auto;

font-family: Arial, sans-serif;

font-size: 9px;

border-left: 1px solid #000;

border-right: 1px solid #000;

border-top: 1px solid #000;

border-bottom: 1px solid #000;

margin-top: 10px;

    }




html body table.pt td,

html body table.pt th {

border: 1px solid #000;

padding: 1px 2px !important;

vertical-align: top;

word-wrap: break-word;

font-size: 9px;

    }




html body table.pt td.npb {

padding: 0 !important;

    }




html body table.pt td.np {

padding: 0 !important;

border: none !important;

    }




html body table.pt tbody tr.ir td {

min-height: 60px;

vertical-align: top;

    }




html body table.pt tbody tr {

page-break-inside: avoid;

    }




html body table.pt thead {

display: table-header-group !important;

    }




html body table.pt tfoot {

display: table-footer-group !important;

    }




/* outer header/footer cells — table border handles left/right/top/bottom */

html body table.pt thead tr td.outer {

border-left: none !important;

border-right: none !important;

border-top: none !important;

    }




html body table.pt tfoot tr td.outer {

border-left: none !important;

border-right: none !important;

border-bottom: none !important;

    }




/* full-width tbody cells — only top separator, no left/right/bottom (table border handles sides) */

html body table.pt tbody tr td.fw {

border-left: none !important;

border-right: none !important;

border-bottom: none !important;

    }




/* split two-cell rows (Terms + Bank) */

html body table.pt tbody tr td.fw2 {

border-bottom: none !important;

    }




html body table.pt tbody tr td.fw2:first-child {

border-left: none !important;

    }




html body table.pt tbody tr td.fw2:last-child {

border-right: none !important;

    }




/* strip inner left/right from first and last column of every tbody row (table border handles sides) */

html body table.pt tbody tr td:first-child {

border-left: none !important;

    }




html body table.pt tbody tr td:last-child {

border-right: none !important;

    }




/* thead column header row */

html body table.pt thead tr.hbg td:first-child {

border-left: none !important;

    }




html body table.pt thead tr.hbg td:last-child {

border-right: none !important;

    }




/* totals spacer cell */

html body table.pt tbody tr td.sp {

border: none !important;

    }




@media print {

html body table.pt {

border-left: 1px solid #000 !important;

border-right: 1px solid #000 !important;

border-top: 1px solid #000 !important;

border-bottom: 1px solid #000 !important;

        }




html body table.pt thead {

display: table-header-group !important;

        }




html body table.pt tfoot {

display: table-footer-group !important;

        }

    }




.tc {

width: 100%;

font-size: 0;

line-height: 0;

    }




.tcl {

display: inline-block;

width: 50%;

vertical-align: top;

font-size: 7px;

line-height: 1.2;

padding: 1px 2px !important;

border-right: 1px solid #000;

box-sizing: border-box;

    }




.tcr {

display: inline-block;

width: 50%;

vertical-align: top;

font-size: 7px;

line-height: 1.2;

padding: 1px 2px !important;

box-sizing: border-box;

    }




.pr {

display: table;

width: 100%;

height: 12px;

    }




.pl {

display: table-cell;

font-weight: bold;

width: 80px;

white-space: nowrap;

font-size: 7.5px;

line-height: 1.2;

    }




.pv {

display: table-cell;

font-size: 7.5px;

line-height: 1.2;

    }




.st {

background: #f4f4f4;

font-weight: bold;

padding: 0px 2px;

text-align: center;

font-size: 7.5px;

border-bottom: 1px solid #000;

    }




.hbg {

background: #f4f4f4;

    }




.csr {

width: 26px;

    }




.chsn {

width: 58px;

    }




.cqty {

width: 48px;

    }




.cuom {

width: 36px;

    }




.crat {

width: 68px;

    }




.cgst {

width: 64px;

    }




.ctot {

width: 78px;

    }




.item-row {

height: 60px;

    }




.item-row-last {

height: 250px;

    }

</style>

<table class="pt">

<thead>

<!-- ROW 1: Company + Logo + Title -->

<tr>

<td colspan="10" class="npb outer" style="padding:0 !important;">

<div style="display:table; width:100%; border:none;">

<div style="display:table-row;">

<!-- Left Column: Company Details -->

<div

style="display:table-cell; width:45%; padding:1px 4px; vertical-align:top;">

<div style="font-size:9px; font-weight:bold; line-height:1.3;">{ doc.company_name }

</div>

<div style="font-size:7.5px; line-height:1.2;"> {some text}</div>

<div style="font-size:7.5px; line-height:1.2;">{address}</div>

<div style="font-size:7.5px; line-height:1.2;">Email: {doc.company_email}</div>

<div style="font-size:7.5px; line-height:1.2;">Phone: {doc.company_phone}</div>

<div style="font-size:7.5px; line-height:1.2;">GSTIN: {doc.gst_number} | CIN:

                                {doc.cin_number}</div>

</div>

<!-- Middle Column: PURCHASE ORDER -->

<div

style="display:table-cell; width:30%; text-align:center; vertical-align:bottom; padding-bottom:2px;">

<div style="font-size:10px; font-weight:bold; letter-spacing:1.5px; line-height:1.2;">

                                PURCHASE ORDER</div>

</div>

<!-- Right Column: Logo -->

<div

style="display:table-cell; width:25%; vertical-align:middle; text-align:center; padding:2px;">

<img src="/assets/shantiinorgochem/images/shantiinorgochem.svg" alt="Logo"

style="max-height:45px; max-width:85px; display:inline-block;">

</div>

</div>

</div>

</td>

</tr>

<!-- ROW 2: Doc Meta -->

<tr>

<td colspan="10" class="npb outer" style="padding:0 !important;">

<div class="tc">

<div class="tcl">

<div class="pr"><span class="pl">PO No.</span><span class="pv">: {{ doc.name or "" }}</span>

</div>

<div class="pr"><span class="pl">PO Date</span><span class="pv">: {{

                                doc.get_formatted("transaction_date") or "" }}</span></div>

<div class="pr"><span class="pl">State</span><span class="pv">: {{ doc.company_address_state or

                                "Gujarat" }}</span></div>

<div class="pr"><span class="pl">Reference No.</span><span class="pv">: -</span></div>

<div class="pr"><span class="pl">Reference Date</span><span class="pv">: -</span></div>

<div class="pr"><span class="pl">State Code</span><span class="pv">: {{

                                doc.company_address_state_code or "24" }}</span></div>

<div class="pr"><span class="pl">Place of Supply</span><span class="pv">: {{ doc.place_of_supply

                                or "" }}</span></div>

</div>

<div class="tcr">

<div class="pr"><span class="pl">Vendor Ref No.</span><span class="pv">: -</span></div>

<div class="pr"><span class="pl">Delivery Date</span><span class="pv">: {{

                                doc.get_formatted("schedule_date") or doc.get_formatted("delivery_date") or "" }}</span>

</div>

<div class="pr"><span class="pl">Contact Person</span><span class="pv">: </span></div>

<div class="pr"><span class="pl">Phone No.</span><span class="pv">: {{ doc.contact_mobile or

                                doc.contact_phone or "" }}</span></div>

<div class="pr"><span class="pl">Email</span><span class="pv">: {{ doc.contact_email or ""

                                }}</span></div>

<div class="pr"><span class="pl">Purchase Employee</span><span class="pv">: {{ doc.owner or ""

                                }}</span></div>

</div>

</div>

</td>

</tr>

<!-- ROW 3: Supplier Details -->

<tr>

<td colspan="10" class="npb outer" style="padding:0 !important;">

<div class="tc">

<div class="tcl" style="padding:0 !important;">

<div class="st">Details of Vendor (Bill From)</div>

<div style="padding:1px 2px;">

<div class="pr"><span class="pl">Name</span><span class="pv">: {{ doc.supplier_name or

                                    doc.supplier or "" }}</span></div>

<div class="pr"><span class="pl">Address</span><span class="pv">: {% if supplier_addr %}{{

                                    supplier_addr.address_line1 or "" }}{% if supplier_addr.address_line2 %}, {{

                                    supplier_addr.address_line2 }}{% endif %}, {{ supplier_addr.city or "" }}{% if

                                    supplier_addr.pincode %} - {{ supplier_addr.pincode }}{% endif %}, {{

                                    supplier_addr.state or "" }}, {{ supplier_addr.country or "" }}{% else %}{{

                                    doc.address_display or "" }}{% endif %}</span></div>

<div class="pr"><span class="pl">State / Code</span><span class="pv">: {{

                                    (supplier_addr.state if supplier_addr else "") or "" }} / {{

                                    (supplier_addr.gst_state_number if supplier_addr else "") or "" }}</span></div>

<div class="pr"><span class="pl">GST No.</span><span class="pv">: {{ (supplier_addr.gstin if

                                    supplier_addr else doc.supplier_gstin) or "" }}</span></div>

</div>

</div>

<div class="tcr" style="padding:0 !important;">

<div class="st">Details of Vendor (Ship To)</div>

<div style="padding:1px 2px;">

<div class="pr"><span class="pl">Name</span><span class="pv">: {{ doc.company or ""

                                    }}</span>

</div>

<div class="pr"><span class="pl">Address</span><span class="pv">: {% if ship_addr %}{{

                                    ship_addr.address_line1 or "" }}{% if ship_addr.address_line2 %}, {{

                                    ship_addr.address_line2 }}{% endif %}, {{ ship_addr.city or "" }}{% if

                                    ship_addr.pincode %} - {{ ship_addr.pincode }}{% endif %}, {{ ship_addr.state or ""

                                    }}, {{ ship_addr.country or "" }}{% else %}{{ doc.shipping_address_display or ""

                                    }}{% endif %}</span></div>

<div class="pr"><span class="pl">State / Code</span><span class="pv">: {{ (ship_addr.state

                                    if ship_addr else "") or "" }} / {{ (ship_addr.gst_state_number if ship_addr else

                                    "") or "" }}</span></div>

<div class="pr"><span class="pl">GST No.</span><span class="pv">: {{ doc.company_gstin or ""

                                    }}</span></div>

</div>

</div>

</div>

</td>

</tr>

<!-- ROW 4: Column Headers -->

<tr class="hbg">

<td class="csr" style="text-align:center;vertical-align:middle;font-weight:bold;">Sr<br>No.</td>

<td style="text-align:center;vertical-align:middle;font-weight:bold;">Item Description</td>

<td class="chsn" style="text-align:center;vertical-align:middle;font-weight:bold;">HSN</td>

<td class="cqty" style="text-align:center;vertical-align:middle;font-weight:bold;">Qty</td>

<td class="cuom" style="text-align:center;vertical-align:middle;font-weight:bold;">UOM</td>

<td class="crat" style="text-align:center;vertical-align:middle;font-weight:bold;">Unit<br>Price</td>

<td class="cgst" style="text-align:center;font-weight:bold;border-top:none !important;">Tax<br>Rate</td>

            {% if is_outstate %}

<td class="cgst" style="text-align:center;vertical-align:middle;font-weight:bold;">IGST<br>Amt.</td>

            {% else %}

<td class="cgst" style="text-align:center;vertical-align:middle;font-weight:bold;">CGST<br>Amt.</td>

<td class="cgst" style="text-align:center;vertical-align:middle;font-weight:bold;">SGST<br>Amt.</td>

            {% endif %}

<td class="ctot" style="text-align:center;vertical-align:middle;font-weight:bold;">Total<br>Amount</td>

</tr>

</thead>

<tfoot>

<tr>

<td colspan="10" class="npb outer" style="padding:2px 6px !important; height:120px; vertical-align:bottom;">

<div style="display:table; width:100%; height:100%;">

<div style="display:table-row;">

<div style="display:table-cell; width:33%;"></div>

<div style="display:table-cell; width:33%;"></div>

<div

style="display:table-cell; width:34%; text-align:right; vertical-align:top; font-size:7.5px; font-weight:bold; line-height:1.3;">

                            For, {{ doc.company or "SHANTI INORGANICS LIMITED" }}<br><span

style="font-weight:normal; font-size:7.5px;">(Formerly Known as Shanti Inorgo Chem (Guj)

                                Pvt Ltd)</span></div>

</div>

<div style="display:table-row;">

<div

style="display:table-cell; width:33%; vertical-align:bottom; font-size:7.5px; font-weight:bold;">

                            Prepared By</div>

<div

style="display:table-cell; width:33%; text-align:center; vertical-align:bottom; font-size:7.5px; font-weight:bold;">

                            Checked By &amp; Date</div>

<div

style="display:table-cell; width:34%; text-align:right; vertical-align:bottom; font-size:7.5px; font-weight:bold;">

                            Authorized Signatory</div>

</div>

</div>

</td>

</tr>

</tfoot>

<tbody>

        {% set total_item_cgst = [] %}

        {% set total_item_sgst = [] %}

        {% set total_item_igst = [] %}

        {% for item in doc.items %}

        {% set _ = total_item_cgst.append((item.cgst_amount or 0) | abs) %}

        {% set _ = total_item_sgst.append((item.sgst_amount or 0) | abs) %}

        {% set _ = total_item_igst.append((item.igst_amount or 0) | abs) %}

<tr class="ir {% if loop.last %}item-row-last{% else %}item-row{% endif %}">

<td style="text-align:center;">{{ loop.index }}</td>

<td>{{ item.item_name or item.description }}</td>

<td style="text-align:center;">{{ item.gst_hsn_code or "" }}</td>

<td style="text-align:right;">{{ "{:,.2f}".format(item.qty | abs) if item.qty else "" }}</td>

<td style="text-align:center;">{{ item.uom or "" }}</td>

<td style="text-align:right;">{{ currency_symbol }} {{ "{:,.2f}".format(item.rate | abs) if item.rate else

                ""

                }}</td>

<td style="text-align:center;">{% if is_outstate %}{{ item.igst_rate|int if item.igst_rate else "" }}{% if

                item.igst_rate %}%{% endif %}{% else %}{{ (item.cgst_rate + item.sgst_rate)|int if (item.cgst_rate or

                item.sgst_rate) else "" }}{% if (item.cgst_rate or item.sgst_rate) %}%{% endif %}{% endif %}</td>

            {% if is_outstate %}

<td style="text-align:right;">{{ currency_symbol }} {{ "{:,.2f}".format(item.igst_amount | abs) if

                item.igst_amount else "" }}</td>

            {% else %}

<td style="text-align:right;">{{ currency_symbol }} {{ "{:,.2f}".format(item.cgst_amount | abs) if

                item.cgst_amount else "" }}</td>

<td style="text-align:right;">{{ currency_symbol }} {{ "{:,.2f}".format(item.sgst_amount | abs) if

                item.sgst_amount else "" }}</td>

            {% endif %}

<td style="text-align:right;">{{ currency_symbol }} {{ "{:,.2f}".format(item.amount | abs) if item.amount

                else "" }}</td>

</tr>

        {% endfor %}

<!-- Summary row -->

<tr style="font-weight:bold;border-bottom: 1px solid black;">

<td colspan="3"

style="border-left:none !important; border-right:none !important; border-bottom:none !important;">

</td>

<td style="text-align:right; border-right:none !important; border-bottom:none !important;">{{ (doc.total_qty

                | abs) if doc.total_qty else "" }}</td>

<td colspan="2"

style="border-left:none !important; border-right:none !important; border-bottom:none !important;">

</td>

            {% if is_outstate %}

<td style="text-align:right; border-bottom:none !important;">{{ "{:,.2f}".format(total_item_igst|sum) }}

</td>

            {% else %}

<td style="text-align:right; border-bottom:none !important;">{{ "{:,.2f}".format(total_item_cgst|sum) }}

</td>

<td style="text-align:right; border-bottom:none !important;">{{ "{:,.2f}".format(total_item_sgst|sum) }}

</td>

            {% endif %}

<td style="border-left:none !important; border-right:none !important; border-bottom:none !important;"></td>

</tr>

<!-- Totals block -->

<tr>

<td colspan="{% if is_outstate %}7{% else %}8{% endif %}" class="sp" style=""></td>

<td colspan="{% if is_outstate %}2{% else %}3{% endif %}" class="npb"

style="border-top:none !important; border-right:none !important;">

<table style="width:100%; border-collapse:collapse; font-size:9px;">

<tr>

<td

style="border:none;border-bottom:1px solid #000;text-align:right;padding:1px 3px !important;font-weight:bold;width:55%;">

                            Sub Total</td>

<td

style="border:none;border-bottom:1px solid #000;border-left:1px solid #000;text-align:right;padding:1px 3px !important;">

                            {{ currency_symbol }} {{ "{:,.2f}".format(doc.total | abs) if doc.total else "" }}</td>

</tr>

                    {% for tax in doc.taxes %}

                    {% if tax.tax_amount or tax.base_tax_amount %}

<tr>

<td

style="border:none;border-bottom:1px solid #000;text-align:right;padding:1px 3px !important;font-weight:bold;">

                            Add : {{ tax.description }}</td>

<td

style="border:none;border-bottom:1px solid #000;border-left:1px solid #000;text-align:right;padding:1px 3px !important;">

                            {{ currency_symbol }} {{ "{:,.2f}".format(tax.tax_amount | abs) if tax.tax_amount else ""

                            }}</td>

</tr>

                    {% endif %}

                    {% endfor %}

<tr>

<td

style="border:none;border-bottom:1px solid #000;text-align:right;padding:1px 3px !important;font-weight:bold;">

                            Total GST</td>

<td

style="border:none;border-bottom:1px solid #000;border-left:1px solid #000;text-align:right;padding:1px 3px !important;">

                            {{ currency_symbol }} {{ "{:,.2f}".format(doc.total_taxes_and_charges | abs) if

                            doc.total_taxes_and_charges else "" }}</td>

</tr>

<tr>

<td style="border:none;text-align:right;padding:1px 3px !important;font-weight:bold;">Total</td>

<td

style="border:none;border-left:1px solid #000;text-align:right;padding:1px 3px !important;font-weight:bold;">

                            {{ currency_symbol }} {{ "{:,.2f}".format(doc.grand_total | abs) if doc.grand_total else ""

                            }}</td>

</tr>

</table>

</td>

</tr>

<!-- Amount in Words -->

<tr>

<td colspan="10" class="fw" style="padding:2px 4px !important; border-top:1px solid #000 !important;">

<strong>Amount in Words :</strong> {{ doc.in_words or "" }}

</td>

</tr>

<!-- GST Summary -->

<tr>

<td colspan="10" class="npb fw" style="padding:0 !important; border-top:1px solid #000 !important;">

<div style="padding:2px 4px; font-weight:bold;">GST Summary :-</div>

                {% set hsn_summary = {} %}

                {% for item in doc.items %}

                {% set hsn = item.gst_hsn_code or "Non-GST" %}

                {% set taxable_amount = (item.amount or 0) | abs %}

                {% set cgst_rate = item.cgst_rate or 0 %}

                {% set sgst_rate = item.sgst_rate or 0 %}

                {% set igst_rate = item.igst_rate or 0 %}

                {% set cgst_amount = (item.cgst_amount or 0) | abs %}

                {% set sgst_amount = (item.sgst_amount or 0) | abs %}

                {% set igst_amount = (item.igst_amount or 0) | abs %}

                {% if hsn in hsn_summary %}

                {% set _ = hsn_summary[hsn].update({'taxable_amount': hsn_summary[hsn].taxable_amount + taxable_amount,

                'cgst_amount': hsn_summary[hsn].cgst_amount + cgst_amount, 'sgst_amount': hsn_summary[hsn].sgst_amount +

                sgst_amount, 'igst_amount': hsn_summary[hsn].igst_amount + igst_amount}) %}

                {% else %}

                {% set _ = hsn_summary.update({hsn: {'taxable_amount': taxable_amount, 'cgst_rate': cgst_rate,

                'sgst_rate': sgst_rate, 'igst_rate': igst_rate, 'cgst_amount': cgst_amount, 'sgst_amount': sgst_amount,

                'igst_amount': igst_amount}}) %}

                {% endif %}

                {% endfor %}

<table style="width:100%; border-collapse:collapse; font-size:9px;">

<thead>

                        {% if is_outstate %}

<tr style="background:#f4f4f4;">

<th style="border:1px solid #000; padding:2px 4px; width:15%;">HSN/SAC</th>

<th style="border:1px solid #000; padding:2px 4px; width:30%;">Taxable Amount [INR]</th>

<th style="border:1px solid #000; padding:2px 4px; width:15%;">IGST %</th>

<th style="border:1px solid #000; padding:2px 4px; width:25%;">IGST Amount [INR]</th>

<th style="border:1px solid #000; padding:2px 4px; width:15%;">Total GST [INR]</th>

</tr>

                        {% else %}

<tr style="background:#f4f4f4;">

<th style="border:1px solid #000; padding:2px 4px; width:10%;">HSN/SAC</th>

<th style="border:1px solid #000; padding:2px 4px; width:15%;">Taxable Amount [INR]</th>

<th style="border:1px solid #000; padding:2px 4px; width:10%;">SGST %</th>

<th style="border:1px solid #000; padding:2px 4px; width:15%;">SGST Amount [INR]</th>

<th style="border:1px solid #000; padding:2px 4px; width:10%;">CGST %</th>

<th style="border:1px solid #000; padding:2px 4px; width:15%;">CGST Amount [INR]</th>

<th style="border:1px solid #000; padding:2px 4px; width:15%;">Total GST [INR]</th>

</tr>

                        {% endif %}

</thead>

<tbody>

                        {% for hsn, data in hsn_summary.items() %}

<tr>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px;">{{ hsn }}</td>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                currency_symbol }} {{ "{:,.2f}".format(data.taxable_amount) }}</td>

                            {% if is_outstate %}

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                data.igst_rate }}</td>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                currency_symbol }} {{ "{:,.2f}".format(data.igst_amount) }}</td>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                currency_symbol }} {{ "{:,.2f}".format(data.igst_amount) }}</td>

                            {% else %}

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                data.sgst_rate }}</td>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                currency_symbol }} {{ "{:,.2f}".format(data.sgst_amount) }}</td>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                data.cgst_rate }}</td>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                currency_symbol }} {{ "{:,.2f}".format(data.cgst_amount) }}</td>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                currency_symbol }} {{ "{:,.2f}".format(data.cgst_amount + data.sgst_amount) }}</td>

                            {% endif %}

</tr>

                        {% endfor %}

<tr style="font-weight:bold;">

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:center;">

                                TOTAL</td>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                currency_symbol }} {{ "{:,.2f}".format((doc.total or 0) | abs) }}</td>

                            {% if is_outstate %}

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px;"></td>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                currency_symbol }} {{ "{:,.2f}".format((doc.total_igst or 0) | abs) }}</td>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                currency_symbol }} {{ "{:,.2f}".format((doc.total_taxes_and_charges or 0) | abs) }}</td>

                            {% else %}

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px;"></td>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                currency_symbol }} {{ "{:,.2f}".format((doc.total_sgst or 0) | abs) }}</td>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px;"></td>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                currency_symbol }} {{ "{:,.2f}".format((doc.total_cgst or 0) | abs) }}</td>

<td style="border:1px solid #000;border-bottom: none; padding:2px 4px; text-align:right;">{{

                                currency_symbol }} {{ "{:,.2f}".format((doc.total_taxes_and_charges or 0) | abs) }}</td>

                            {% endif %}

</tr>

</tbody>

</table>

</td>

</tr>

<!-- Terms & Bank Details -->

<tr>

<td colspan="5" class="fw2"

style="padding:2px 4px !important; vertical-align:top; border-top:1px solid #000 !important; border-right:1px solid #000 !important;">

<strong style="text-decoration:underline;">Terms &amp; Conditions :</strong><br>

                Payment Terms : {{ doc.payment_terms_template or "Net-30" }}

</td>

<td colspan="5" class="fw2"

style="padding:2px 4px !important; vertical-align:top; border-top:1px solid #000 !important;">

<strong style="text-decoration:underline;">Our Bank Details :</strong><br>

<div style="display:table; width:100%; font-size:7.5px;">

<div style="display:table-row;"><span style="display:table-cell; font-weight:bold; width:70px;">Bank

                            Name</span><span style="display:table-cell;">: {{ doc.bank_name or "" }}</span></div>

<div style="display:table-row;"><span style="display:table-cell; font-weight:bold;">Acct.

                            No.</span><span style="display:table-cell;">: {{ doc.bank_account_no or "" }}</span></div>

<div style="display:table-row;"><span style="display:table-cell; font-weight:bold;">Bank

                            Branch</span><span style="display:table-cell;">: {{ doc.bank_branch or "" }}</span></div>

<div style="display:table-row;"><span style="display:table-cell; font-weight:bold;">IFSC

                            No.</span><span style="display:table-cell;">: {{ doc.ifsc_code or "" }}</span></div>

</div>

</td>

</tr>

<!-- Remarks -->

<tr>

<td colspan="10" class="fw" style="padding:2px 4px !important; border-top:1px solid #000 !important;">

<strong>Remarks :</strong> {{ doc.custom_remarks or doc.remarks or "" }}

</td>

</tr>

</tbody>

</table>