Invoice printing with Pre-Printed paper using dot-matrix printer - Urgent

Hello,

We have a requirement that print invoice in pre-printed dot-matrix paper. We already made custom print format, it is working perfect except one problem. Problem is invoices with more than one pages, the Total is repeating every pages. Since it is a pre-printed page, the position of total is fixed at bottom of the page. What actually required, that we need to print Total in the bottom of the last page only. Current Source code as follows:
HTML Code



.print-format table, .print-format tr,
.print-format td, .print-format div, .print-format p {
font-family: Monospace;
font-size: 8;
vertical-align: top;
}
@media screen {
.print-format {
width: 216mm;
padding: 0.0in;
min-height: 300mm;
}
}

    <div style="position: relative; top: .95in; left:18cm; width:100%">
    	<div class="row">        
            	<div >{{ doc.name}}</div>	
    	</div>
    </div>
    <div style="position: relative; top: 1.1in; left:18cm; width:100%">
    	<div class="row">        
            	<div >{{ doc.get_formatted("posting_date") or '' }}</div>	
    	</div>
    </div>

    <div style="position: relative; top: 1.3in; left:3cm; width:100%">
    	<div class="row">        
            	<div >{{ doc.customer_name }}</div>	
    	</div>
    </div>


    ​<div style="position: relative; top: 2.1in; left: 0.5cm;width:100%">
        <table class="table">

            <tbody >       

                {%- for row in doc.items -%}

                <tr>

                    <td style="width: 4%; text-align: center;"">{{ row.idx }}</td>

                    <td style="width: 14.6%; text-align: left;">{{ row.item_code }}</td>

                    <td style="width: 42.6% text-align: left;">{{ row.item_name}}</div></td>

    		<td style="width: 4%; text-align: center;">{{ row.uom or row.stock_uom }}</td>

                    <td style="width: 6.6%; text-align: center;">{{ row.qty }} </td>

                    <td style="width: 13.3%; text-align: right;">{{row.get_formatted("rate", doc) }}</td>

                    <td style="width: 14.6%; text-align: right;">{{row.get_formatted("amount", doc) }} </td>

    		<td style="width: 1%; text-align: right;">{{' '}} </td>

                </tr>

    	    {%- if row.idx==18 or row.idx==38 -%}
    		
       		 <tr class="page-break">
                     </tr> 
    	    {%- endif -%}
                {%- endfor -%}
            </tbody>
        </table>
    </div>​

    <div style="position:fixed; bottom:1in; left:0cm; width:100%">
     {%- for row in doc.taxes -%}
        {%- if not row.included_in_print_rate -%}
        {%- if row.tax_amount -%}      
    <div class="row">
        <div class="col-xs-6 text-right"></div>
        <div class="col-xs-4 text-right"><label>{{ row.description }}</label></div>
        <div class="col-xs-2 ">{{ row.get_formatted("tax_amount", doc) }}</div>
    </div> 
        {%- endif -%}
        {%- endif -%}
    {%- endfor -%}
    <div class="row">
        <div class="col-xs-6 text-right"></div>
        <div class="col-xs-4 text-right"></div>
        <div class="col-xs-2 ">{{ doc.get_formatted("total") or '' }}
        </div>
    </div>  
       
        <div class="row">
             <div class="col-xs-6 text-right"></div>
             <div class="col-xs-4 text-right"></div>
             <div class="col-xs-2 ">{{ doc.get_formatted("discount_amount") }}</div>
        </div> 
                        
    <div class="row">
        <div class="col-xs-6 text-right">{{ doc.in_words }}</div>
        <div class="col-xs-4 text-right"></div>
        <div class="col-xs-2 ">{{ doc.get_formatted("grand_total") }}</div>
    </div>

    <div class="row">
     <div class="col-xs-12 text-left">{{ doc.terms or '' }}</div>
    </div>
    </div>
    </html>

CSS Script

@media print{
   /* applied to our table */
   #report-table {
     /*-webkit-region-break-inside: auto; //tried for Chrome */
     page-break-inside:auto
  }

  /* applied to all our <tr> */
  #report-table tbody tr,
  #report-table .behave-tbody .behave-tr{
     /*-webkit-region-break-inside: avoid; //tried for Chrome */
     page-break-inside:avoid;
     break-after: auto;
     page-break-after: auto;
  }

  /* page break specific class */
  .page-break{
     break-after: always;
     /*-webkit-region-break-after: always; //tried for Chrome */
     page-break-after: always;
  }
}

SAME PROBLEM
:frowning_face:

Did you figure out a solution for this ?